dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu/virt: fix handling of the atomic flag
@ 2020-11-03 21:54 Alex Deucher
  2020-11-03 22:18 ` Luben Tuikov
  2020-11-04  9:39 ` Daniel Vetter
  0 siblings, 2 replies; 4+ messages in thread
From: Alex Deucher @ 2020-11-03 21:54 UTC (permalink / raw)
  To: amd-gfx, dri-devel; +Cc: Alex Deucher, daniel.vetter

Use the per device drm driver feature flags rather than the
global one.  This way we can make the drm driver struct const.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
index d0aea5e39531..8aff6ef50f91 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
@@ -47,11 +47,13 @@ bool amdgpu_virt_mmio_blocked(struct amdgpu_device *adev)
 
 void amdgpu_virt_init_setting(struct amdgpu_device *adev)
 {
+	struct drm_device *ddev = adev_to_drm(adev);
+
 	/* enable virtual display */
 	if (adev->mode_info.num_crtc == 0)
 		adev->mode_info.num_crtc = 1;
 	adev->enable_virtual_display = true;
-	adev_to_drm(adev)->driver->driver_features &= ~DRIVER_ATOMIC;
+	ddev->driver_features &= ~DRIVER_ATOMIC;
 	adev->cg_flags = 0;
 	adev->pg_flags = 0;
 }
-- 
2.25.4

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/amdgpu/virt: fix handling of the atomic flag
  2020-11-03 21:54 [PATCH] drm/amdgpu/virt: fix handling of the atomic flag Alex Deucher
@ 2020-11-03 22:18 ` Luben Tuikov
  2020-11-04  9:39 ` Daniel Vetter
  1 sibling, 0 replies; 4+ messages in thread
From: Luben Tuikov @ 2020-11-03 22:18 UTC (permalink / raw)
  To: Alex Deucher, amd-gfx, dri-devel; +Cc: Alex Deucher, daniel.vetter

On 2020-11-03 4:54 p.m., Alex Deucher wrote:
> Use the per device drm driver feature flags rather than the
> global one.  This way we can make the drm driver struct const.
> 
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

Reviewed-by: Luben Tuikov <luben.tuikov@amd.com>

Yeah, that's a good change.

Regards,
Luben

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
> index d0aea5e39531..8aff6ef50f91 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
> @@ -47,11 +47,13 @@ bool amdgpu_virt_mmio_blocked(struct amdgpu_device *adev)
>  
>  void amdgpu_virt_init_setting(struct amdgpu_device *adev)
>  {
> +	struct drm_device *ddev = adev_to_drm(adev);
> +
>  	/* enable virtual display */
>  	if (adev->mode_info.num_crtc == 0)
>  		adev->mode_info.num_crtc = 1;
>  	adev->enable_virtual_display = true;
> -	adev_to_drm(adev)->driver->driver_features &= ~DRIVER_ATOMIC;
> +	ddev->driver_features &= ~DRIVER_ATOMIC;
>  	adev->cg_flags = 0;
>  	adev->pg_flags = 0;
>  }
> 

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/amdgpu/virt: fix handling of the atomic flag
  2020-11-03 21:54 [PATCH] drm/amdgpu/virt: fix handling of the atomic flag Alex Deucher
  2020-11-03 22:18 ` Luben Tuikov
@ 2020-11-04  9:39 ` Daniel Vetter
  2020-11-04 13:20   ` Alex Deucher
  1 sibling, 1 reply; 4+ messages in thread
From: Daniel Vetter @ 2020-11-04  9:39 UTC (permalink / raw)
  To: Alex Deucher; +Cc: Alex Deucher, daniel.vetter, dri-devel, amd-gfx

On Tue, Nov 03, 2020 at 04:54:50PM -0500, Alex Deucher wrote:
> Use the per device drm driver feature flags rather than the
> global one.  This way we can make the drm driver struct const.
> 
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Can we merge this through drm-misc-next so I can follow up with the
drm_device constification series there? Otherwise I need to sit on that
for another few weeks until all the backmerges are done.
-Daniel

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
> index d0aea5e39531..8aff6ef50f91 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
> @@ -47,11 +47,13 @@ bool amdgpu_virt_mmio_blocked(struct amdgpu_device *adev)
>  
>  void amdgpu_virt_init_setting(struct amdgpu_device *adev)
>  {
> +	struct drm_device *ddev = adev_to_drm(adev);
> +
>  	/* enable virtual display */
>  	if (adev->mode_info.num_crtc == 0)
>  		adev->mode_info.num_crtc = 1;
>  	adev->enable_virtual_display = true;
> -	adev_to_drm(adev)->driver->driver_features &= ~DRIVER_ATOMIC;
> +	ddev->driver_features &= ~DRIVER_ATOMIC;
>  	adev->cg_flags = 0;
>  	adev->pg_flags = 0;
>  }
> -- 
> 2.25.4
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/amdgpu/virt: fix handling of the atomic flag
  2020-11-04  9:39 ` Daniel Vetter
@ 2020-11-04 13:20   ` Alex Deucher
  0 siblings, 0 replies; 4+ messages in thread
From: Alex Deucher @ 2020-11-04 13:20 UTC (permalink / raw)
  To: Daniel Vetter
  Cc: Alex Deucher, Daniel Vetter, Maling list - DRI developers, amd-gfx list

On Wed, Nov 4, 2020 at 4:39 AM Daniel Vetter <daniel@ffwll.ch> wrote:
>
> On Tue, Nov 03, 2020 at 04:54:50PM -0500, Alex Deucher wrote:
> > Use the per device drm driver feature flags rather than the
> > global one.  This way we can make the drm driver struct const.
> >
> > Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
>
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>
> Can we merge this through drm-misc-next so I can follow up with the
> drm_device constification series there? Otherwise I need to sit on that
> for another few weeks until all the backmerges are done.

Sure feel free to add it to your series and merge it with the rest, or
I can merge it now.

Alex


> -Daniel
>
> > ---
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
> > index d0aea5e39531..8aff6ef50f91 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
> > @@ -47,11 +47,13 @@ bool amdgpu_virt_mmio_blocked(struct amdgpu_device *adev)
> >
> >  void amdgpu_virt_init_setting(struct amdgpu_device *adev)
> >  {
> > +     struct drm_device *ddev = adev_to_drm(adev);
> > +
> >       /* enable virtual display */
> >       if (adev->mode_info.num_crtc == 0)
> >               adev->mode_info.num_crtc = 1;
> >       adev->enable_virtual_display = true;
> > -     adev_to_drm(adev)->driver->driver_features &= ~DRIVER_ATOMIC;
> > +     ddev->driver_features &= ~DRIVER_ATOMIC;
> >       adev->cg_flags = 0;
> >       adev->pg_flags = 0;
> >  }
> > --
> > 2.25.4
> >
>
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-11-04 13:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-03 21:54 [PATCH] drm/amdgpu/virt: fix handling of the atomic flag Alex Deucher
2020-11-03 22:18 ` Luben Tuikov
2020-11-04  9:39 ` Daniel Vetter
2020-11-04 13:20   ` Alex Deucher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).