lkml.org 
[lkml]   [2023]   [Sep]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [RFC,drm-misc-next v4 3/9] drm/radeon: Implement .be_primary() callback
From
Am 04.09.23 um 21:57 schrieb Sui Jingfeng:
> From: Sui Jingfeng <suijingfeng@loongson.cn>
>
> On a machine with multiple GPUs, a Linux user has no control over which one
> is primary at boot time.

Question is why is that useful? Should we give users the ability to
control that?

I don't see an use case for this.

Regards,
Christian.

> This patch tries to solve the mentioned problem by
> implementing the .be_primary() callback. Pass radeon.modeset=10 on the
> kernel cmd line if you really want the device bound by radeon to be the
> primary video adapter, no matter what VGAARB say.
>
> Cc: Alex Deucher <alexander.deucher@amd.com>
> Cc: Christian Koenig <christian.koenig@amd.com>
> Signed-off-by: Sui Jingfeng <suijingfeng@loongson.cn>
> ---
> drivers/gpu/drm/radeon/radeon_device.c | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
> index 71f2ff39d6a1..b661cd3a8dc2 100644
> --- a/drivers/gpu/drm/radeon/radeon_device.c
> +++ b/drivers/gpu/drm/radeon/radeon_device.c
> @@ -1263,6 +1263,14 @@ static const struct vga_switcheroo_client_ops radeon_switcheroo_ops = {
> .can_switch = radeon_switcheroo_can_switch,
> };
>
> +static bool radeon_want_to_be_primary(struct pci_dev *pdev)
> +{
> + if (radeon_modeset == 10)
> + return true;
> +
> + return false;
> +}
> +
> /**
> * radeon_device_init - initialize the driver
> *
> @@ -1425,7 +1433,7 @@ int radeon_device_init(struct radeon_device *rdev,
> /* if we have > 1 VGA cards, then disable the radeon VGA resources */
> /* this will fail for cards that aren't VGA class devices, just
> * ignore it */
> - vga_client_register(rdev->pdev, radeon_vga_set_decode, NULL);
> + vga_client_register(rdev->pdev, radeon_vga_set_decode, radeon_want_to_be_primary);
>
> if (rdev->flags & RADEON_IS_PX)
> runtime = true;

\
 
 \ /
  Last update: 2023-09-05 19:12    [W:0.196 / U:0.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site