[Intel-xe] [PATCH 2/3] drm/xe: Register drm device prior to gt init

Iddamsetty, Aravind aravind.iddamsetty at intel.com
Thu May 4 12:03:44 UTC 2023



On 04-05-2023 16:50, Tejas Upadhyay wrote:
> GT init creates few sysfs entries under /sys/class/drm
> and makes use of drm_class device thus it needs drm
> device to be registered prior to gt init.
> 
> Signed-off-by: Tejas Upadhyay <tejas.upadhyay at intel.com>
> ---
>  drivers/gpu/drm/xe/xe_device.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
> index 45d6e5ff47fd..c5380914da18 100644
> --- a/drivers/gpu/drm/xe/xe_device.c
> +++ b/drivers/gpu/drm/xe/xe_device.c
> @@ -301,6 +301,10 @@ int xe_device_probe(struct xe_device *xe)
>  	if (err)
>  		goto err_irq_shutdown;
>  
> +	err = drm_dev_register(&xe->drm, 0);
I do not think it is necessary as we are not creating the file node
under /sys/class/drm but rather under /sys/bus/pci/devices/B:D:F/

Thanks,
Aravind.
> +	if (err)
> +		goto err_irq_shutdown;
> +
>  	for_each_gt(gt, xe, id) {
>  		err = xe_gt_init(gt);
>  		if (err)
> @@ -311,10 +315,6 @@ int xe_device_probe(struct xe_device *xe)
>  	if (err)
>  		goto err_fini_display;
>  
> -	err = drm_dev_register(&xe->drm, 0);
> -	if (err)
> -		goto err_irq_shutdown;
> -
>  	xe_display_register(xe);
>  
>  	xe_debugfs_register(xe);


More information about the Intel-xe mailing list