Skip to contentSkip to conversation

drm/amdgpu/virt: fix handling of the atomic flag

PATCH In review Alex Deucher 3 participants 4 messages Nov 3, 2020 – Nov 4, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu/virt: fix handling of the atomic flag

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

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c +3 -1
index d0aea5e39531..8aff6ef50f91 100644
@@ -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;
 }
Signature · 6 lines
2.25.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Alex Deucher

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

Yeah, that's a good change.

Regards,
Luben

Quoted 14 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c +1 -0
index d0aea5e39531..8aff6ef50f91 100644
@@ -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);

drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c bool amdgpu_virt_mmio_blocked(struct amdgpu_device *adev) · line 59

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c +2 -1
+
 	/* 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;
 }

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reviewed-by on v1 1/1
#2 lore raw
In reply to Alex Deucher
Quoted 4 lines · Alex Deucher

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

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

Quoted 26 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c +3 -1
index d0aea5e39531..8aff6ef50f91 100644
@@ -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;
 }
Signature · 1 line
2.25.4
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#3 lore raw
Quoted 5 lines · Daniel Vetter
Quoted 3 lines · Alex Deucher

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

Quoted 7 lines
Quoted 1 line

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

Quoted 25 lines

-Daniel

Quoted 23 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c +3 -1
index d0aea5e39531..8aff6ef50f91 100644
@@ -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;
 }
Quoted 8 lines
Quoted 3 lines

--
2.25.4

--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx