drm: Treewide plane/crtc legacy state sweeping
Subsystems (38)
cover drm: Treewide plane/crtc legacy state sweeping
From: Ville Syrjälä <[email protected]>
An attempt to hide the drm_plane/crtc legacy state better.
This also highlights the fact that a lot of supposedly atomic drivers are poking around in the legacy crtc state, which is rather questionable. For planes we did force the legacy state to NULL already to force drivers to behave. But even then it seems capable of confusing people with its high profile location directly under drm_plane.
This might end up as some kind of conflict
galore, but the alternative would involve trying
to wean the atomic drivers off one by one,
which would probably take forever. At least with
this the issue becomes visible and shouldn't be
forgotten as easily.
The cc list was getting way out of hand, so I had
to trim it a bit. Hopefully I didn't chop off too
many names...
Ville Syrjälä (2):
drm: Move plane->{fb,old_fb,crtc} to legacy sub-structure
drm: Move crtc->{x,y,mode,enabled} to legacy sub-structure
.../gpu/drm/amd/amdgpu/amdgpu_connectors.c | 7 +- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 20 ++--- drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c | 2 +- drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 35 ++++---- drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 35 ++++---- drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 37 ++++----- drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 35 ++++---- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 14 ++-- .../amd/display/amdgpu_dm/amdgpu_dm_crtc.c | 2 +- drivers/gpu/drm/amd/pm/amdgpu_dpm_internal.c | 4 +- drivers/gpu/drm/arm/hdlcd_drv.c | 2 +- drivers/gpu/drm/arm/malidp_hw.c | 2 +- drivers/gpu/drm/armada/armada_crtc.c | 12 ++- drivers/gpu/drm/ast/ast_dp.c | 8 +- drivers/gpu/drm/drm_atomic.c | 6 +- drivers/gpu/drm/drm_atomic_helper.c | 8 +- drivers/gpu/drm/drm_client_modeset.c | 10 +-- drivers/gpu/drm/drm_crtc.c | 31 +++---- drivers/gpu/drm/drm_crtc_helper.c | 80 ++++++++++--------- drivers/gpu/drm/drm_fb_helper.c | 12 +-- drivers/gpu/drm/drm_framebuffer.c | 4 +- drivers/gpu/drm/drm_plane.c | 69 ++++++++-------- drivers/gpu/drm/drm_plane_helper.c | 6 +- drivers/gpu/drm/drm_vblank.c | 2 +- drivers/gpu/drm/exynos/exynos5433_drm_decon.c | 4 +- drivers/gpu/drm/gma500/cdv_intel_display.c | 2 +- drivers/gpu/drm/gma500/cdv_intel_dp.c | 6 +- drivers/gpu/drm/gma500/cdv_intel_hdmi.c | 3 +- drivers/gpu/drm/gma500/cdv_intel_lvds.c | 6 +- drivers/gpu/drm/gma500/gma_display.c | 22 ++--- drivers/gpu/drm/gma500/oaktrail_crtc.c | 2 +- drivers/gpu/drm/gma500/psb_intel_display.c | 2 +- drivers/gpu/drm/gma500/psb_intel_lvds.c | 6 +- drivers/gpu/drm/gma500/psb_intel_sdvo.c | 8 +- drivers/gpu/drm/i2c/ch7006_drv.c | 7 +- drivers/gpu/drm/i2c/sil164_drv.c | 2 +- .../drm/i915/display/intel_modeset_setup.c | 4 +- drivers/gpu/drm/imx/lcdc/imx-lcdc.c | 31 ++++--- drivers/gpu/drm/mediatek/mtk_crtc.c | 6 +- drivers/gpu/drm/meson/meson_overlay.c | 2 +- drivers/gpu/drm/meson/meson_plane.c | 8 +- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 18 +++-- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 6 +- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 16 ++-- drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c | 4 +- drivers/gpu/drm/nouveau/dispnv04/crtc.c | 25 +++--- drivers/gpu/drm/nouveau/dispnv04/cursor.c | 2 +- drivers/gpu/drm/nouveau/dispnv04/dfp.c | 2 +- drivers/gpu/drm/nouveau/dispnv04/disp.c | 4 +- .../gpu/drm/nouveau/dispnv04/tvmodesnv17.c | 4 +- drivers/gpu/drm/nouveau/dispnv04/tvnv17.c | 7 +- drivers/gpu/drm/nouveau/nouveau_connector.c | 6 +- drivers/gpu/drm/qxl/qxl_display.c | 6 +- drivers/gpu/drm/radeon/atombios_crtc.c | 28 +++---- drivers/gpu/drm/radeon/cik.c | 12 +-- drivers/gpu/drm/radeon/evergreen.c | 16 ++-- drivers/gpu/drm/radeon/r100.c | 16 ++-- drivers/gpu/drm/radeon/r600_cs.c | 2 +- drivers/gpu/drm/radeon/r600_dpm.c | 4 +- drivers/gpu/drm/radeon/radeon_connectors.c | 7 +- drivers/gpu/drm/radeon/radeon_cursor.c | 29 +++---- drivers/gpu/drm/radeon/radeon_device.c | 2 +- drivers/gpu/drm/radeon/radeon_display.c | 26 +++--- drivers/gpu/drm/radeon/radeon_drv.c | 2 +- drivers/gpu/drm/radeon/radeon_legacy_crtc.c | 16 ++-- .../gpu/drm/radeon/radeon_legacy_encoders.c | 2 +- drivers/gpu/drm/radeon/radeon_pm.c | 2 +- drivers/gpu/drm/radeon/rs600.c | 10 +-- drivers/gpu/drm/radeon/rs690.c | 22 ++--- drivers/gpu/drm/radeon/rs780_dpm.c | 6 +- drivers/gpu/drm/radeon/rv515.c | 30 +++---- drivers/gpu/drm/radeon/rv770.c | 2 +- drivers/gpu/drm/radeon/si.c | 14 ++-- .../gpu/drm/renesas/rcar-du/rcar_du_crtc.c | 2 +- .../gpu/drm/renesas/shmobile/shmob_drm_crtc.c | 2 +- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 6 +- drivers/gpu/drm/sti/sti_crtc.c | 4 +- drivers/gpu/drm/sti/sti_cursor.c | 2 +- drivers/gpu/drm/sti/sti_gdp.c | 2 +- drivers/gpu/drm/sti/sti_hqvdp.c | 2 +- drivers/gpu/drm/sti/sti_tvout.c | 6 +- drivers/gpu/drm/sti/sti_vid.c | 2 +- drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 10 +-- drivers/gpu/drm/tiny/arcpgu.c | 2 +- drivers/gpu/drm/vboxvideo/vbox_mode.c | 2 +- drivers/gpu/drm/vc4/vc4_dpi.c | 2 +- drivers/gpu/drm/vc4/vc4_plane.c | 4 +- drivers/gpu/drm/virtio/virtgpu_display.c | 4 +- drivers/gpu/drm/vkms/vkms_composer.c | 4 +- drivers/gpu/drm/vkms/vkms_crtc.c | 2 +- drivers/gpu/drm/vkms/vkms_writeback.c | 4 +- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 8 +- drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c | 18 +++-- drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c | 9 ++- drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c | 4 +- drivers/gpu/drm/vmwgfx/vmwgfx_vkms.c | 2 +- drivers/gpu/drm/xen/xen_drm_front_kms.c | 2 +- include/drm/drm_crtc.h | 75 ++++++++--------- include/drm/drm_plane.h | 52 ++++++------ 100 files changed, 599 insertions(+), 547 deletions(-)
Signature · 1 line
2.45.2
PATCH 1/2 drm: Move plane->{fb, old_fb, crtc} to legacy sub-structure
From: Ville Syrjälä <[email protected]>
Hide the plane->fb/etc. footguns better by stashing them inside a "legacy" sub struct.
Eventually maybe we could turn 'legacy' into a pointer that only exists on legacy drivers to completely prevent any abuse by atomic drivers...
Side note: _dpu_plane_set_danger_state() looks completely broken.
--- .../gpu/drm/amd/amdgpu/amdgpu_connectors.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 6 +- drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 12 ++-- drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 12 ++-- drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 12 ++-- drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 12 ++-- drivers/gpu/drm/drm_atomic.c | 6 +- drivers/gpu/drm/drm_crtc.c | 22 +++---- drivers/gpu/drm/drm_crtc_helper.c | 20 +++--- drivers/gpu/drm/drm_fb_helper.c | 2 +- drivers/gpu/drm/drm_framebuffer.c | 4 +- drivers/gpu/drm/drm_plane.c | 64 +++++++++---------- drivers/gpu/drm/gma500/cdv_intel_display.c | 2 +- drivers/gpu/drm/gma500/cdv_intel_dp.c | 2 +- drivers/gpu/drm/gma500/cdv_intel_hdmi.c | 3 +- drivers/gpu/drm/gma500/cdv_intel_lvds.c | 2 +- drivers/gpu/drm/gma500/gma_display.c | 14 ++-- drivers/gpu/drm/gma500/oaktrail_crtc.c | 2 +- drivers/gpu/drm/gma500/psb_intel_display.c | 2 +- drivers/gpu/drm/gma500/psb_intel_lvds.c | 2 +- drivers/gpu/drm/gma500/psb_intel_sdvo.c | 2 +- drivers/gpu/drm/i2c/ch7006_drv.c | 2 +- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 6 +- drivers/gpu/drm/nouveau/dispnv04/crtc.c | 16 ++--- drivers/gpu/drm/nouveau/dispnv04/dfp.c | 2 +- drivers/gpu/drm/nouveau/dispnv04/disp.c | 4 +- drivers/gpu/drm/nouveau/dispnv04/tvnv17.c | 2 +- drivers/gpu/drm/radeon/atombios_crtc.c | 16 ++--- drivers/gpu/drm/radeon/evergreen.c | 2 +- drivers/gpu/drm/radeon/r100.c | 6 +- drivers/gpu/drm/radeon/radeon_connectors.c | 3 +- drivers/gpu/drm/radeon/radeon_device.c | 2 +- drivers/gpu/drm/radeon/radeon_display.c | 4 +- drivers/gpu/drm/radeon/radeon_legacy_crtc.c | 14 ++-- drivers/gpu/drm/radeon/rs600.c | 2 +- drivers/gpu/drm/radeon/rv770.c | 2 +- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 2 +- include/drm/drm_plane.h | 52 +++++++-------- 38 files changed, 173 insertions(+), 169 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c +1 -1
@@ -94,7 +94,7 @@ static void amdgpu_connector_property_change_mode(struct drm_encoder *encoder)if (crtc && crtc->enabled) {drm_crtc_helper_set_mode (crtc, &crtc->mode, - crtc->x, crtc->y, crtc->primary->fb); + crtc->x, crtc->y, crtc->primary->legacy.fb); } }
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +3 -3
@@ -216,7 +216,7 @@ int amdgpu_display_crtc_page_flip_target(struct drm_crtc *crtc, work->async = (page_flip_flags &DRM_MODE_PAGE_FLIP_ASYNC ) !=0 ;/* schedule unpin of the old buffer */ - obj = crtc->primary->fb->obj[0 ]; + obj = crtc->primary->legacy.fb->obj[0 ];/* take a reference to the old object */ work->old_abo =gem_to_amdgpu_bo (obj);
@@ -280,7 +280,7 @@ int amdgpu_display_crtc_page_flip_target(struct drm_crtc *crtc,DRM_DEBUG_DRIVER ("crtc:%d[%p], pflip_stat:AMDGPU_FLIP_PENDING, work: %p,\n" , amdgpu_crtc->crtc_id, amdgpu_crtc, work);/* update crtc fb */ - crtc->primary->fb = fb; + crtc->primary->legacy.fb = fb;spin_unlock_irqrestore (&crtc->dev->event_lock, flags);amdgpu_display_flip_work_func (&work->flip_work.work);return 0 ;
@@ -1715,7 +1715,7 @@ int amdgpu_display_suspend_helper(struct amdgpu_device *adev)/* unpin the front buffers and cursors */ list_for_each_entry (crtc, &dev->mode_config.crtc_list, head) {struct amdgpu_crtc *amdgpu_crtc =to_amdgpu_crtc (crtc); -struct drm_framebuffer *fb = crtc->primary->fb; +struct drm_framebuffer *fb = crtc->primary->legacy.fb;struct amdgpu_bo *robj;if (amdgpu_crtc->cursor_bo && !adev->enable_virtual_display) {
drivers/gpu/drm/amd/amdgpu/dce_v10_0.c +6 -6
@@ -235,7 +235,7 @@ static void dce_v10_0_page_flip(struct amdgpu_device *adev, int crtc_id, u64 crtc_base, bool async) { struct amdgpu_crtc *amdgpu_crtc = adev->mode_info.crtcs[crtc_id]; -struct drm_framebuffer *fb = amdgpu_crtc->base.primary->fb; +struct drm_framebuffer *fb = amdgpu_crtc->base.primary->legacy.fb;u32 tmp;/* flip at hsync for async, default is vsync */
@@ -1861,7 +1861,7 @@ static int dce_v10_0_crtc_do_set_base(struct drm_crtc *crtc,bool bypass_lut = false;/* no fb bound */ -if (!atomic && !crtc->primary->fb) { +if (!atomic && !crtc->primary->legacy.fb) {DRM_DEBUG_KMS ("No FB bound\n" );return 0 ; }
@@ -1869,7 +1869,7 @@ static int dce_v10_0_crtc_do_set_base(struct drm_crtc *crtc,if (atomic) target_fb = fb;else - target_fb = crtc->primary->fb; + target_fb = crtc->primary->legacy.fb;/* If atomic, assume fb object is pinned & idle & fenced and * just update base pointers
@@ -2074,7 +2074,7 @@ static int dce_v10_0_crtc_do_set_base(struct drm_crtc *crtc,/* set pageflip to happen anywhere in vblank interval */ WREG32 (mmMASTER_UPDATE_MODE + amdgpu_crtc->crtc_offset,0 ); -if (!atomic && fb && fb != crtc->primary->fb) { +if (!atomic && fb && fb != crtc->primary->legacy.fb) { abo =gem_to_amdgpu_bo (fb->obj[0 ]); r =amdgpu_bo_reserve (abo, true);if (unlikely (r !=0 ))
@@ -2557,11 +2557,11 @@ static void dce_v10_0_crtc_disable(struct drm_crtc *crtc)int i;dce_v10_0_crtc_dpms (crtc,DRM_MODE_DPMS_OFF ); -if (crtc->primary->fb) { +if (crtc->primary->legacy.fb) {int r;struct amdgpu_bo *abo; - abo =gem_to_amdgpu_bo (crtc->primary->fb->obj[0 ]); + abo =gem_to_amdgpu_bo (crtc->primary->legacy.fb->obj[0 ]); r =amdgpu_bo_reserve (abo, true);if (unlikely (r))DRM_ERROR ("failed to reserve abo before unpin\n" );
drivers/gpu/drm/amd/amdgpu/dce_v11_0.c +6 -6
@@ -259,7 +259,7 @@ static void dce_v11_0_page_flip(struct amdgpu_device *adev, int crtc_id, u64 crtc_base, bool async) { struct amdgpu_crtc *amdgpu_crtc = adev->mode_info.crtcs[crtc_id]; -struct drm_framebuffer *fb = amdgpu_crtc->base.primary->fb; +struct drm_framebuffer *fb = amdgpu_crtc->base.primary->legacy.fb;u32 tmp;/* flip immediate for async, default is vsync */
@@ -1911,7 +1911,7 @@ static int dce_v11_0_crtc_do_set_base(struct drm_crtc *crtc,bool bypass_lut = false;/* no fb bound */ -if (!atomic && !crtc->primary->fb) { +if (!atomic && !crtc->primary->legacy.fb) {DRM_DEBUG_KMS ("No FB bound\n" );return 0 ; }
@@ -1919,7 +1919,7 @@ static int dce_v11_0_crtc_do_set_base(struct drm_crtc *crtc,if (atomic) target_fb = fb;else - target_fb = crtc->primary->fb; + target_fb = crtc->primary->legacy.fb;/* If atomic, assume fb object is pinned & idle & fenced and * just update base pointers
@@ -2124,7 +2124,7 @@ static int dce_v11_0_crtc_do_set_base(struct drm_crtc *crtc,/* set pageflip to happen anywhere in vblank interval */ WREG32 (mmCRTC_MASTER_UPDATE_MODE + amdgpu_crtc->crtc_offset,0 ); -if (!atomic && fb && fb != crtc->primary->fb) { +if (!atomic && fb && fb != crtc->primary->legacy.fb) { abo =gem_to_amdgpu_bo (fb->obj[0 ]); r =amdgpu_bo_reserve (abo, true);if (unlikely (r !=0 ))
@@ -2641,11 +2641,11 @@ static void dce_v11_0_crtc_disable(struct drm_crtc *crtc)int i;dce_v11_0_crtc_dpms (crtc,DRM_MODE_DPMS_OFF ); -if (crtc->primary->fb) { +if (crtc->primary->legacy.fb) {int r;struct amdgpu_bo *abo; - abo =gem_to_amdgpu_bo (crtc->primary->fb->obj[0 ]); + abo =gem_to_amdgpu_bo (crtc->primary->legacy.fb->obj[0 ]); r =amdgpu_bo_reserve (abo, true);if (unlikely (r))DRM_ERROR ("failed to reserve abo before unpin\n" );
drivers/gpu/drm/amd/amdgpu/dce_v6_0.c +6 -6
@@ -195,7 +195,7 @@ static void dce_v6_0_page_flip(struct amdgpu_device *adev, int crtc_id, u64 crtc_base, bool async) { struct amdgpu_crtc *amdgpu_crtc = adev->mode_info.crtcs[crtc_id]; -struct drm_framebuffer *fb = amdgpu_crtc->base.primary->fb; +struct drm_framebuffer *fb = amdgpu_crtc->base.primary->legacy.fb;/* flip at hsync for async, default is vsync */ WREG32(mmGRPH_FLIP_CONTROL + amdgpu_crtc->crtc_offset, async ?
@@ -1841,7 +1841,7 @@ static int dce_v6_0_crtc_do_set_base(struct drm_crtc *crtc,bool bypass_lut = false;/* no fb bound */ -if (!atomic && !crtc->primary->fb) { +if (!atomic && !crtc->primary->legacy.fb) {DRM_DEBUG_KMS ("No FB bound\n" );return 0 ; }
@@ -1849,7 +1849,7 @@ static int dce_v6_0_crtc_do_set_base(struct drm_crtc *crtc,if (atomic) target_fb = fb;else - target_fb = crtc->primary->fb; + target_fb = crtc->primary->legacy.fb;/* If atomic, assume fb object is pinned & idle & fenced and * just update base pointers
@@ -2032,7 +2032,7 @@ static int dce_v6_0_crtc_do_set_base(struct drm_crtc *crtc,/* set pageflip to happen anywhere in vblank interval */ WREG32 (mmMASTER_UPDATE_MODE + amdgpu_crtc->crtc_offset,0 ); -if (!atomic && fb && fb != crtc->primary->fb) { +if (!atomic && fb && fb != crtc->primary->legacy.fb) { abo =gem_to_amdgpu_bo (fb->obj[0 ]); r =amdgpu_bo_reserve (abo, true);if (unlikely (r !=0 ))
@@ -2472,11 +2472,11 @@ static void dce_v6_0_crtc_disable(struct drm_crtc *crtc)int i;dce_v6_0_crtc_dpms (crtc,DRM_MODE_DPMS_OFF ); -if (crtc->primary->fb) { +if (crtc->primary->legacy.fb) {int r;struct amdgpu_bo *abo; - abo =gem_to_amdgpu_bo (crtc->primary->fb->obj[0 ]); + abo =gem_to_amdgpu_bo (crtc->primary->legacy.fb->obj[0 ]); r =amdgpu_bo_reserve (abo, true);if (unlikely (r))DRM_ERROR ("failed to reserve abo before unpin\n" );
drivers/gpu/drm/amd/amdgpu/dce_v8_0.c +6 -6
@@ -186,7 +186,7 @@ static void dce_v8_0_page_flip(struct amdgpu_device *adev, int crtc_id, u64 crtc_base, bool async) { struct amdgpu_crtc *amdgpu_crtc = adev->mode_info.crtcs[crtc_id]; -struct drm_framebuffer *fb = amdgpu_crtc->base.primary->fb; +struct drm_framebuffer *fb = amdgpu_crtc->base.primary->legacy.fb;/* flip at hsync for async, default is vsync */ WREG32(mmGRPH_FLIP_CONTROL + amdgpu_crtc->crtc_offset, async ?
@@ -1808,7 +1808,7 @@ static int dce_v8_0_crtc_do_set_base(struct drm_crtc *crtc,bool bypass_lut = false;/* no fb bound */ -if (!atomic && !crtc->primary->fb) { +if (!atomic && !crtc->primary->legacy.fb) {DRM_DEBUG_KMS ("No FB bound\n" );return 0 ; }
@@ -1816,7 +1816,7 @@ static int dce_v8_0_crtc_do_set_base(struct drm_crtc *crtc,if (atomic) target_fb = fb;else - target_fb = crtc->primary->fb; + target_fb = crtc->primary->legacy.fb;/* If atomic, assume fb object is pinned & idle & fenced and * just update base pointers
@@ -2001,7 +2001,7 @@ static int dce_v8_0_crtc_do_set_base(struct drm_crtc *crtc,/* set pageflip to happen anywhere in vblank interval */ WREG32 (mmMASTER_UPDATE_MODE + amdgpu_crtc->crtc_offset,0 ); -if (!atomic && fb && fb != crtc->primary->fb) { +if (!atomic && fb && fb != crtc->primary->legacy.fb) { abo =gem_to_amdgpu_bo (fb->obj[0 ]); r =amdgpu_bo_reserve (abo, true);if (unlikely (r !=0 ))
@@ -2476,11 +2476,11 @@ static void dce_v8_0_crtc_disable(struct drm_crtc *crtc)int i;dce_v8_0_crtc_dpms (crtc,DRM_MODE_DPMS_OFF ); -if (crtc->primary->fb) { +if (crtc->primary->legacy.fb) {int r;struct amdgpu_bo *abo; - abo =gem_to_amdgpu_bo (crtc->primary->fb->obj[0 ]); + abo =gem_to_amdgpu_bo (crtc->primary->legacy.fb->obj[0 ]); r =amdgpu_bo_reserve (abo, true);if (unlikely (r))DRM_ERROR ("failed to reserve abo before unpin\n" );
drivers/gpu/drm/drm_atomic.c +3 -3
@@ -530,9 +530,9 @@ drm_atomic_get_plane_state(struct drm_atomic_state *state,WARN_ON (!state->acquire_ctx);/* the legacy pointers should never be set */ -WARN_ON (plane->fb); -WARN_ON (plane->old_fb); -WARN_ON (plane->crtc); +WARN_ON (plane->legacy.fb); +WARN_ON (plane->legacy.old_fb); +WARN_ON (plane->legacy.crtc); plane_state =drm_atomic_get_existing_plane_state (state, plane);if (plane_state)
drivers/gpu/drm/drm_crtc.c +11 -11
@@ -544,8 +544,8 @@ int drm_mode_getcrtc(struct drm_device *dev,drm_modeset_lock (&plane->mutex,NULL );if (plane->state && plane->state->fb) crtc_resp->fb_id = plane->state->fb->base.id; -else if (!plane->state && plane->fb) - crtc_resp->fb_id = plane->fb->base.id; +else if (!plane->state && plane->legacy.fb) + crtc_resp->fb_id = plane->legacy.fb->base.id;else crtc_resp->fb_id =0 ;
@@ -600,7 +600,7 @@ static int __drm_mode_set_config_internal(struct drm_mode_set *set,drm_for_each_crtc (tmp, crtc->dev) {struct drm_plane *plane = tmp->primary; - plane->old_fb = plane->fb; + plane->legacy.old_fb = plane->legacy.fb; } fb = set->fb;
@@ -609,18 +609,18 @@ static int __drm_mode_set_config_internal(struct drm_mode_set *set,if (ret ==0 ) {struct drm_plane *plane = crtc->primary; - plane->crtc = fb ? crtc :NULL ; - plane->fb = fb; + plane->legacy.crtc = fb ? crtc :NULL ; + plane->legacy.fb = fb; }drm_for_each_crtc (tmp, crtc->dev) {struct drm_plane *plane = tmp->primary; -if (plane->fb) -drm_framebuffer_get (plane->fb); -if (plane->old_fb) -drm_framebuffer_put (plane->old_fb); - plane->old_fb =NULL ; +if (plane->legacy.fb) +drm_framebuffer_get (plane->legacy.fb); +if (plane->legacy.old_fb) +drm_framebuffer_put (plane->legacy.old_fb); + plane->legacy.old_fb =NULL ; }return ret;
@@ -739,7 +739,7 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data,if (plane->state) old_fb = plane->state->fb;else - old_fb = plane->fb; + old_fb = plane->legacy.fb;if (!old_fb) {drm_dbg_kms (dev,"CRTC doesn't have current FB\n" );
drivers/gpu/drm/drm_crtc_helper.c +10 -10
@@ -204,7 +204,7 @@ static void __drm_helper_disable_unused_functions(struct drm_device *dev) (*crtc_funcs->disable)(crtc); else (*crtc_funcs->dpms)(crtc,DRM_MODE_DPMS_OFF ); - crtc->primary->fb =NULL ; + crtc->primary->legacy.fb =NULL ; } } }
@@ -635,17 +635,17 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set, save_set.mode = &set->crtc->mode; save_set.x = set->crtc->x; save_set.y = set->crtc->y; - save_set.fb = set->crtc->primary->fb; + save_set.fb = set->crtc->primary->legacy.fb;/* We should be able to check here if the fb has the same properties * and then just flip_or_move it */ -if (set->crtc->primary->fb != set->fb) { +if (set->crtc->primary->legacy.fb != set->fb) {/* If we have no fb then treat it as a full mode set */ -if (set->crtc->primary->fb ==NULL ) { +if (set->crtc->primary->legacy.fb ==NULL ) {drm_dbg_kms (dev,"[CRTC:%d:%s] no fb, full mode set\n" , set->crtc->base.id, set->crtc->name); mode_changed = true; - }else if (set->fb->format != set->crtc->primary->fb->format) { + }else if (set->fb->format != set->crtc->primary->legacy.fb->format) { mode_changed = true; }else fb_changed = true;
@@ -768,13 +768,13 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set,if (drm_helper_crtc_in_use (set->crtc)) {drm_dbg_kms (dev,"[CRTC:%d:%s] attempting to set mode from userspace: " DRM_MODE_FMT "\n" , set->crtc->base.id, set->crtc->name,DRM_MODE_ARG (set->mode)); - set->crtc->primary->fb = set->fb; + set->crtc->primary->legacy.fb = set->fb;if (!drm_crtc_helper_set_mode (set->crtc, set->mode, set->x, set->y, save_set.fb)) {drm_err (dev,"[CRTC:%d:%s] failed to set mode\n" , set->crtc->base.id, set->crtc->name); - set->crtc->primary->fb = save_set.fb; + set->crtc->primary->legacy.fb = save_set.fb; ret = -EINVAL ; goto fail; }
@@ -790,13 +790,13 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set, }else if (fb_changed) { set->crtc->x = set->x; set->crtc->y = set->y; - set->crtc->primary->fb = set->fb; + set->crtc->primary->legacy.fb = set->fb; ret = crtc_funcs->mode_set_base (set->crtc, set->x, set->y, save_set.fb);if (ret !=0 ) { set->crtc->x = save_set.x; set->crtc->y = save_set.y; - set->crtc->primary->fb = save_set.fb; + set->crtc->primary->legacy.fb = save_set.fb; goto fail; } }
@@ -997,7 +997,7 @@ void drm_helper_resume_force_mode(struct drm_device *dev)continue ; ret =drm_crtc_helper_set_mode (crtc, &crtc->mode, - crtc->x, crtc->y, crtc->primary->fb); + crtc->x, crtc->y, crtc->primary->legacy.fb);/* Restoring the old config should never fail! */ if (ret == false)
drivers/gpu/drm/drm_fb_helper.c +1 -1
@@ -189,7 +189,7 @@ int drm_fb_helper_debug_leave(struct fb_info *info)continue ; funcs = crtc->helper_private; - fb = crtc->primary->fb; + fb = crtc->primary->legacy.fb;if (!crtc->enabled)continue ;
drivers/gpu/drm/drm_framebuffer.c +2 -2
@@ -1081,7 +1081,7 @@ static void legacy_remove_fb(struct drm_framebuffer *fb)drm_modeset_lock_all (dev);/* remove from any CRTC */ drm_for_each_crtc (crtc, dev) { -if (crtc->primary->fb == fb) { +if (crtc->primary->legacy.fb == fb) {drm_dbg_kms (dev,"Disabling [CRTC:%d:%s] because [FB:%d] is removed\n" , crtc->base.id, crtc->name, fb->base.id);
@@ -1093,7 +1093,7 @@ static void legacy_remove_fb(struct drm_framebuffer *fb) }drm_for_each_plane (plane, dev) { -if (plane->fb == fb) { +if (plane->legacy.fb == fb) {drm_dbg_kms (dev,"Disabling [PLANE:%d:%s] because [FB:%d] is removed\n" , plane->base.id, plane->name, fb->base.id);
drivers/gpu/drm/drm_plane.c +32 -32
152 lines not on this page · raw message
drivers/gpu/drm/gma500/cdv_intel_display.c +1 -1
@@ -462,7 +462,7 @@ static bool cdv_intel_pipe_enabled(struct drm_device *dev, int pipe) crtc = dev_priv->pipe_to_crtc_mapping[pipe]; gma_crtc =to_gma_crtc (crtc); -if (crtc->primary->fb ==NULL || !gma_crtc->active) +if (crtc->primary->legacy.fb ==NULL || !gma_crtc->active)return false;return true; }
drivers/gpu/drm/gma500/cdv_intel_dp.c +1 -1
@@ -1849,7 +1849,7 @@ cdv_intel_dp_set_property(struct drm_connector *connector,struct drm_crtc *crtc = encoder->base.crtc;drm_crtc_helper_set_mode (crtc, &crtc->mode, crtc->x, crtc->y, - crtc->primary->fb); + crtc->primary->legacy.fb); }return 0 ;
drivers/gpu/drm/gma500/cdv_intel_hdmi.c +2 -1
@@ -191,7 +191,8 @@ static int cdv_hdmi_set_property(struct drm_connector *connector, crtc->saved_mode.vdisplay != 0) {if (centre) {if (!drm_crtc_helper_set_mode (encoder->crtc, &crtc->saved_mode, - encoder->crtc->x, encoder->crtc->y, encoder->crtc->primary->fb)) + encoder->crtc->x, encoder->crtc->y, + encoder->crtc->primary->legacy.fb))return -1 ; }else {const struct drm_encoder_helper_funcs *helpers
drivers/gpu/drm/gma500/cdv_intel_lvds.c +1 -1
@@ -375,7 +375,7 @@ static int cdv_intel_lvds_set_property(struct drm_connector *connector, &crtc->saved_mode, encoder->crtc->x, encoder->crtc->y, - encoder->crtc->primary->fb)) + encoder->crtc->primary->legacy.fb)) return -1; } }else if (!strcmp (property->name,"backlight" ) && encoder) {
drivers/gpu/drm/gma500/gma_display.c +7 -7
@@ -61,7 +61,7 @@ int gma_pipe_set_base(struct drm_crtc *crtc, int x, int y,struct drm_device *dev = crtc->dev;struct drm_psb_private *dev_priv =to_drm_psb_private (dev);struct gma_crtc *gma_crtc =to_gma_crtc (crtc); -struct drm_framebuffer *fb = crtc->primary->fb; +struct drm_framebuffer *fb = crtc->primary->legacy.fb;struct psb_gem_object *pobj;int pipe = gma_crtc->pipe;const struct psb_offset *map = &dev_priv->regmap[pipe];
@@ -490,8 +490,8 @@ void gma_crtc_disable(struct drm_crtc *crtc) crtc_funcs->dpms (crtc,DRM_MODE_DPMS_OFF ); -if (crtc->primary->fb) { - pobj =to_psb_gem_object (crtc->primary->fb->obj[0 ]); +if (crtc->primary->legacy.fb) { + pobj =to_psb_gem_object (crtc->primary->legacy.fb->obj[0 ]);psb_gem_unpin (pobj); } }
@@ -515,8 +515,8 @@ int gma_crtc_page_flip(struct drm_crtc *crtc, struct drm_modeset_acquire_ctx *ctx) {struct gma_crtc *gma_crtc =to_gma_crtc (crtc); -struct drm_framebuffer *current_fb = crtc->primary->fb; -struct drm_framebuffer *old_fb = crtc->primary->old_fb; +struct drm_framebuffer *current_fb = crtc->primary->legacy.fb; +struct drm_framebuffer *old_fb = crtc->primary->legacy.old_fb;const struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private;struct drm_device *dev = crtc->dev;unsigned long flags;
@@ -526,7 +526,7 @@ int gma_crtc_page_flip(struct drm_crtc *crtc,return -EINVAL ;/* Using mode_set_base requires the new fb to be set already. */ - crtc->primary->fb = fb; + crtc->primary->legacy.fb = fb;if (event) {spin_lock_irqsave (&dev->event_lock, flags);
@@ -552,7 +552,7 @@ int gma_crtc_page_flip(struct drm_crtc *crtc,/* Restore previous fb in case of failure. */ if (ret) - crtc->primary->fb = current_fb; + crtc->primary->legacy.fb = current_fb;return ret; }
drivers/gpu/drm/gma500/oaktrail_crtc.c +1 -1
@@ -595,7 +595,7 @@ static int oaktrail_pipe_set_base(struct drm_crtc *crtc,struct drm_device *dev = crtc->dev;struct drm_psb_private *dev_priv =to_drm_psb_private (dev);struct gma_crtc *gma_crtc =to_gma_crtc (crtc); -struct drm_framebuffer *fb = crtc->primary->fb; +struct drm_framebuffer *fb = crtc->primary->legacy.fb;int pipe = gma_crtc->pipe;const struct psb_offset *map = &dev_priv->regmap[pipe];unsigned long start, offset;
drivers/gpu/drm/gma500/psb_intel_display.c +1 -1
@@ -112,7 +112,7 @@ static int psb_intel_crtc_mode_set(struct drm_crtc *crtc,const struct gma_limit_t *limit;/* No scan out no play */ -if (crtc->primary->fb ==NULL ) { +if (crtc->primary->legacy.fb ==NULL ) { crtc_funcs->mode_set_base (crtc, x, y, old_fb);return 0 ; }
drivers/gpu/drm/gma500/psb_intel_lvds.c +1 -1
@@ -570,7 +570,7 @@ int psb_intel_lvds_set_property(struct drm_connector *connector, &crtc->saved_mode, encoder->crtc->x, encoder->crtc->y, - encoder->crtc->primary->fb)) + encoder->crtc->primary->legacy.fb)) goto set_prop_error; } }else if (!strcmp (property->name,"backlight" )) {
drivers/gpu/drm/gma500/psb_intel_sdvo.c +1 -1
@@ -1727,7 +1727,7 @@ psb_intel_sdvo_set_property(struct drm_connector *connector,if (psb_intel_sdvo->base.base.crtc) {struct drm_crtc *crtc = psb_intel_sdvo->base.base.crtc;drm_crtc_helper_set_mode (crtc, &crtc->mode, crtc->x, - crtc->y, crtc->primary->fb); + crtc->y, crtc->primary->legacy.fb); }return 0 ;
drivers/gpu/drm/i2c/ch7006_drv.c +1 -1
@@ -364,7 +364,7 @@ static int ch7006_encoder_set_property(struct drm_encoder *encoder,if (crtc)drm_crtc_helper_set_mode (crtc, &crtc->mode, crtc->x, crtc->y, - crtc->primary->fb); + crtc->primary->legacy.fb); }return 0 ;
drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +3 -3
@@ -122,11 +122,11 @@ static void _dpu_plane_set_danger_state(struct dpu_kms *kms, bool enable)struct drm_plane *plane;drm_for_each_plane (plane, kms->dev) { -if (plane->fb && plane->state) { +if (plane->legacy.fb && plane->state) {dpu_plane_danger_signal_ctrl (plane, enable);DPU_DEBUG ("plane:%d img:%dx%d " , - plane->base.id, plane->fb->width, - plane->fb->height); + plane->base.id, plane->legacy.fb->width, + plane->legacy.fb->height); DPU_DEBUG("src[%d,%d,%d,%d] dst[%d,%d,%d,%d]\n", plane->state->src_x >> 16, plane->state->src_y >> 16,
drivers/gpu/drm/nouveau/dispnv04/crtc.c +8 -8
@@ -239,7 +239,7 @@ nv_crtc_mode_set_vga(struct drm_crtc *crtc, struct drm_display_mode *mode)struct drm_device *dev = crtc->dev;struct nouveau_crtc *nv_crtc =nouveau_crtc (crtc);struct nv04_crtc_reg *regp = &nv04_display (dev)->mode_reg.crtc_reg[nv_crtc->index]; -struct drm_framebuffer *fb = crtc->primary->fb; +struct drm_framebuffer *fb = crtc->primary->legacy.fb;/* Calculate our timings */ int horizDisplay = (mode->crtc_hdisplay >>3 ) -1 ;
@@ -465,7 +465,7 @@ nv_crtc_mode_set_regs(struct drm_crtc *crtc, struct drm_display_mode * mode)struct nouveau_crtc *nv_crtc =nouveau_crtc (crtc);struct nv04_crtc_reg *regp = &nv04_display (dev)->mode_reg.crtc_reg[nv_crtc->index];struct nv04_crtc_reg *savep = &nv04_display (dev)->saved_reg.crtc_reg[nv_crtc->index]; -const struct drm_framebuffer *fb = crtc->primary->fb; +const struct drm_framebuffer *fb = crtc->primary->legacy.fb;struct drm_encoder *encoder;bool lvds_output = false, tmds_output = false, tv_output = false, off_chip_digital = false;
@@ -610,7 +610,7 @@ static int nv_crtc_swap_fbs(struct drm_crtc *crtc, struct drm_framebuffer *old_fb) { struct nv04_display *disp = nv04_display(crtc->dev); -struct drm_framebuffer *fb = crtc->primary->fb; +struct drm_framebuffer *fb = crtc->primary->legacy.fb;struct nouveau_bo *nvbo =nouveau_gem_object (fb->obj[0 ]);struct nouveau_crtc *nv_crtc =nouveau_crtc (crtc);int ret;
@@ -826,7 +826,7 @@ nv_crtc_gamma_set(struct drm_crtc *crtc, u16 *r, u16 *g, u16 *b,* mark the lut values as dirty by setting depth==0, and it'll be * uploaded on the first mode_set_base() */ -if (!nv_crtc->base.primary->fb) { +if (!nv_crtc->base.primary->legacy.fb) { nv_crtc->lut.depth =0 ;return 0 ; }
@@ -852,7 +852,7 @@ nv04_crtc_do_mode_set_base(struct drm_crtc *crtc,NV_DEBUG (drm,"index %d\n" , nv_crtc->index);/* no fb bound */ -if (!atomic && !crtc->primary->fb) { +if (!atomic && !crtc->primary->legacy.fb) {NV_DEBUG (drm,"No FB bound\n" );return 0 ; }
@@ -863,7 +863,7 @@ nv04_crtc_do_mode_set_base(struct drm_crtc *crtc,if (atomic) { drm_fb = passed_fb; }else { - drm_fb = crtc->primary->fb; + drm_fb = crtc->primary->legacy.fb; } nvbo =nouveau_gem_object (drm_fb->obj[0 ]);
@@ -1157,7 +1157,7 @@ nv04_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb,const int swap_interval = (flags &DRM_MODE_PAGE_FLIP_ASYNC ) ?0 :1 ;struct drm_device *dev = crtc->dev;struct nouveau_drm *drm =nouveau_drm (dev); -struct drm_framebuffer *old_fb = crtc->primary->fb; +struct drm_framebuffer *old_fb = crtc->primary->legacy.fb;struct nouveau_bo *old_bo =nouveau_gem_object (old_fb->obj[0 ]);struct nouveau_bo *new_bo =nouveau_gem_object (fb->obj[0 ]);struct nv04_page_flip_state *s;
@@ -1237,7 +1237,7 @@ nv04_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb,mutex_unlock (&cli->mutex);/* Update the crtc struct and cleanup */ - crtc->primary->fb = fb; + crtc->primary->legacy.fb = fb;nouveau_bo_fence (old_bo, fence, false);ttm_bo_unreserve (&old_bo->bo);
drivers/gpu/drm/nouveau/dispnv04/dfp.c +1 -1
@@ -291,7 +291,7 @@ static void nv04_dfp_mode_set(struct drm_encoder *encoder,struct nouveau_encoder *nv_encoder =nouveau_encoder (encoder);struct drm_display_mode *output_mode = &nv_encoder->mode;struct drm_connector *connector = &nv_connector->base; -const struct drm_framebuffer *fb = encoder->crtc->primary->fb; +const struct drm_framebuffer *fb = encoder->crtc->primary->legacy.fb;uint32_t mode_ratio, panel_ratio;NV_DEBUG (drm,"Output mode on CRTC %d:\n" , nv_crtc->index);
drivers/gpu/drm/nouveau/dispnv04/disp.c +2 -2
@@ -76,7 +76,7 @@ nv04_display_fini(struct drm_device *dev, bool runtime, bool suspend)/* Un-pin FB and cursors so they'll be evicted to system memory. */ list_for_each_entry (crtc, &dev->mode_config.crtc_list, head) { -struct drm_framebuffer *fb = crtc->primary->fb; +struct drm_framebuffer *fb = crtc->primary->legacy.fb;struct nouveau_bo *nvbo;if (!fb || !fb->obj[0 ])
@@ -128,7 +128,7 @@ nv04_display_init(struct drm_device *dev, bool resume, bool runtime)/* Re-pin FB/cursors. */ list_for_each_entry (crtc, &dev->mode_config.crtc_list, head) { -struct drm_framebuffer *fb = crtc->primary->fb; +struct drm_framebuffer *fb = crtc->primary->legacy.fb;struct nouveau_bo *nvbo;if (!fb || !fb->obj[0 ])
drivers/gpu/drm/nouveau/dispnv04/tvnv17.c +1 -1
@@ -756,7 +756,7 @@ static int nv17_tv_set_property(struct drm_encoder *encoder,if (crtc)drm_crtc_helper_set_mode (crtc, &crtc->mode, crtc->x, crtc->y, - crtc->primary->fb); + crtc->primary->legacy.fb); }return 0 ;
drivers/gpu/drm/radeon/atombios_crtc.c +8 -8
@@ -1150,7 +1150,7 @@ static int dce4_crtc_do_set_base(struct drm_crtc *crtc,bool bypass_lut = false;/* no fb bound */ -if (!atomic && !crtc->primary->fb) { +if (!atomic && !crtc->primary->legacy.fb) {DRM_DEBUG_KMS ("No FB bound\n" );return 0 ; }
@@ -1158,7 +1158,7 @@ static int dce4_crtc_do_set_base(struct drm_crtc *crtc,if (atomic) target_fb = fb;else - target_fb = crtc->primary->fb; + target_fb = crtc->primary->legacy.fb;/* If atomic, assume fb object is pinned & idle & fenced and * just update base pointers
@@ -1437,7 +1437,7 @@ static int dce4_crtc_do_set_base(struct drm_crtc *crtc,/* set pageflip to happen anywhere in vblank interval */ WREG32 (EVERGREEN_MASTER_UPDATE_MODE + radeon_crtc->crtc_offset,0 ); -if (!atomic && fb && fb != crtc->primary->fb) { +if (!atomic && fb && fb != crtc->primary->legacy.fb) { rbo =gem_to_radeon_bo (fb->obj[0 ]); r =radeon_bo_reserve (rbo, false);if (unlikely (r !=0 ))
@@ -1470,7 +1470,7 @@ static int avivo_crtc_do_set_base(struct drm_crtc *crtc,bool bypass_lut = false;/* no fb bound */ -if (!atomic && !crtc->primary->fb) { +if (!atomic && !crtc->primary->legacy.fb) {DRM_DEBUG_KMS ("No FB bound\n" );return 0 ; }
@@ -1478,7 +1478,7 @@ static int avivo_crtc_do_set_base(struct drm_crtc *crtc,if (atomic) target_fb = fb;else - target_fb = crtc->primary->fb; + target_fb = crtc->primary->legacy.fb; obj = target_fb->obj[0 ]; rbo =gem_to_radeon_bo (obj);
@@ -1645,7 +1645,7 @@ static int avivo_crtc_do_set_base(struct drm_crtc *crtc,/* set pageflip to happen only at start of vblank interval (front porch) */ WREG32 (AVIVO_D1MODE_MASTER_UPDATE_MODE + radeon_crtc->crtc_offset,3 ); -if (!atomic && fb && fb != crtc->primary->fb) { +if (!atomic && fb && fb != crtc->primary->legacy.fb) { rbo =gem_to_radeon_bo (fb->obj[0 ]); r =radeon_bo_reserve (rbo, false);if (unlikely (r !=0 ))
@@ -2150,11 +2150,11 @@ static void atombios_crtc_disable(struct drm_crtc *crtc)int i;atombios_crtc_dpms (crtc,DRM_MODE_DPMS_OFF ); -if (crtc->primary->fb) { +if (crtc->primary->legacy.fb) {int r;struct radeon_bo *rbo; - rbo =gem_to_radeon_bo (crtc->primary->fb->obj[0 ]); + rbo =gem_to_radeon_bo (crtc->primary->legacy.fb->obj[0 ]); r =radeon_bo_reserve (rbo, false);if (unlikely (r))DRM_ERROR ("failed to reserve rbo before unpin\n" );
drivers/gpu/drm/radeon/evergreen.c +1 -1
@@ -1417,7 +1417,7 @@ void evergreen_page_flip(struct radeon_device *rdev, int crtc_id, u64 crtc_base, bool async) {struct radeon_crtc *radeon_crtc = rdev->mode_info.crtcs[crtc_id]; -struct drm_framebuffer *fb = radeon_crtc->base.primary->fb; +struct drm_framebuffer *fb = radeon_crtc->base.primary->legacy.fb;/* flip at hsync for async, default is vsync */ WREG32(EVERGREEN_GRPH_FLIP_CONTROL + radeon_crtc->crtc_offset,
drivers/gpu/drm/radeon/r100.c +3 -3
@@ -165,7 +165,7 @@ void r100_page_flip(struct radeon_device *rdev, int crtc_id, u64 crtc_base, bool {struct radeon_crtc *radeon_crtc = rdev->mode_info.crtcs[crtc_id];uint32_t crtc_pitch, pitch_pixels; -struct drm_framebuffer *fb = radeon_crtc->base.primary->fb; +struct drm_framebuffer *fb = radeon_crtc->base.primary->legacy.fb;u32 tmp = ((u32 )crtc_base) |RADEON_CRTC_OFFSET__OFFSET_LOCK ;int i;
@@ -3244,7 +3244,7 @@ void r100_bandwidth_update(struct radeon_device *rdev)if (rdev->mode_info.crtcs[0 ]->base.enabled) {const struct drm_framebuffer *fb = - rdev->mode_info.crtcs[0 ]->base.primary->fb; + rdev->mode_info.crtcs[0 ]->base.primary->legacy.fb; mode1 = &rdev->mode_info.crtcs[0 ]->base.mode; pixel_bytes1 = fb->format->cpp[0 ];
@@ -3252,7 +3252,7 @@ void r100_bandwidth_update(struct radeon_device *rdev)if (!(rdev->flags &RADEON_SINGLE_CRTC )) {if (rdev->mode_info.crtcs[1 ]->base.enabled) {const struct drm_framebuffer *fb = - rdev->mode_info.crtcs[1 ]->base.primary->fb; + rdev->mode_info.crtcs[1 ]->base.primary->legacy.fb; mode2 = &rdev->mode_info.crtcs[1 ]->base.mode; pixel_bytes2 = fb->format->cpp[0 ];
drivers/gpu/drm/radeon/radeon_connectors.c +2 -1
@@ -92,7 +92,8 @@ static void radeon_property_change_mode(struct drm_encoder *encoder)if (crtc && crtc->enabled) {drm_crtc_helper_set_mode (crtc, &crtc->mode, - crtc->x, crtc->y, crtc->primary->fb); + crtc->x, crtc->y, + crtc->primary->legacy.fb); } }
drivers/gpu/drm/radeon/radeon_device.c +1 -1
@@ -1572,7 +1572,7 @@ int radeon_suspend_kms(struct drm_device *dev, bool suspend,/* unpin the front buffers and cursors */ list_for_each_entry (crtc, &dev->mode_config.crtc_list, head) {struct radeon_crtc *radeon_crtc =to_radeon_crtc (crtc); -struct drm_framebuffer *fb = crtc->primary->fb; +struct drm_framebuffer *fb = crtc->primary->legacy.fb;struct radeon_bo *robj;if (radeon_crtc->cursor_bo) {
drivers/gpu/drm/radeon/radeon_display.c +2 -2
@@ -506,7 +506,7 @@ static int radeon_crtc_page_flip_target(struct drm_crtc *crtc, work->async = (page_flip_flags &DRM_MODE_PAGE_FLIP_ASYNC ) !=0 ;/* schedule unpin of the old buffer */ - obj = crtc->primary->fb->obj[0 ]; + obj = crtc->primary->legacy.fb->obj[0 ];/* take a reference to the old object */ drm_gem_object_get (obj);
@@ -595,7 +595,7 @@ static int radeon_crtc_page_flip_target(struct drm_crtc *crtc, radeon_crtc->flip_work = work;/* update crtc fb */ - crtc->primary->fb = fb; + crtc->primary->legacy.fb = fb;spin_unlock_irqrestore (&crtc->dev->event_lock, flags);
drivers/gpu/drm/radeon/radeon_legacy_crtc.c +7 -7
@@ -390,7 +390,7 @@ int radeon_crtc_do_set_base(struct drm_crtc *crtc,DRM_DEBUG_KMS ("\n" );/* no fb bound */ -if (!atomic && !crtc->primary->fb) { +if (!atomic && !crtc->primary->legacy.fb) {DRM_DEBUG_KMS ("No FB bound\n" );return 0 ; }
@@ -398,7 +398,7 @@ int radeon_crtc_do_set_base(struct drm_crtc *crtc,if (atomic) target_fb = fb;else - target_fb = crtc->primary->fb; + target_fb = crtc->primary->legacy.fb;switch (target_fb->format->cpp[0 ] *8 ) {case 8 :
@@ -445,7 +445,7 @@ int radeon_crtc_do_set_base(struct drm_crtc *crtc,* We don't shutdown the display controller because new buffer * will end up in same spot. */ -if (!atomic && fb && fb != crtc->primary->fb) { +if (!atomic && fb && fb != crtc->primary->legacy.fb) {struct radeon_bo *old_rbo;unsigned long nsize, osize;
@@ -555,7 +555,7 @@ int radeon_crtc_do_set_base(struct drm_crtc *crtc,WREG32 (RADEON_CRTC_OFFSET + radeon_crtc->crtc_offset, crtc_offset);WREG32 (RADEON_CRTC_PITCH + radeon_crtc->crtc_offset, crtc_pitch); -if (!atomic && fb && fb != crtc->primary->fb) { +if (!atomic && fb && fb != crtc->primary->legacy.fb) { rbo =gem_to_radeon_bo (fb->obj[0 ]); r =radeon_bo_reserve (rbo, false);if (unlikely (r !=0 ))
@@ -575,7 +575,7 @@ static bool radeon_set_crtc_timing(struct drm_crtc *crtc, struct drm_display_modstruct drm_device *dev = crtc->dev;struct radeon_device *rdev = dev->dev_private;struct radeon_crtc *radeon_crtc =to_radeon_crtc (crtc); -const struct drm_framebuffer *fb = crtc->primary->fb; +const struct drm_framebuffer *fb = crtc->primary->legacy.fb;struct drm_encoder *encoder;int format;int hsync_start;
@@ -1088,11 +1088,11 @@ static void radeon_crtc_commit(struct drm_crtc *crtc)static void radeon_crtc_disable (struct drm_crtc *crtc) {radeon_crtc_dpms (crtc,DRM_MODE_DPMS_OFF ); -if (crtc->primary->fb) { +if (crtc->primary->legacy.fb) {int r;struct radeon_bo *rbo; - rbo =gem_to_radeon_bo (crtc->primary->fb->obj[0 ]); + rbo =gem_to_radeon_bo (crtc->primary->legacy.fb->obj[0 ]); r =radeon_bo_reserve (rbo, false);if (unlikely (r))DRM_ERROR ("failed to reserve rbo before unpin\n" );
drivers/gpu/drm/radeon/rs600.c +1 -1
@@ -119,7 +119,7 @@ void avivo_wait_for_vblank(struct radeon_device *rdev, int crtc)void rs600_page_flip (struct radeon_device *rdev,int crtc_id,u64 crtc_base,bool async) {struct radeon_crtc *radeon_crtc = rdev->mode_info.crtcs[crtc_id]; -struct drm_framebuffer *fb = radeon_crtc->base.primary->fb; +struct drm_framebuffer *fb = radeon_crtc->base.primary->legacy.fb;u32 tmp =RREG32 (AVIVO_D1GRPH_UPDATE + radeon_crtc->crtc_offset);int i;
drivers/gpu/drm/radeon/rv770.c +1 -1
@@ -800,7 +800,7 @@ u32 rv770_get_xclk(struct radeon_device *rdev)void rv770_page_flip (struct radeon_device *rdev,int crtc_id,u64 crtc_base,bool async) {struct radeon_crtc *radeon_crtc = rdev->mode_info.crtcs[crtc_id]; -struct drm_framebuffer *fb = radeon_crtc->base.primary->fb; +struct drm_framebuffer *fb = radeon_crtc->base.primary->legacy.fb;u32 tmp =RREG32 (AVIVO_D1GRPH_UPDATE + radeon_crtc->crtc_offset);int i;
drivers/gpu/drm/rockchip/rockchip_drm_vop.c +1 -1
@@ -1097,7 +1097,7 @@ static int vop_plane_atomic_async_check(struct drm_plane *plane, crtc_state =drm_atomic_get_existing_crtc_state (state, new_plane_state->crtc); else /* Special case for asynchronous cursor updates. */ - crtc_state = plane->crtc->state; + crtc_state = plane->legacy.crtc->state; return drm_atomic_helper_check_plane_state(plane->state, crtc_state, min_scale, max_scale,
include/drm/drm_plane.h +27 -25
58 lines not on this page · raw message
Signature · 1 line
2.45.2
Re: [PATCH 1/2] drm: Move plane->{fb,old_fb,crtc} to legacy sub-structure
Quoted 8 lines · Ville Syrjala
From: Ville Syrjälä <[email protected]>
Hide the plane->fb/etc. footguns better by stashing them inside a "legacy" sub struct.
Eventually maybe we could turn 'legacy' into a pointer that only exists on legacy drivers to completely prevent any abuse by atomic drivers...
Hmm. I should probably make it a pointer from the start, to avoid having to go through the same churn yet again.
Quoted 1,325 lines
Side note:
_dpu_plane_set_danger_state()looks completely broken.Cc Alex Deucher <[email protected]>Cc "Christian König" <[email protected]>Cc Xinhui Pan <[email protected]>Cc Patrik Jakobsson <[email protected]>Cc Rob Clark <[email protected]>Cc Abhinav Kumar <[email protected]>Cc Dmitry Baryshkov <[email protected]>Cc Sean Paul <[email protected]>Cc Marijn Suijten <[email protected]>Cc Karol Herbst <[email protected]>Cc Lyude Paul <[email protected]>Cc Danilo Krummrich <[email protected]>Cc Sandy Huang <[email protected]>Cc "Heiko Stübner" <[email protected]>Cc Andy Yan <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>--- .../gpu/drm/amd/amdgpu/amdgpu_connectors.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 6 +- drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 12 ++-- drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 12 ++-- drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 12 ++-- drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 12 ++-- drivers/gpu/drm/drm_atomic.c | 6 +- drivers/gpu/drm/drm_crtc.c | 22 +++---- drivers/gpu/drm/drm_crtc_helper.c | 20 +++--- drivers/gpu/drm/drm_fb_helper.c | 2 +- drivers/gpu/drm/drm_framebuffer.c | 4 +- drivers/gpu/drm/drm_plane.c | 64 +++++++++---------- drivers/gpu/drm/gma500/cdv_intel_display.c | 2 +- drivers/gpu/drm/gma500/cdv_intel_dp.c | 2 +- drivers/gpu/drm/gma500/cdv_intel_hdmi.c | 3 +- drivers/gpu/drm/gma500/cdv_intel_lvds.c | 2 +- drivers/gpu/drm/gma500/gma_display.c | 14 ++-- drivers/gpu/drm/gma500/oaktrail_crtc.c | 2 +- drivers/gpu/drm/gma500/psb_intel_display.c | 2 +- drivers/gpu/drm/gma500/psb_intel_lvds.c | 2 +- drivers/gpu/drm/gma500/psb_intel_sdvo.c | 2 +- drivers/gpu/drm/i2c/ch7006_drv.c | 2 +- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 6 +- drivers/gpu/drm/nouveau/dispnv04/crtc.c | 16 ++--- drivers/gpu/drm/nouveau/dispnv04/dfp.c | 2 +- drivers/gpu/drm/nouveau/dispnv04/disp.c | 4 +- drivers/gpu/drm/nouveau/dispnv04/tvnv17.c | 2 +- drivers/gpu/drm/radeon/atombios_crtc.c | 16 ++--- drivers/gpu/drm/radeon/evergreen.c | 2 +- drivers/gpu/drm/radeon/r100.c | 6 +- drivers/gpu/drm/radeon/radeon_connectors.c | 3 +- drivers/gpu/drm/radeon/radeon_device.c | 2 +- drivers/gpu/drm/radeon/radeon_display.c | 4 +- drivers/gpu/drm/radeon/radeon_legacy_crtc.c | 14 ++-- drivers/gpu/drm/radeon/rs600.c | 2 +- drivers/gpu/drm/radeon/rv770.c | 2 +- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 2 +- include/drm/drm_plane.h | 52 +++++++-------- 38 files changed, 173 insertions(+), 169 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c +1
-1@@ -94,7 +94,7 @@ static void amdgpu_connector_property_change_mode(struct drm_encoder *encoder)if (crtc && crtc->enabled) {drm_crtc_helper_set_mode (crtc, &crtc->mode, - crtc->x, crtc->y, crtc->primary->fb); + crtc->x, crtc->y, crtc->primary->legacy.fb); } }drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +3
-3@@ -216,7 +216,7 @@ int amdgpu_display_crtc_page_flip_target(struct drm_crtc *crtc, work->async = (page_flip_flags &DRM_MODE_PAGE_FLIP_ASYNC ) !=0 ;/* schedule unpin of the old buffer */ - obj = crtc->primary->fb->obj[0 ]; + obj = crtc->primary->legacy.fb->obj[0 ];/* take a reference to the old object */ work->old_abo =gem_to_amdgpu_bo (obj);@@ -280,7 +280,7 @@ int amdgpu_display_crtc_page_flip_target(struct drm_crtc *crtc,DRM_DEBUG_DRIVER ("crtc:%d[%p], pflip_stat:AMDGPU_FLIP_PENDING, work: %p,\n" , amdgpu_crtc->crtc_id, amdgpu_crtc, work);/* update crtc fb */ - crtc->primary->fb = fb; + crtc->primary->legacy.fb = fb;spin_unlock_irqrestore (&crtc->dev->event_lock, flags);amdgpu_display_flip_work_func (&work->flip_work.work);return 0 ;@@ -1715,7 +1715,7 @@ int amdgpu_display_suspend_helper(struct amdgpu_device *adev)/* unpin the front buffers and cursors */ list_for_each_entry (crtc, &dev->mode_config.crtc_list, head) {struct amdgpu_crtc *amdgpu_crtc =to_amdgpu_crtc (crtc); -struct drm_framebuffer *fb = crtc->primary->fb; +struct drm_framebuffer *fb = crtc->primary->legacy.fb;struct amdgpu_bo *robj;if (amdgpu_crtc->cursor_bo && !adev->enable_virtual_display) {drivers/gpu/drm/amd/amdgpu/dce_v10_0.c +6
-6@@ -235,7 +235,7 @@ static void dce_v10_0_page_flip(struct amdgpu_device *adev, int crtc_id, u64 crtc_base, bool async) { struct amdgpu_crtc *amdgpu_crtc = adev->mode_info.crtcs[crtc_id]; -struct drm_framebuffer *fb = amdgpu_crtc->base.primary->fb; +struct drm_framebuffer *fb = amdgpu_crtc->base.primary->legacy.fb;u32 tmp;/* flip at hsync for async, default is vsync */ @@ -1861,7 +1861,7 @@ static int dce_v10_0_crtc_do_set_base(struct drm_crtc *crtc,bool bypass_lut = false;/* no fb bound */ -if (!atomic && !crtc->primary->fb) { +if (!atomic && !crtc->primary->legacy.fb) {DRM_DEBUG_KMS ("No FB bound\n" );return 0 ; }@@ -1869,7 +1869,7 @@ static int dce_v10_0_crtc_do_set_base(struct drm_crtc *crtc,if (atomic) target_fb = fb;else - target_fb = crtc->primary->fb; + target_fb = crtc->primary->legacy.fb;/* If atomic, assume fb object is pinned & idle & fenced and * just update base pointers @@ -2074,7 +2074,7 @@ static int dce_v10_0_crtc_do_set_base(struct drm_crtc *crtc,/* set pageflip to happen anywhere in vblank interval */ WREG32 (mmMASTER_UPDATE_MODE + amdgpu_crtc->crtc_offset,0 ); -if (!atomic && fb && fb != crtc->primary->fb) { +if (!atomic && fb && fb != crtc->primary->legacy.fb) { abo =gem_to_amdgpu_bo (fb->obj[0 ]); r =amdgpu_bo_reserve (abo, true);if (unlikely (r !=0 ))@@ -2557,11 +2557,11 @@ static void dce_v10_0_crtc_disable(struct drm_crtc *crtc)int i;dce_v10_0_crtc_dpms (crtc,DRM_MODE_DPMS_OFF ); -if (crtc->primary->fb) { +if (crtc->primary->legacy.fb) {int r;struct amdgpu_bo *abo; - abo =gem_to_amdgpu_bo (crtc->primary->fb->obj[0 ]); + abo =gem_to_amdgpu_bo (crtc->primary->legacy.fb->obj[0 ]); r =amdgpu_bo_reserve (abo, true);if (unlikely (r))DRM_ERROR ("failed to reserve abo before unpin\n" );drivers/gpu/drm/amd/amdgpu/dce_v11_0.c +6
-6@@ -259,7 +259,7 @@ static void dce_v11_0_page_flip(struct amdgpu_device *adev, int crtc_id, u64 crtc_base, bool async) { struct amdgpu_crtc *amdgpu_crtc = adev->mode_info.crtcs[crtc_id]; -struct drm_framebuffer *fb = amdgpu_crtc->base.primary->fb; +struct drm_framebuffer *fb = amdgpu_crtc->base.primary->legacy.fb;u32 tmp;/* flip immediate for async, default is vsync */ @@ -1911,7 +1911,7 @@ static int dce_v11_0_crtc_do_set_base(struct drm_crtc *crtc,bool bypass_lut = false;/* no fb bound */ -if (!atomic && !crtc->primary->fb) { +if (!atomic && !crtc->primary->legacy.fb) {DRM_DEBUG_KMS ("No FB bound\n" );return 0 ; }@@ -1919,7 +1919,7 @@ static int dce_v11_0_crtc_do_set_base(struct drm_crtc *crtc,if (atomic) target_fb = fb;else - target_fb = crtc->primary->fb; + target_fb = crtc->primary->legacy.fb;/* If atomic, assume fb object is pinned & idle & fenced and * just update base pointers @@ -2124,7 +2124,7 @@ static int dce_v11_0_crtc_do_set_base(struct drm_crtc *crtc,/* set pageflip to happen anywhere in vblank interval */ WREG32 (mmCRTC_MASTER_UPDATE_MODE + amdgpu_crtc->crtc_offset,0 ); -if (!atomic && fb && fb != crtc->primary->fb) { +if (!atomic && fb && fb != crtc->primary->legacy.fb) { abo =gem_to_amdgpu_bo (fb->obj[0 ]); r =amdgpu_bo_reserve (abo, true);if (unlikely (r !=0 ))@@ -2641,11 +2641,11 @@ static void dce_v11_0_crtc_disable(struct drm_crtc *crtc)int i;dce_v11_0_crtc_dpms (crtc,DRM_MODE_DPMS_OFF ); -if (crtc->primary->fb) { +if (crtc->primary->legacy.fb) {int r;struct amdgpu_bo *abo; - abo =gem_to_amdgpu_bo (crtc->primary->fb->obj[0 ]); + abo =gem_to_amdgpu_bo (crtc->primary->legacy.fb->obj[0 ]); r =amdgpu_bo_reserve (abo, true);if (unlikely (r))DRM_ERROR ("failed to reserve abo before unpin\n" );drivers/gpu/drm/amd/amdgpu/dce_v6_0.c +6
-6@@ -195,7 +195,7 @@ static void dce_v6_0_page_flip(struct amdgpu_device *adev, int crtc_id, u64 crtc_base, bool async) { struct amdgpu_crtc *amdgpu_crtc = adev->mode_info.crtcs[crtc_id]; -struct drm_framebuffer *fb = amdgpu_crtc->base.primary->fb; +struct drm_framebuffer *fb = amdgpu_crtc->base.primary->legacy.fb;/* flip at hsync for async, default is vsync */ WREG32(mmGRPH_FLIP_CONTROL + amdgpu_crtc->crtc_offset, async ?@@ -1841,7 +1841,7 @@ static int dce_v6_0_crtc_do_set_base(struct drm_crtc *crtc,bool bypass_lut = false;/* no fb bound */ -if (!atomic && !crtc->primary->fb) { +if (!atomic && !crtc->primary->legacy.fb) {DRM_DEBUG_KMS ("No FB bound\n" );return 0 ; }@@ -1849,7 +1849,7 @@ static int dce_v6_0_crtc_do_set_base(struct drm_crtc *crtc,if (atomic) target_fb = fb;else - target_fb = crtc->primary->fb; + target_fb = crtc->primary->legacy.fb;/* If atomic, assume fb object is pinned & idle & fenced and * just update base pointers @@ -2032,7 +2032,7 @@ static int dce_v6_0_crtc_do_set_base(struct drm_crtc *crtc,/* set pageflip to happen anywhere in vblank interval */ WREG32 (mmMASTER_UPDATE_MODE + amdgpu_crtc->crtc_offset,0 ); -if (!atomic && fb && fb != crtc->primary->fb) { +if (!atomic && fb && fb != crtc->primary->legacy.fb) { abo =gem_to_amdgpu_bo (fb->obj[0 ]); r =amdgpu_bo_reserve (abo, true);if (unlikely (r !=0 ))@@ -2472,11 +2472,11 @@ static void dce_v6_0_crtc_disable(struct drm_crtc *crtc)int i;dce_v6_0_crtc_dpms (crtc,DRM_MODE_DPMS_OFF ); -if (crtc->primary->fb) { +if (crtc->primary->legacy.fb) {int r;struct amdgpu_bo *abo; - abo =gem_to_amdgpu_bo (crtc->primary->fb->obj[0 ]); + abo =gem_to_amdgpu_bo (crtc->primary->legacy.fb->obj[0 ]); r =amdgpu_bo_reserve (abo, true);if (unlikely (r))DRM_ERROR ("failed to reserve abo before unpin\n" );drivers/gpu/drm/amd/amdgpu/dce_v8_0.c +6
-6@@ -186,7 +186,7 @@ static void dce_v8_0_page_flip(struct amdgpu_device *adev, int crtc_id, u64 crtc_base, bool async) { struct amdgpu_crtc *amdgpu_crtc = adev->mode_info.crtcs[crtc_id]; -struct drm_framebuffer *fb = amdgpu_crtc->base.primary->fb; +struct drm_framebuffer *fb = amdgpu_crtc->base.primary->legacy.fb;/* flip at hsync for async, default is vsync */ WREG32(mmGRPH_FLIP_CONTROL + amdgpu_crtc->crtc_offset, async ?@@ -1808,7 +1808,7 @@ static int dce_v8_0_crtc_do_set_base(struct drm_crtc *crtc,bool bypass_lut = false;/* no fb bound */ -if (!atomic && !crtc->primary->fb) { +if (!atomic && !crtc->primary->legacy.fb) {DRM_DEBUG_KMS ("No FB bound\n" );return 0 ; }@@ -1816,7 +1816,7 @@ static int dce_v8_0_crtc_do_set_base(struct drm_crtc *crtc,if (atomic) target_fb = fb;else - target_fb = crtc->primary->fb; + target_fb = crtc->primary->legacy.fb;/* If atomic, assume fb object is pinned & idle & fenced and * just update base pointers @@ -2001,7 +2001,7 @@ static int dce_v8_0_crtc_do_set_base(struct drm_crtc *crtc,/* set pageflip to happen anywhere in vblank interval */ WREG32 (mmMASTER_UPDATE_MODE + amdgpu_crtc->crtc_offset,0 ); -if (!atomic && fb && fb != crtc->primary->fb) { +if (!atomic && fb && fb != crtc->primary->legacy.fb) { abo =gem_to_amdgpu_bo (fb->obj[0 ]); r =amdgpu_bo_reserve (abo, true);if (unlikely (r !=0 ))@@ -2476,11 +2476,11 @@ static void dce_v8_0_crtc_disable(struct drm_crtc *crtc)int i;dce_v8_0_crtc_dpms (crtc,DRM_MODE_DPMS_OFF ); -if (crtc->primary->fb) { +if (crtc->primary->legacy.fb) {int r;struct amdgpu_bo *abo; - abo =gem_to_amdgpu_bo (crtc->primary->fb->obj[0 ]); + abo =gem_to_amdgpu_bo (crtc->primary->legacy.fb->obj[0 ]); r =amdgpu_bo_reserve (abo, true);if (unlikely (r))DRM_ERROR ("failed to reserve abo before unpin\n" );drivers/gpu/drm/drm_atomic.c +3
-3@@ -530,9 +530,9 @@ drm_atomic_get_plane_state(struct drm_atomic_state *state,WARN_ON (!state->acquire_ctx);/* the legacy pointers should never be set */ -WARN_ON (plane->fb); -WARN_ON (plane->old_fb); -WARN_ON (plane->crtc); +WARN_ON (plane->legacy.fb); +WARN_ON (plane->legacy.old_fb); +WARN_ON (plane->legacy.crtc); plane_state =drm_atomic_get_existing_plane_state (state, plane);if (plane_state)drivers/gpu/drm/drm_crtc.c +11
-11@@ -544,8 +544,8 @@ int drm_mode_getcrtc(struct drm_device *dev,drm_modeset_lock (&plane->mutex,NULL );if (plane->state && plane->state->fb) crtc_resp->fb_id = plane->state->fb->base.id; -else if (!plane->state && plane->fb) - crtc_resp->fb_id = plane->fb->base.id; +else if (!plane->state && plane->legacy.fb) + crtc_resp->fb_id = plane->legacy.fb->base.id;else crtc_resp->fb_id =0 ;@@ -600,7 +600,7 @@ static int __drm_mode_set_config_internal(struct drm_mode_set *set,drm_for_each_crtc (tmp, crtc->dev) {struct drm_plane *plane = tmp->primary; - plane->old_fb = plane->fb; + plane->legacy.old_fb = plane->legacy.fb; } fb = set->fb;@@ -609,18 +609,18 @@ static int __drm_mode_set_config_internal(struct drm_mode_set *set,if (ret ==0 ) {struct drm_plane *plane = crtc->primary; - plane->crtc = fb ? crtc :NULL ; - plane->fb = fb; + plane->legacy.crtc = fb ? crtc :NULL ; + plane->legacy.fb = fb; }drm_for_each_crtc (tmp, crtc->dev) {struct drm_plane *plane = tmp->primary; -if (plane->fb) -drm_framebuffer_get (plane->fb); -if (plane->old_fb) -drm_framebuffer_put (plane->old_fb); - plane->old_fb =NULL ; +if (plane->legacy.fb) +drm_framebuffer_get (plane->legacy.fb); +if (plane->legacy.old_fb) +drm_framebuffer_put (plane->legacy.old_fb); + plane->legacy.old_fb =NULL ; }return ret;@@ -739,7 +739,7 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data,if (plane->state) old_fb = plane->state->fb;else - old_fb = plane->fb; + old_fb = plane->legacy.fb;if (!old_fb) {drm_dbg_kms (dev,"CRTC doesn't have current FB\n" );drivers/gpu/drm/drm_crtc_helper.c +10
-10@@ -204,7 +204,7 @@ static void __drm_helper_disable_unused_functions(struct drm_device *dev) (*crtc_funcs->disable)(crtc); else (*crtc_funcs->dpms)(crtc,DRM_MODE_DPMS_OFF ); - crtc->primary->fb =NULL ; + crtc->primary->legacy.fb =NULL ; } } }@@ -635,17 +635,17 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set, save_set.mode = &set->crtc->mode; save_set.x = set->crtc->x; save_set.y = set->crtc->y; - save_set.fb = set->crtc->primary->fb; + save_set.fb = set->crtc->primary->legacy.fb;/* We should be able to check here if the fb has the same properties * and then just flip_or_move it */ -if (set->crtc->primary->fb != set->fb) { +if (set->crtc->primary->legacy.fb != set->fb) {/* If we have no fb then treat it as a full mode set */ -if (set->crtc->primary->fb ==NULL ) { +if (set->crtc->primary->legacy.fb ==NULL ) {drm_dbg_kms (dev,"[CRTC:%d:%s] no fb, full mode set\n" , set->crtc->base.id, set->crtc->name); mode_changed = true; - }else if (set->fb->format != set->crtc->primary->fb->format) { + }else if (set->fb->format != set->crtc->primary->legacy.fb->format) { mode_changed = true; }else fb_changed = true;@@ -768,13 +768,13 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set,if (drm_helper_crtc_in_use (set->crtc)) {drm_dbg_kms (dev,"[CRTC:%d:%s] attempting to set mode from userspace: " DRM_MODE_FMT "\n" , set->crtc->base.id, set->crtc->name,DRM_MODE_ARG (set->mode)); - set->crtc->primary->fb = set->fb; + set->crtc->primary->legacy.fb = set->fb;if (!drm_crtc_helper_set_mode (set->crtc, set->mode, set->x, set->y, save_set.fb)) {drm_err (dev,"[CRTC:%d:%s] failed to set mode\n" , set->crtc->base.id, set->crtc->name); - set->crtc->primary->fb = save_set.fb; + set->crtc->primary->legacy.fb = save_set.fb; ret = -EINVAL ; goto fail; }@@ -790,13 +790,13 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set, }else if (fb_changed) { set->crtc->x = set->x; set->crtc->y = set->y; - set->crtc->primary->fb = set->fb; + set->crtc->primary->legacy.fb = set->fb; ret = crtc_funcs->mode_set_base (set->crtc, set->x, set->y, save_set.fb);if (ret !=0 ) { set->crtc->x = save_set.x; set->crtc->y = save_set.y; - set->crtc->primary->fb = save_set.fb; + set->crtc->primary->legacy.fb = save_set.fb; goto fail; } }@@ -997,7 +997,7 @@ void drm_helper_resume_force_mode(struct drm_device *dev)continue ; ret =drm_crtc_helper_set_mode (crtc, &crtc->mode, - crtc->x, crtc->y, crtc->primary->fb); + crtc->x, crtc->y, crtc->primary->legacy.fb);/* Restoring the old config should never fail! */ if (ret == false)drivers/gpu/drm/drm_fb_helper.c +1
-1@@ -189,7 +189,7 @@ int drm_fb_helper_debug_leave(struct fb_info *info)continue ; funcs = crtc->helper_private; - fb = crtc->primary->fb; + fb = crtc->primary->legacy.fb;if (!crtc->enabled)continue ;drivers/gpu/drm/drm_framebuffer.c +2
-2@@ -1081,7 +1081,7 @@ static void legacy_remove_fb(struct drm_framebuffer *fb)drm_modeset_lock_all (dev);/* remove from any CRTC */ drm_for_each_crtc (crtc, dev) { -if (crtc->primary->fb == fb) { +if (crtc->primary->legacy.fb == fb) {drm_dbg_kms (dev,"Disabling [CRTC:%d:%s] because [FB:%d] is removed\n" , crtc->base.id, crtc->name, fb->base.id);@@ -1093,7 +1093,7 @@ static void legacy_remove_fb(struct drm_framebuffer *fb) }drm_for_each_plane (plane, dev) { -if (plane->fb == fb) { +if (plane->legacy.fb == fb) {drm_dbg_kms (dev,"Disabling [PLANE:%d:%s] because [FB:%d] is removed\n" , plane->base.id, plane->name, fb->base.id);drivers/gpu/drm/drm_plane.c +32
-32@@ -723,23 +723,23 @@ void drm_plane_force_disable(struct drm_plane *plane) {int ret; -if (!plane->fb) +if (!plane->legacy.fb)return ;WARN_ON (drm_drv_uses_atomic_modeset (plane->dev)); - plane->old_fb = plane->fb; + plane->legacy.old_fb = plane->legacy.fb; ret = plane->funcs->disable_plane (plane,NULL );if (ret) {DRM_ERROR ("failed to disable plane with busy fb\n" ); - plane->old_fb =NULL ; + plane->legacy.old_fb =NULL ;return ; }/* disconnect the plane from the fb and crtc: */ -drm_framebuffer_put (plane->old_fb); - plane->old_fb =NULL ; - plane->fb =NULL ; - plane->crtc =NULL ; +drm_framebuffer_put (plane->legacy.old_fb); + plane->legacy.old_fb =NULL ; + plane->legacy.fb =NULL ; + plane->legacy.crtc =NULL ; }EXPORT_SYMBOL (drm_plane_force_disable);@@ -840,15 +840,15 @@ int drm_mode_getplane(struct drm_device *dev, void *data,drm_modeset_lock (&plane->mutex,NULL );if (plane->state && plane->state->crtc &&drm_lease_held (file_priv, plane->state->crtc->base.id)) plane_resp->crtc_id = plane->state->crtc->base.id; -else if (!plane->state && plane->crtc &&drm_lease_held (file_priv, plane->crtc->base.id)) - plane_resp->crtc_id = plane->crtc->base.id; +else if (!plane->state && plane->legacy.crtc &&drm_lease_held (file_priv, plane->legacy.crtc->base.id)) + plane_resp->crtc_id = plane->legacy.crtc->base.id;else plane_resp->crtc_id =0 ;if (plane->state && plane->state->fb) plane_resp->fb_id = plane->state->fb->base.id; -else if (!plane->state && plane->fb) - plane_resp->fb_id = plane->fb->base.id; +else if (!plane->state && plane->legacy.fb) + plane_resp->fb_id = plane->legacy.fb->base.id;else plane_resp->fb_id =0 ;drm_modeset_unlock (&plane->mutex);@@ -1004,13 +1004,13 @@ static int __setplane_internal(struct drm_plane *plane,/* No fb means shut it down */ if (!fb) { - plane->old_fb = plane->fb; + plane->legacy.old_fb = plane->legacy.fb; ret = plane->funcs->disable_plane (plane, ctx);if (!ret) { - plane->crtc =NULL ; - plane->fb =NULL ; + plane->legacy.crtc =NULL ; + plane->legacy.fb =NULL ; }else { - plane->old_fb =NULL ; + plane->legacy.old_fb =NULL ; } goto out; }@@ -1021,22 +1021,22 @@ static int __setplane_internal(struct drm_plane *plane,if (ret) goto out; - plane->old_fb = plane->fb; + plane->legacy.old_fb = plane->legacy.fb; ret = plane->funcs->update_plane (plane, crtc, fb, crtc_x, crtc_y, crtc_w, crtc_h, src_x, src_y, src_w, src_h, ctx);if (!ret) { - plane->crtc = crtc; - plane->fb = fb; -drm_framebuffer_get (plane->fb); + plane->legacy.crtc = crtc; + plane->legacy.fb = fb; +drm_framebuffer_get (plane->legacy.fb); }else { - plane->old_fb =NULL ; + plane->legacy.old_fb =NULL ; } out: -if (plane->old_fb) -drm_framebuffer_put (plane->old_fb); - plane->old_fb =NULL ; +if (plane->legacy.old_fb) +drm_framebuffer_put (plane->legacy.old_fb); + plane->legacy.old_fb =NULL ;return ret; }@@ -1178,7 +1178,7 @@ static int drm_mode_cursor_universal(struct drm_crtc *crtc,int ret =0 ;BUG_ON (!plane); -WARN_ON (plane->crtc != crtc && plane->crtc !=NULL ); +WARN_ON (plane->legacy.crtc != crtc && plane->legacy.crtc !=NULL );/* * Obtain fb we'll be using (either new or existing) and take an extra @@ -1204,7 +1204,7 @@ static int drm_mode_cursor_universal(struct drm_crtc *crtc,if (plane->state) fb = plane->state->fb;else - fb = plane->fb; + fb = plane->legacy.fb;if (fb)drm_framebuffer_get (fb);@@ -1441,7 +1441,7 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev,if (plane->state) old_fb = plane->state->fb;else - old_fb = plane->fb; + old_fb = plane->legacy.fb;if (old_fb ==NULL ) {/* The framebuffer is currently unbound, presumably @@ -1506,7 +1506,7 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev, } } - plane->old_fb = plane->fb; + plane->legacy.old_fb = plane->legacy.fb;if (crtc->funcs->page_flip_target) ret = crtc->funcs->page_flip_target(crtc, fb, e, page_flip->flags,@@ -1519,10 +1519,10 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev,if (page_flip->flags &DRM_MODE_PAGE_FLIP_EVENT )drm_event_cancel_free (dev, &e->base);/* Keep the old fb, don't unref it. */ - plane->old_fb =NULL ; + plane->legacy.old_fb =NULL ; }else {if (!plane->state) { - plane->fb = fb; + plane->legacy.fb = fb;drm_framebuffer_get (fb); } }@@ -1531,9 +1531,9 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev,if (fb)drm_framebuffer_put (fb); fb =NULL ; -if (plane->old_fb) -drm_framebuffer_put (plane->old_fb); - plane->old_fb =NULL ; +if (plane->legacy.old_fb) +drm_framebuffer_put (plane->legacy.old_fb); + plane->legacy.old_fb =NULL ;if (ret == -EDEADLK ) { ret =drm_modeset_backoff (&ctx);drivers/gpu/drm/gma500/cdv_intel_display.c +1
-1@@ -462,7 +462,7 @@ static bool cdv_intel_pipe_enabled(struct drm_device *dev, int pipe) crtc = dev_priv->pipe_to_crtc_mapping[pipe]; gma_crtc =to_gma_crtc (crtc); -if (crtc->primary->fb ==NULL || !gma_crtc->active) +if (crtc->primary->legacy.fb ==NULL || !gma_crtc->active)return false;return true; }drivers/gpu/drm/gma500/cdv_intel_dp.c +1
-1@@ -1849,7 +1849,7 @@ cdv_intel_dp_set_property(struct drm_connector *connector,struct drm_crtc *crtc = encoder->base.crtc;drm_crtc_helper_set_mode (crtc, &crtc->mode, crtc->x, crtc->y, - crtc->primary->fb); + crtc->primary->legacy.fb); }return 0 ;drivers/gpu/drm/gma500/cdv_intel_hdmi.c +2
-1@@ -191,7 +191,8 @@ static int cdv_hdmi_set_property(struct drm_connector *connector, crtc->saved_mode.vdisplay != 0) {if (centre) {if (!drm_crtc_helper_set_mode (encoder->crtc, &crtc->saved_mode, - encoder->crtc->x, encoder->crtc->y, encoder->crtc->primary->fb)) + encoder->crtc->x, encoder->crtc->y, + encoder->crtc->primary->legacy.fb))return -1 ; }else {const struct drm_encoder_helper_funcs *helpersdrivers/gpu/drm/gma500/cdv_intel_lvds.c +1
-1@@ -375,7 +375,7 @@ static int cdv_intel_lvds_set_property(struct drm_connector *connector, &crtc->saved_mode, encoder->crtc->x, encoder->crtc->y, - encoder->crtc->primary->fb)) + encoder->crtc->primary->legacy.fb)) return -1; } }else if (!strcmp (property->name,"backlight" ) && encoder) {drivers/gpu/drm/gma500/gma_display.c +7
-7@@ -61,7 +61,7 @@ int gma_pipe_set_base(struct drm_crtc *crtc, int x, int y,struct drm_device *dev = crtc->dev;struct drm_psb_private *dev_priv =to_drm_psb_private (dev);struct gma_crtc *gma_crtc =to_gma_crtc (crtc); -struct drm_framebuffer *fb = crtc->primary->fb; +struct drm_framebuffer *fb = crtc->primary->legacy.fb;struct psb_gem_object *pobj;int pipe = gma_crtc->pipe;const struct psb_offset *map = &dev_priv->regmap[pipe];@@ -490,8 +490,8 @@ void gma_crtc_disable(struct drm_crtc *crtc) crtc_funcs->dpms (crtc,DRM_MODE_DPMS_OFF ); -if (crtc->primary->fb) { - pobj =to_psb_gem_object (crtc->primary->fb->obj[0 ]); +if (crtc->primary->legacy.fb) { + pobj =to_psb_gem_object (crtc->primary->legacy.fb->obj[0 ]);psb_gem_unpin (pobj); } }@@ -515,8 +515,8 @@ int gma_crtc_page_flip(struct drm_crtc *crtc, struct drm_modeset_acquire_ctx *ctx) {struct gma_crtc *gma_crtc =to_gma_crtc (crtc); -struct drm_framebuffer *current_fb = crtc->primary->fb; -struct drm_framebuffer *old_fb = crtc->primary->old_fb; +struct drm_framebuffer *current_fb = crtc->primary->legacy.fb; +struct drm_framebuffer *old_fb = crtc->primary->legacy.old_fb;const struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private;struct drm_device *dev = crtc->dev;unsigned long flags;@@ -526,7 +526,7 @@ int gma_crtc_page_flip(struct drm_crtc *crtc,return -EINVAL ;/* Using mode_set_base requires the new fb to be set already. */ - crtc->primary->fb = fb; + crtc->primary->legacy.fb = fb;if (event) {spin_lock_irqsave (&dev->event_lock, flags);@@ -552,7 +552,7 @@ int gma_crtc_page_flip(struct drm_crtc *crtc,/* Restore previous fb in case of failure. */ if (ret) - crtc->primary->fb = current_fb; + crtc->primary->legacy.fb = current_fb;return ret; }drivers/gpu/drm/gma500/oaktrail_crtc.c +1
-1@@ -595,7 +595,7 @@ static int oaktrail_pipe_set_base(struct drm_crtc *crtc,struct drm_device *dev = crtc->dev;struct drm_psb_private *dev_priv =to_drm_psb_private (dev);struct gma_crtc *gma_crtc =to_gma_crtc (crtc); -struct drm_framebuffer *fb = crtc->primary->fb; +struct drm_framebuffer *fb = crtc->primary->legacy.fb;int pipe = gma_crtc->pipe;const struct psb_offset *map = &dev_priv->regmap[pipe];unsigned long start, offset;drivers/gpu/drm/gma500/psb_intel_display.c +1
-1@@ -112,7 +112,7 @@ static int psb_intel_crtc_mode_set(struct drm_crtc *crtc,const struct gma_limit_t *limit;/* No scan out no play */ -if (crtc->primary->fb ==NULL ) { +if (crtc->primary->legacy.fb ==NULL ) { crtc_funcs->mode_set_base (crtc, x, y, old_fb);return 0 ; }drivers/gpu/drm/gma500/psb_intel_lvds.c +1
-1@@ -570,7 +570,7 @@ int psb_intel_lvds_set_property(struct drm_connector *connector, &crtc->saved_mode, encoder->crtc->x, encoder->crtc->y, - encoder->crtc->primary->fb)) + encoder->crtc->primary->legacy.fb)) goto set_prop_error; } }else if (!strcmp (property->name,"backlight" )) {drivers/gpu/drm/gma500/psb_intel_sdvo.c +1
-1@@ -1727,7 +1727,7 @@ psb_intel_sdvo_set_property(struct drm_connector *connector,if (psb_intel_sdvo->base.base.crtc) {struct drm_crtc *crtc = psb_intel_sdvo->base.base.crtc;drm_crtc_helper_set_mode (crtc, &crtc->mode, crtc->x, - crtc->y, crtc->primary->fb); + crtc->y, crtc->primary->legacy.fb); }return 0 ;drivers/gpu/drm/i2c/ch7006_drv.c +1
-1@@ -364,7 +364,7 @@ static int ch7006_encoder_set_property(struct drm_encoder *encoder,if (crtc)drm_crtc_helper_set_mode (crtc, &crtc->mode, crtc->x, crtc->y, - crtc->primary->fb); + crtc->primary->legacy.fb); }return 0 ;drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +3
-3@@ -122,11 +122,11 @@ static void _dpu_plane_set_danger_state(struct dpu_kms *kms, bool enable)struct drm_plane *plane;drm_for_each_plane (plane, kms->dev) { -if (plane->fb && plane->state) { +if (plane->legacy.fb && plane->state) {dpu_plane_danger_signal_ctrl (plane, enable);DPU_DEBUG ("plane:%d img:%dx%d " , - plane->base.id, plane->fb->width, - plane->fb->height); + plane->base.id, plane->legacy.fb->width, + plane->legacy.fb->height); DPU_DEBUG("src[%d,%d,%d,%d] dst[%d,%d,%d,%d]\n", plane->state->src_x >> 16, plane->state->src_y >> 16,drivers/gpu/drm/nouveau/dispnv04/crtc.c +8
-8@@ -239,7 +239,7 @@ nv_crtc_mode_set_vga(struct drm_crtc *crtc, struct drm_display_mode *mode)struct drm_device *dev = crtc->dev;struct nouveau_crtc *nv_crtc =nouveau_crtc (crtc);struct nv04_crtc_reg *regp = &nv04_display (dev)->mode_reg.crtc_reg[nv_crtc->index]; -struct drm_framebuffer *fb = crtc->primary->fb; +struct drm_framebuffer *fb = crtc->primary->legacy.fb;/* Calculate our timings */ int horizDisplay = (mode->crtc_hdisplay >>3 ) -1 ;@@ -465,7 +465,7 @@ nv_crtc_mode_set_regs(struct drm_crtc *crtc, struct drm_display_mode * mode)struct nouveau_crtc *nv_crtc =nouveau_crtc (crtc);struct nv04_crtc_reg *regp = &nv04_display (dev)->mode_reg.crtc_reg[nv_crtc->index];struct nv04_crtc_reg *savep = &nv04_display (dev)->saved_reg.crtc_reg[nv_crtc->index]; -const struct drm_framebuffer *fb = crtc->primary->fb; +const struct drm_framebuffer *fb = crtc->primary->legacy.fb;struct drm_encoder *encoder;bool lvds_output = false, tmds_output = false, tv_output = false, off_chip_digital = false;@@ -610,7 +610,7 @@ static int nv_crtc_swap_fbs(struct drm_crtc *crtc, struct drm_framebuffer *old_fb) { struct nv04_display *disp = nv04_display(crtc->dev); -struct drm_framebuffer *fb = crtc->primary->fb; +struct drm_framebuffer *fb = crtc->primary->legacy.fb;struct nouveau_bo *nvbo =nouveau_gem_object (fb->obj[0 ]);struct nouveau_crtc *nv_crtc =nouveau_crtc (crtc);int ret;@@ -826,7 +826,7 @@ nv_crtc_gamma_set(struct drm_crtc *crtc, u16 *r, u16 *g, u16 *b,* mark the lut values as dirty by setting depth==0, and it'll be * uploaded on the first mode_set_base() */ -if (!nv_crtc->base.primary->fb) { +if (!nv_crtc->base.primary->legacy.fb) { nv_crtc->lut.depth =0 ;return 0 ; }@@ -852,7 +852,7 @@ nv04_crtc_do_mode_set_base(struct drm_crtc *crtc,NV_DEBUG (drm,"index %d\n" , nv_crtc->index);/* no fb bound */ -if (!atomic && !crtc->primary->fb) { +if (!atomic && !crtc->primary->legacy.fb) {NV_DEBUG (drm,"No FB bound\n" );return 0 ; }@@ -863,7 +863,7 @@ nv04_crtc_do_mode_set_base(struct drm_crtc *crtc,if (atomic) { drm_fb = passed_fb; }else { - drm_fb = crtc->primary->fb; + drm_fb = crtc->primary->legacy.fb; } nvbo =nouveau_gem_object (drm_fb->obj[0 ]);@@ -1157,7 +1157,7 @@ nv04_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb,const int swap_interval = (flags &DRM_MODE_PAGE_FLIP_ASYNC ) ?0 :1 ;struct drm_device *dev = crtc->dev;struct nouveau_drm *drm =nouveau_drm (dev); -struct drm_framebuffer *old_fb = crtc->primary->fb; +struct drm_framebuffer *old_fb = crtc->primary->legacy.fb;struct nouveau_bo *old_bo =nouveau_gem_object (old_fb->obj[0 ]);struct nouveau_bo *new_bo =nouveau_gem_object (fb->obj[0 ]);struct nv04_page_flip_state *s;@@ -1237,7 +1237,7 @@ nv04_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb,mutex_unlock (&cli->mutex);/* Update the crtc struct and cleanup */ - crtc->primary->fb = fb; + crtc->primary->legacy.fb = fb;nouveau_bo_fence (old_bo, fence, false);ttm_bo_unreserve (&old_bo->bo);drivers/gpu/drm/nouveau/dispnv04/dfp.c +1
-1@@ -291,7 +291,7 @@ static void nv04_dfp_mode_set(struct drm_encoder *encoder,struct nouveau_encoder *nv_encoder =nouveau_encoder (encoder);struct drm_display_mode *output_mode = &nv_encoder->mode;struct drm_connector *connector = &nv_connector->base; -const struct drm_framebuffer *fb = encoder->crtc->primary->fb; +const struct drm_framebuffer *fb = encoder->crtc->primary->legacy.fb;uint32_t mode_ratio, panel_ratio;NV_DEBUG (drm,"Output mode on CRTC %d:\n" , nv_crtc->index);drivers/gpu/drm/nouveau/dispnv04/disp.c +2
-2@@ -76,7 +76,7 @@ nv04_display_fini(struct drm_device *dev, bool runtime, bool suspend)/* Un-pin FB and cursors so they'll be evicted to system memory. */ list_for_each_entry (crtc, &dev->mode_config.crtc_list, head) { -struct drm_framebuffer *fb = crtc->primary->fb; +struct drm_framebuffer *fb = crtc->primary->legacy.fb;struct nouveau_bo *nvbo;if (!fb || !fb->obj[0 ])@@ -128,7 +128,7 @@ nv04_display_init(struct drm_device *dev, bool resume, bool runtime)/* Re-pin FB/cursors. */ list_for_each_entry (crtc, &dev->mode_config.crtc_list, head) { -struct drm_framebuffer *fb = crtc->primary->fb; +struct drm_framebuffer *fb = crtc->primary->legacy.fb;struct nouveau_bo *nvbo;if (!fb || !fb->obj[0 ])drivers/gpu/drm/nouveau/dispnv04/tvnv17.c +1
-1@@ -756,7 +756,7 @@ static int nv17_tv_set_property(struct drm_encoder *encoder,if (crtc)drm_crtc_helper_set_mode (crtc, &crtc->mode, crtc->x, crtc->y, - crtc->primary->fb); + crtc->primary->legacy.fb); }return 0 ;drivers/gpu/drm/radeon/atombios_crtc.c +8
-8@@ -1150,7 +1150,7 @@ static int dce4_crtc_do_set_base(struct drm_crtc *crtc,bool bypass_lut = false;/* no fb bound */ -if (!atomic && !crtc->primary->fb) { +if (!atomic && !crtc->primary->legacy.fb) {DRM_DEBUG_KMS ("No FB bound\n" );return 0 ; }@@ -1158,7 +1158,7 @@ static int dce4_crtc_do_set_base(struct drm_crtc *crtc,if (atomic) target_fb = fb;else - target_fb = crtc->primary->fb; + target_fb = crtc->primary->legacy.fb;/* If atomic, assume fb object is pinned & idle & fenced and * just update base pointers @@ -1437,7 +1437,7 @@ static int dce4_crtc_do_set_base(struct drm_crtc *crtc,/* set pageflip to happen anywhere in vblank interval */ WREG32 (EVERGREEN_MASTER_UPDATE_MODE + radeon_crtc->crtc_offset,0 ); -if (!atomic && fb && fb != crtc->primary->fb) { +if (!atomic && fb && fb != crtc->primary->legacy.fb) { rbo =gem_to_radeon_bo (fb->obj[0 ]); r =radeon_bo_reserve (rbo, false);if (unlikely (r !=0 ))@@ -1470,7 +1470,7 @@ static int avivo_crtc_do_set_base(struct drm_crtc *crtc,bool bypass_lut = false;/* no fb bound */ -if (!atomic && !crtc->primary->fb) { +if (!atomic && !crtc->primary->legacy.fb) {DRM_DEBUG_KMS ("No FB bound\n" );return 0 ; }@@ -1478,7 +1478,7 @@ static int avivo_crtc_do_set_base(struct drm_crtc *crtc,if (atomic) target_fb = fb;else - target_fb = crtc->primary->fb; + target_fb = crtc->primary->legacy.fb; obj = target_fb->obj[0 ]; rbo =gem_to_radeon_bo (obj);@@ -1645,7 +1645,7 @@ static int avivo_crtc_do_set_base(struct drm_crtc *crtc,/* set pageflip to happen only at start of vblank interval (front porch) */ WREG32 (AVIVO_D1MODE_MASTER_UPDATE_MODE + radeon_crtc->crtc_offset,3 ); -if (!atomic && fb && fb != crtc->primary->fb) { +if (!atomic && fb && fb != crtc->primary->legacy.fb) { rbo =gem_to_radeon_bo (fb->obj[0 ]); r =radeon_bo_reserve (rbo, false);if (unlikely (r !=0 ))@@ -2150,11 +2150,11 @@ static void atombios_crtc_disable(struct drm_crtc *crtc)int i;atombios_crtc_dpms (crtc,DRM_MODE_DPMS_OFF ); -if (crtc->primary->fb) { +if (crtc->primary->legacy.fb) {int r;struct radeon_bo *rbo; - rbo =gem_to_radeon_bo (crtc->primary->fb->obj[0 ]); + rbo =gem_to_radeon_bo (crtc->primary->legacy.fb->obj[0 ]); r =radeon_bo_reserve (rbo, false);if (unlikely (r))DRM_ERROR ("failed to reserve rbo before unpin\n" );drivers/gpu/drm/radeon/evergreen.c +1
-1@@ -1417,7 +1417,7 @@ void evergreen_page_flip(struct radeon_device *rdev, int crtc_id, u64 crtc_base, bool async) {struct radeon_crtc *radeon_crtc = rdev->mode_info.crtcs[crtc_id]; -struct drm_framebuffer *fb = radeon_crtc->base.primary->fb; +struct drm_framebuffer *fb = radeon_crtc->base.primary->legacy.fb;/* flip at hsync for async, default is vsync */ WREG32(EVERGREEN_GRPH_FLIP_CONTROL + radeon_crtc->crtc_offset,drivers/gpu/drm/radeon/r100.c +3
-3@@ -165,7 +165,7 @@ void r100_page_flip(struct radeon_device *rdev, int crtc_id, u64 crtc_base, bool {struct radeon_crtc *radeon_crtc = rdev->mode_info.crtcs[crtc_id];uint32_t crtc_pitch, pitch_pixels; -struct drm_framebuffer *fb = radeon_crtc->base.primary->fb; +struct drm_framebuffer *fb = radeon_crtc->base.primary->legacy.fb;u32 tmp = ((u32 )crtc_base) |RADEON_CRTC_OFFSET__OFFSET_LOCK ;int i;@@ -3244,7 +3244,7 @@ void r100_bandwidth_update(struct radeon_device *rdev)if (rdev->mode_info.crtcs[0 ]->base.enabled) {const struct drm_framebuffer *fb = - rdev->mode_info.crtcs[0 ]->base.primary->fb; + rdev->mode_info.crtcs[0 ]->base.primary->legacy.fb; mode1 = &rdev->mode_info.crtcs[0 ]->base.mode; pixel_bytes1 = fb->format->cpp[0 ];@@ -3252,7 +3252,7 @@ void r100_bandwidth_update(struct radeon_device *rdev)if (!(rdev->flags &RADEON_SINGLE_CRTC )) {if (rdev->mode_info.crtcs[1 ]->base.enabled) {const struct drm_framebuffer *fb = - rdev->mode_info.crtcs[1 ]->base.primary->fb; + rdev->mode_info.crtcs[1 ]->base.primary->legacy.fb; mode2 = &rdev->mode_info.crtcs[1 ]->base.mode; pixel_bytes2 = fb->format->cpp[0 ];drivers/gpu/drm/radeon/radeon_connectors.c +2
-1@@ -92,7 +92,8 @@ static void radeon_property_change_mode(struct drm_encoder *encoder)if (crtc && crtc->enabled) {drm_crtc_helper_set_mode (crtc, &crtc->mode, - crtc->x, crtc->y, crtc->primary->fb); + crtc->x, crtc->y, + crtc->primary->legacy.fb); } }drivers/gpu/drm/radeon/radeon_device.c +1
-1@@ -1572,7 +1572,7 @@ int radeon_suspend_kms(struct drm_device *dev, bool suspend,/* unpin the front buffers and cursors */ list_for_each_entry (crtc, &dev->mode_config.crtc_list, head) {struct radeon_crtc *radeon_crtc =to_radeon_crtc (crtc); -struct drm_framebuffer *fb = crtc->primary->fb; +struct drm_framebuffer *fb = crtc->primary->legacy.fb;struct radeon_bo *robj;if (radeon_crtc->cursor_bo) {drivers/gpu/drm/radeon/radeon_display.c +2
-2@@ -506,7 +506,7 @@ static int radeon_crtc_page_flip_target(struct drm_crtc *crtc, work->async = (page_flip_flags &DRM_MODE_PAGE_FLIP_ASYNC ) !=0 ;/* schedule unpin of the old buffer */ - obj = crtc->primary->fb->obj[0 ]; + obj = crtc->primary->legacy.fb->obj[0 ];/* take a reference to the old object */ drm_gem_object_get (obj);@@ -595,7 +595,7 @@ static int radeon_crtc_page_flip_target(struct drm_crtc *crtc, radeon_crtc->flip_work = work;/* update crtc fb */ - crtc->primary->fb = fb; + crtc->primary->legacy.fb = fb;spin_unlock_irqrestore (&crtc->dev->event_lock, flags);drivers/gpu/drm/radeon/radeon_legacy_crtc.c +7
-7@@ -390,7 +390,7 @@ int radeon_crtc_do_set_base(struct drm_crtc *crtc,DRM_DEBUG_KMS ("\n" );/* no fb bound */ -if (!atomic && !crtc->primary->fb) { +if (!atomic && !crtc->primary->legacy.fb) {DRM_DEBUG_KMS ("No FB bound\n" );return 0 ; }@@ -398,7 +398,7 @@ int radeon_crtc_do_set_base(struct drm_crtc *crtc,if (atomic) target_fb = fb;else - target_fb = crtc->primary->fb; + target_fb = crtc->primary->legacy.fb;switch (target_fb->format->cpp[0 ] *8 ) {case 8 :@@ -445,7 +445,7 @@ int radeon_crtc_do_set_base(struct drm_crtc *crtc,* We don't shutdown the display controller because new buffer * will end up in same spot. */ -if (!atomic && fb && fb != crtc->primary->fb) { +if (!atomic && fb && fb != crtc->primary->legacy.fb) {struct radeon_bo *old_rbo;unsigned long nsize, osize;@@ -555,7 +555,7 @@ int radeon_crtc_do_set_base(struct drm_crtc *crtc,WREG32 (RADEON_CRTC_OFFSET + radeon_crtc->crtc_offset, crtc_offset);WREG32 (RADEON_CRTC_PITCH + radeon_crtc->crtc_offset, crtc_pitch); -if (!atomic && fb && fb != crtc->primary->fb) { +if (!atomic && fb && fb != crtc->primary->legacy.fb) { rbo =gem_to_radeon_bo (fb->obj[0 ]); r =radeon_bo_reserve (rbo, false);if (unlikely (r !=0 ))@@ -575,7 +575,7 @@ static bool radeon_set_crtc_timing(struct drm_crtc *crtc, struct drm_display_modstruct drm_device *dev = crtc->dev;struct radeon_device *rdev = dev->dev_private;struct radeon_crtc *radeon_crtc =to_radeon_crtc (crtc); -const struct drm_framebuffer *fb = crtc->primary->fb; +const struct drm_framebuffer *fb = crtc->primary->legacy.fb;struct drm_encoder *encoder;int format;int hsync_start;@@ -1088,11 +1088,11 @@ static void radeon_crtc_commit(struct drm_crtc *crtc)static void radeon_crtc_disable (struct drm_crtc *crtc) {radeon_crtc_dpms (crtc,DRM_MODE_DPMS_OFF ); -if (crtc->primary->fb) { +if (crtc->primary->legacy.fb) {int r;struct radeon_bo *rbo; - rbo =gem_to_radeon_bo (crtc->primary->fb->obj[0 ]); + rbo =gem_to_radeon_bo (crtc->primary->legacy.fb->obj[0 ]); r =radeon_bo_reserve (rbo, false);if (unlikely (r))DRM_ERROR ("failed to reserve rbo before unpin\n" );drivers/gpu/drm/radeon/rs600.c +1
-1@@ -119,7 +119,7 @@ void avivo_wait_for_vblank(struct radeon_device *rdev, int crtc)void rs600_page_flip (struct radeon_device *rdev,int crtc_id,u64 crtc_base,bool async) {struct radeon_crtc *radeon_crtc = rdev->mode_info.crtcs[crtc_id]; -struct drm_framebuffer *fb = radeon_crtc->base.primary->fb; +struct drm_framebuffer *fb = radeon_crtc->base.primary->legacy.fb;u32 tmp =RREG32 (AVIVO_D1GRPH_UPDATE + radeon_crtc->crtc_offset);int i;drivers/gpu/drm/radeon/rv770.c +1
-1@@ -800,7 +800,7 @@ u32 rv770_get_xclk(struct radeon_device *rdev)void rv770_page_flip (struct radeon_device *rdev,int crtc_id,u64 crtc_base,bool async) {struct radeon_crtc *radeon_crtc = rdev->mode_info.crtcs[crtc_id]; -struct drm_framebuffer *fb = radeon_crtc->base.primary->fb; +struct drm_framebuffer *fb = radeon_crtc->base.primary->legacy.fb;u32 tmp =RREG32 (AVIVO_D1GRPH_UPDATE + radeon_crtc->crtc_offset);int i;drivers/gpu/drm/rockchip/rockchip_drm_vop.c +1
-1@@ -1097,7 +1097,7 @@ static int vop_plane_atomic_async_check(struct drm_plane *plane, crtc_state =drm_atomic_get_existing_crtc_state (state, new_plane_state->crtc); else /* Special case for asynchronous cursor updates. */ - crtc_state = plane->crtc->state; + crtc_state = plane->legacy.crtc->state; return drm_atomic_helper_check_plane_state(plane->state, crtc_state, min_scale, max_scale,include/drm/drm_plane.h +27
-25@@ -663,31 +663,33 @@ struct drm_plane {/** @modifier_count: Size of the array pointed at by @modifier_count. */ unsigned int modifier_count; -/** -* @crtc: -* -* Currently bound CRTC, only meaningful for non-atomic drivers. For -* atomic drivers this is forced to be NULL, atomic drivers should -* instead check &drm_plane_state.crtc. -*/ -struct drm_crtc *crtc; - -/** -* @fb: -* -* Currently bound framebuffer, only meaningful for non-atomic drivers. -* For atomic drivers this is forced to be NULL, atomic drivers should -* instead check &drm_plane_state.fb. -*/ -struct drm_framebuffer *fb; - -/** -* @old_fb: -* -* Temporary tracking of the old fb while a modeset is ongoing. Only -* used by non-atomic drivers, forced to be NULL for atomic drivers. -*/ -struct drm_framebuffer *old_fb; +struct { +/** +* @crtc: +* +* Currently bound CRTC, only meaningful for non-atomic drivers. For +* atomic drivers this is forced to be NULL, atomic drivers should +* instead check &drm_plane_state.crtc. +*/ +struct drm_crtc *crtc; + +/** +* @fb: +* +* Currently bound framebuffer, only meaningful for non-atomic drivers. +* For atomic drivers this is forced to be NULL, atomic drivers should +* instead check &drm_plane_state.fb. +*/ +struct drm_framebuffer *fb; + +/** +* @old_fb: +* +* Temporary tracking of the old fb while a modeset is ongoing. Only +* used by non-atomic drivers, forced to be NULL for atomic drivers. +*/ +struct drm_framebuffer *old_fb; + } legacy;/** @funcs: plane control functions */ const struct drm_plane_funcs *funcs;Signature · 1 line
2.45.2
Signature · 2 lines
Ville Syrjälä Intel
Jani Nikula
maintainerRe: [PATCH 1/2] drm: Move plane->{fb,old_fb,crtc} to legacy sub-structure
Quoted 12 lines · Ville Syrjälä
Quoted 8 lines · Ville Syrjala
From: Ville Syrjälä <[email protected]>
Hide the plane->fb/etc. footguns better by stashing them inside a "legacy" sub struct.
Eventually maybe we could turn 'legacy' into a pointer that only exists on legacy drivers to completely prevent any abuse by atomic drivers...
Hmm. I should probably make it a pointer from the start, to avoid having to go through the same churn yet again.
[snip]
Quoted 26 lines
Quoted 26 lines
include/drm/drm_plane.h +0
-18@@ -663,31 +663,33 @@ struct drm_plane {/** @modifier_count: Size of the array pointed at by @modifier_count. */ unsigned int modifier_count; -/** -* @crtc: -* -* Currently bound CRTC, only meaningful for non-atomic drivers. For -* atomic drivers this is forced to be NULL, atomic drivers should -* instead check &drm_plane_state.crtc. -*/ -struct drm_crtc *crtc; - -/** -* @fb: -* -* Currently bound framebuffer, only meaningful for non-atomic drivers. -* For atomic drivers this is forced to be NULL, atomic drivers should -* instead check &drm_plane_state.fb. -*/ -struct drm_framebuffer *fb; -
Quoted 8 lines
include/drm/drm_plane.h struct drm_plane { · line 666
Quoted 8 lines
include/drm/drm_plane.h +1
-7-/** -* @old_fb: -* -* Temporary tracking of the old fb while a modeset is ongoing. Only -* used by non-atomic drivers, forced to be NULL for atomic drivers. -*/ -struct drm_framebuffer *old_fb; +struct {
Do you mean something along the lines of:
struct __plane_legacy_or_something {Quoted 18 lines
Quoted 18 lines
include/drm/drm_plane.h +18
-0+/** +* @crtc: +* +* Currently bound CRTC, only meaningful for non-atomic drivers. For +* atomic drivers this is forced to be NULL, atomic drivers should +* instead check &drm_plane_state.crtc. +*/ +struct drm_crtc *crtc; + +/** +* @fb: +* +* Currently bound framebuffer, only meaningful for non-atomic drivers. +* For atomic drivers this is forced to be NULL, atomic drivers should +* instead check &drm_plane_state.fb. +*/ +struct drm_framebuffer *fb; +
Quoted 8 lines
include/drm/drm_plane.h struct drm_plane { · line 692
Quoted 8 lines
include/drm/drm_plane.h +8
-0+/** +* @old_fb: +* +* Temporary tracking of the old fb while a modeset is ongoing. Only +* used by non-atomic drivers, forced to be NULL for atomic drivers. +*/ +struct drm_framebuffer *old_fb; + } legacy;
and
} __legacy; struct __plane_legacy_or_something *legacy;
and initially unconditionally:
p->legacy = &p->__legacy;
but later, once atomic drivers have been fixed:
if (!drm_core_check_feature(dev, DRIVER_COMPUTE_ATOMIC)) p->legacy = &p->__legacy;
It would make the last update really simple.
BR,
Jani.
Quoted 5 lines
Quoted 5 lines
include/drm/drm_plane.h +0
-0/** @funcs: plane control functions */ const struct drm_plane_funcs *funcs;Signature · 1 line
2.45.2
Signature · 1 line
Jani Nikula, Intel
Re: [PATCH 1/2] drm: Move plane->{fb,old_fb,crtc} to legacy sub-structure
Quoted 90 lines · Jani Nikula
Quoted 12 lines · Ville Syrjälä
Quoted 8 lines · Ville Syrjala
From: Ville Syrjälä <[email protected]>
Hide the plane->fb/etc. footguns better by stashing them inside a "legacy" sub struct.
Eventually maybe we could turn 'legacy' into a pointer that only exists on legacy drivers to completely prevent any abuse by atomic drivers...
Hmm. I should probably make it a pointer from the start, to avoid having to go through the same churn yet again.
[snip]
Quoted 26 lines
Quoted 26 lines
include/drm/drm_plane.h +0
-18@@ -663,31 +663,33 @@ struct drm_plane {/** @modifier_count: Size of the array pointed at by @modifier_count. */ unsigned int modifier_count; -/** -* @crtc: -* -* Currently bound CRTC, only meaningful for non-atomic drivers. For -* atomic drivers this is forced to be NULL, atomic drivers should -* instead check &drm_plane_state.crtc. -*/ -struct drm_crtc *crtc; - -/** -* @fb: -* -* Currently bound framebuffer, only meaningful for non-atomic drivers. -* For atomic drivers this is forced to be NULL, atomic drivers should -* instead check &drm_plane_state.fb. -*/ -struct drm_framebuffer *fb; -Quoted 8 lines
include/drm/drm_plane.h struct drm_plane { · line 666
Quoted 8 lines
include/drm/drm_plane.h +1
-7-/** -* @old_fb: -* -* Temporary tracking of the old fb while a modeset is ongoing. Only -* used by non-atomic drivers, forced to be NULL for atomic drivers. -*/ -struct drm_framebuffer *old_fb; +struct {Do you mean something along the lines of:
struct __plane_legacy_or_something {Quoted 18 lines
Quoted 18 lines
include/drm/drm_plane.h +18
-0+/** +* @crtc: +* +* Currently bound CRTC, only meaningful for non-atomic drivers. For +* atomic drivers this is forced to be NULL, atomic drivers should +* instead check &drm_plane_state.crtc. +*/ +struct drm_crtc *crtc; + +/** +* @fb: +* +* Currently bound framebuffer, only meaningful for non-atomic drivers. +* For atomic drivers this is forced to be NULL, atomic drivers should +* instead check &drm_plane_state.fb. +*/ +struct drm_framebuffer *fb; +Quoted 8 lines
include/drm/drm_plane.h struct drm_plane { · line 692
Quoted 8 lines
include/drm/drm_plane.h +8
-0+/** +* @old_fb: +* +* Temporary tracking of the old fb while a modeset is ongoing. Only +* used by non-atomic drivers, forced to be NULL for atomic drivers. +*/ +struct drm_framebuffer *old_fb; + } legacy;and
} __legacy; struct __plane_legacy_or_something *legacy;and initially unconditionally:
Quoted 8 lines
p->legacy = &p->__legacy;but later, once atomic drivers have been fixed:
if (!drm_core_check_feature(dev, DRIVER_COMPUTE_ATOMIC)) p->legacy = &p->__legacy;It would make the last update really simple.
Yeah, something like that.
Signature · 2 lines
Ville Syrjälä Intel
PATCH 2/2 drm: Move crtc->{x, y, mode, enabled} to legacy sub-structure
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
Atomic drivers shouldn't be using the legacy state stored directly under drm_crtc. Move that junk into a 'legacy' sub structure to highlight the offenders, of which there are quite a few unfortunately.
I'm hoping we could get all these fixed and then declare the legacy state off limits for atomic drivers (which is what did long ago for plane->fb/etc). And maybe eventually turn crtc->legacy into a pointer and only allocate it on legacy drivers.
TODO: hwmode should probably go there too but it probably
needs a closer look, maybe other stuff too...
--- .../gpu/drm/amd/amdgpu/amdgpu_connectors.c | 7 +- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 14 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c | 2 +- drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 23 +++--- drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 23 +++--- drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 25 ++++--- drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 23 +++--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 14 ++-- .../amd/display/amdgpu_dm/amdgpu_dm_crtc.c | 2 +- drivers/gpu/drm/amd/pm/amdgpu_dpm_internal.c | 4 +- drivers/gpu/drm/arm/hdlcd_drv.c | 2 +- drivers/gpu/drm/arm/malidp_hw.c | 2 +- drivers/gpu/drm/armada/armada_crtc.c | 12 ++- drivers/gpu/drm/ast/ast_dp.c | 8 +- drivers/gpu/drm/drm_atomic_helper.c | 8 +- drivers/gpu/drm/drm_client_modeset.c | 10 +-- drivers/gpu/drm/drm_crtc.c | 9 ++- drivers/gpu/drm/drm_crtc_helper.c | 62 +++++++-------- drivers/gpu/drm/drm_fb_helper.c | 10 ++- drivers/gpu/drm/drm_plane.c | 5 +- drivers/gpu/drm/drm_plane_helper.c | 6 +- drivers/gpu/drm/drm_vblank.c | 2 +- drivers/gpu/drm/exynos/exynos5433_drm_decon.c | 4 +- drivers/gpu/drm/gma500/cdv_intel_dp.c | 4 +- drivers/gpu/drm/gma500/cdv_intel_hdmi.c | 2 +- drivers/gpu/drm/gma500/cdv_intel_lvds.c | 4 +- drivers/gpu/drm/gma500/gma_display.c | 8 +- drivers/gpu/drm/gma500/psb_intel_lvds.c | 4 +- drivers/gpu/drm/gma500/psb_intel_sdvo.c | 8 +- drivers/gpu/drm/i2c/ch7006_drv.c | 5 +- drivers/gpu/drm/i2c/sil164_drv.c | 2 +- .../drm/i915/display/intel_modeset_setup.c | 4 +- drivers/gpu/drm/imx/lcdc/imx-lcdc.c | 31 +++++--- drivers/gpu/drm/mediatek/mtk_crtc.c | 6 +- drivers/gpu/drm/meson/meson_overlay.c | 2 +- drivers/gpu/drm/meson/meson_plane.c | 8 +- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 18 +++-- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 16 ++-- drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c | 4 +- drivers/gpu/drm/nouveau/dispnv04/crtc.c | 9 ++- drivers/gpu/drm/nouveau/dispnv04/cursor.c | 2 +- .../gpu/drm/nouveau/dispnv04/tvmodesnv17.c | 4 +- drivers/gpu/drm/nouveau/dispnv04/tvnv17.c | 5 +- drivers/gpu/drm/nouveau/nouveau_connector.c | 6 +- drivers/gpu/drm/qxl/qxl_display.c | 6 +- drivers/gpu/drm/radeon/atombios_crtc.c | 12 +-- drivers/gpu/drm/radeon/cik.c | 12 +-- drivers/gpu/drm/radeon/evergreen.c | 14 ++-- drivers/gpu/drm/radeon/r100.c | 10 +-- drivers/gpu/drm/radeon/r600_cs.c | 2 +- drivers/gpu/drm/radeon/r600_dpm.c | 4 +- drivers/gpu/drm/radeon/radeon_connectors.c | 6 +- drivers/gpu/drm/radeon/radeon_cursor.c | 29 +++---- drivers/gpu/drm/radeon/radeon_display.c | 22 +++--- drivers/gpu/drm/radeon/radeon_drv.c | 2 +- drivers/gpu/drm/radeon/radeon_legacy_crtc.c | 2 +- .../gpu/drm/radeon/radeon_legacy_encoders.c | 2 +- drivers/gpu/drm/radeon/radeon_pm.c | 2 +- drivers/gpu/drm/radeon/rs600.c | 8 +- drivers/gpu/drm/radeon/rs690.c | 22 +++--- drivers/gpu/drm/radeon/rs780_dpm.c | 6 +- drivers/gpu/drm/radeon/rv515.c | 30 ++++---- drivers/gpu/drm/radeon/si.c | 14 ++-- .../gpu/drm/renesas/rcar-du/rcar_du_crtc.c | 2 +- .../gpu/drm/renesas/shmobile/shmob_drm_crtc.c | 2 +- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 4 +- drivers/gpu/drm/sti/sti_crtc.c | 4 +- drivers/gpu/drm/sti/sti_cursor.c | 2 +- drivers/gpu/drm/sti/sti_gdp.c | 2 +- drivers/gpu/drm/sti/sti_hqvdp.c | 2 +- drivers/gpu/drm/sti/sti_tvout.c | 6 +- drivers/gpu/drm/sti/sti_vid.c | 2 +- drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 10 +-- drivers/gpu/drm/tiny/arcpgu.c | 2 +- drivers/gpu/drm/vboxvideo/vbox_mode.c | 2 +- drivers/gpu/drm/vc4/vc4_dpi.c | 2 +- drivers/gpu/drm/vc4/vc4_plane.c | 4 +- drivers/gpu/drm/virtio/virtgpu_display.c | 4 +- drivers/gpu/drm/vkms/vkms_composer.c | 4 +- drivers/gpu/drm/vkms/vkms_crtc.c | 2 +- drivers/gpu/drm/vkms/vkms_writeback.c | 4 +- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 8 +- drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c | 18 +++-- drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c | 9 ++- drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c | 4 +- drivers/gpu/drm/vmwgfx/vmwgfx_vkms.c | 2 +- drivers/gpu/drm/xen/xen_drm_front_kms.c | 2 +- include/drm/drm_crtc.h | 75 ++++++++++--------- 89 files changed, 431 insertions(+), 383 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c +4 -3
@@ -92,9 +92,10 @@ static void amdgpu_connector_property_change_mode(struct drm_encoder *encoder) {struct drm_crtc *crtc = encoder->crtc; -if (crtc && crtc->enabled) { -drm_crtc_helper_set_mode (crtc, &crtc->mode, - crtc->x, crtc->y, crtc->primary->legacy.fb); +if (crtc && crtc->legacy.enabled) { +drm_crtc_helper_set_mode (crtc, &crtc->legacy.mode, + crtc->legacy.x, crtc->legacy.y, + crtc->primary->legacy.fb); } }
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +7 -7
@@ -328,7 +328,7 @@ int amdgpu_display_crtc_set_config(struct drm_mode_set *set, ret =drm_crtc_helper_set_config (set, ctx);list_for_each_entry (crtc, &dev->mode_config.crtc_list, head) -if (crtc->enabled) +if (crtc->legacy.enabled) active = true;pm_runtime_mark_last_busy (dev->dev);
@@ -1466,9 +1466,9 @@ bool amdgpu_display_crtc_scaling_mode_fixup(struct drm_crtc *crtc,memcpy (&amdgpu_crtc->native_mode, &amdgpu_encoder->native_mode,sizeof (struct drm_display_mode )); - src_v = crtc->mode.vdisplay; + src_v = crtc->legacy.mode.vdisplay; dst_v = amdgpu_crtc->native_mode.vdisplay; - src_h = crtc->mode.hdisplay; + src_h = crtc->legacy.mode.hdisplay; dst_h = amdgpu_crtc->native_mode.hdisplay;/* fix up for overscan on hdmi */
@@ -1486,10 +1486,10 @@ bool amdgpu_display_crtc_scaling_mode_fixup(struct drm_crtc *crtc,else amdgpu_crtc->v_border = (mode->vdisplay >>5 ) +16 ; amdgpu_crtc->rmx_type =RMX_FULL ; - src_v = crtc->mode.vdisplay; - dst_v = crtc->mode.vdisplay - (amdgpu_crtc->v_border *2 ); - src_h = crtc->mode.hdisplay; - dst_h = crtc->mode.hdisplay - (amdgpu_crtc->h_border *2 ); + src_v = crtc->legacy.mode.vdisplay; + dst_v = crtc->legacy.mode.vdisplay - (amdgpu_crtc->v_border *2 ); + src_h = crtc->legacy.mode.hdisplay; + dst_h = crtc->legacy.mode.hdisplay - (amdgpu_crtc->h_border *2 ); } }if (amdgpu_crtc->rmx_type !=RMX_OFF ) {
drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c +1 -1
@@ -348,7 +348,7 @@ int amdgpu_pll_get_shared_nondp_ppll(struct drm_crtc *crtc) }/* for non-DP check the clock */ test_adjusted_clock = test_amdgpu_crtc->adjusted_clock; -if ((crtc->mode.clock == test_crtc->mode.clock) && +if ((crtc->legacy.mode.clock == test_crtc->legacy.mode.clock) && (adjusted_clock == test_adjusted_clock) && (amdgpu_crtc->ss_enabled == test_amdgpu_crtc->ss_enabled) && (test_amdgpu_crtc->pll_id !=ATOM_PPLL_INVALID ))
drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c +1 -1
@@ -70,7 +70,7 @@ static int amdgpu_vkms_enable_vblank(struct drm_crtc *crtc)struct amdgpu_vkms_output *out =drm_crtc_to_amdgpu_vkms_output (crtc);struct amdgpu_crtc *amdgpu_crtc =to_amdgpu_crtc (crtc); -drm_calc_timestamping_constants (crtc, &crtc->mode); +drm_calc_timestamping_constants (crtc, &crtc->legacy.mode); out->period_ns =ktime_set (0 , vblank->framedur_ns);hrtimer_start (&amdgpu_crtc->vblank_timer, out->period_ns,HRTIMER_MODE_REL );
drivers/gpu/drm/amd/amdgpu/dce_v10_0.c +12 -11
@@ -605,7 +605,7 @@ static u32 dce_v10_0_line_buffer_adjust(struct amdgpu_device *adev,* than 4096, you need use to use 2 display controllers and combine * them using the stereo blender. */ -if (amdgpu_crtc->base.enabled && mode) { +if (amdgpu_crtc->base.legacy.enabled && mode) {if (mode->crtc_hdisplay <1920 ) { mem_cfg =1 ; buffer_alloc =2 ;
@@ -640,7 +640,7 @@ static u32 dce_v10_0_line_buffer_adjust(struct amdgpu_device *adev,udelay (1 ); } -if (amdgpu_crtc->base.enabled && mode) { +if (amdgpu_crtc->base.legacy.enabled && mode) {switch (mem_cfg) {case 0 :default :
@@ -1027,14 +1027,14 @@ static void dce_v10_0_program_watermarks(struct amdgpu_device *adev,struct amdgpu_crtc *amdgpu_crtc, u32 lb_size, u32 num_heads) { - struct drm_display_mode *mode = &amdgpu_crtc->base.mode; + struct drm_display_mode *mode = &amdgpu_crtc->base.legacy.mode;struct dce10_wm_params wm_low, wm_high;u32 active_time;u32 line_time =0 ;u32 latency_watermark_a =0 , latency_watermark_b =0 ;u32 tmp, wm_mask, lb_vblank_lead_lines =0 ; - if (amdgpu_crtc->base.enabled && num_heads && mode) { + if (amdgpu_crtc->base.legacy.enabled && num_heads && mode) { active_time = (u32) div_u64((u64)mode->crtc_hdisplay * 1000000, (u32)mode->clock); line_time = (u32) div_u64((u64)mode->crtc_htotal * 1000000,
@@ -1164,11 +1164,11 @@ static void dce_v10_0_bandwidth_update(struct amdgpu_device *adev)amdgpu_display_update_priority (adev);for (i =0 ; i < adev->mode_info.num_crtc; i++) { -if (adev->mode_info.crtcs[i]->base.enabled) +if (adev->mode_info.crtcs[i]->base.legacy.enabled) num_heads++; }for (i =0 ; i < adev->mode_info.num_crtc; i++) { - mode = &adev->mode_info.crtcs[i]->base.mode; + mode = &adev->mode_info.crtcs[i]->base.legacy.mode; lb_size =dce_v10_0_line_buffer_adjust (adev, adev->mode_info.crtcs[i], mode);dce_v10_0_program_watermarks (adev, adev->mode_info.crtcs[i], lb_size, num_heads);
@@ -2066,8 +2066,8 @@ static int dce_v10_0_crtc_do_set_base(struct drm_crtc *crtc, y &= ~1 ;WREG32 (mmVIEWPORT_START + amdgpu_crtc->crtc_offset, (x <<16 ) | y); - viewport_w = crtc->mode.hdisplay; - viewport_h = (crtc->mode.vdisplay +1 ) & ~1 ; + viewport_w = crtc->legacy.mode.hdisplay; + viewport_h = (crtc->legacy.mode.vdisplay +1 ) & ~1 ;WREG32 (mmVIEWPORT_SIZE + amdgpu_crtc->crtc_offset, (viewport_w <<16 ) | viewport_h);
@@ -2330,9 +2330,10 @@ static int dce_v10_0_cursor_move_locked(struct drm_crtc *crtc, amdgpu_crtc->cursor_y = y;/* avivo cursor are offset into the total surface */ - x += crtc->x; - y += crtc->y; -DRM_DEBUG ("x %d y %d c->x %d c->y %d\n" , x, y, crtc->x, crtc->y); + x += crtc->legacy.x; + y += crtc->legacy.y; +DRM_DEBUG ("x %d y %d c->x %d c->y %d\n" , x, y, crtc->legacy.x, + crtc->legacy.y);if (x <0 ) { xorigin =min (-x, amdgpu_crtc->max_cursor_width -1 );
drivers/gpu/drm/amd/amdgpu/dce_v11_0.c +12 -11
@@ -637,7 +637,7 @@ static u32 dce_v11_0_line_buffer_adjust(struct amdgpu_device *adev,* than 4096, you need use to use 2 display controllers and combine * them using the stereo blender. */ -if (amdgpu_crtc->base.enabled && mode) { +if (amdgpu_crtc->base.legacy.enabled && mode) {if (mode->crtc_hdisplay <1920 ) { mem_cfg =1 ; buffer_alloc =2 ;
@@ -672,7 +672,7 @@ static u32 dce_v11_0_line_buffer_adjust(struct amdgpu_device *adev,udelay (1 ); } -if (amdgpu_crtc->base.enabled && mode) { +if (amdgpu_crtc->base.legacy.enabled && mode) {switch (mem_cfg) {case 0 :default :
@@ -1059,14 +1059,14 @@ static void dce_v11_0_program_watermarks(struct amdgpu_device *adev,struct amdgpu_crtc *amdgpu_crtc, u32 lb_size, u32 num_heads) { - struct drm_display_mode *mode = &amdgpu_crtc->base.mode; + struct drm_display_mode *mode = &amdgpu_crtc->base.legacy.mode;struct dce10_wm_params wm_low, wm_high;u32 active_time;u32 line_time =0 ;u32 latency_watermark_a =0 , latency_watermark_b =0 ;u32 tmp, wm_mask, lb_vblank_lead_lines =0 ; - if (amdgpu_crtc->base.enabled && num_heads && mode) { + if (amdgpu_crtc->base.legacy.enabled && num_heads && mode) { active_time = (u32) div_u64((u64)mode->crtc_hdisplay * 1000000, (u32)mode->clock); line_time = (u32) div_u64((u64)mode->crtc_htotal * 1000000,
@@ -1196,11 +1196,11 @@ static void dce_v11_0_bandwidth_update(struct amdgpu_device *adev)amdgpu_display_update_priority (adev);for (i =0 ; i < adev->mode_info.num_crtc; i++) { -if (adev->mode_info.crtcs[i]->base.enabled) +if (adev->mode_info.crtcs[i]->base.legacy.enabled) num_heads++; }for (i =0 ; i < adev->mode_info.num_crtc; i++) { - mode = &adev->mode_info.crtcs[i]->base.mode; + mode = &adev->mode_info.crtcs[i]->base.legacy.mode; lb_size =dce_v11_0_line_buffer_adjust (adev, adev->mode_info.crtcs[i], mode);dce_v11_0_program_watermarks (adev, adev->mode_info.crtcs[i], lb_size, num_heads);
@@ -2116,8 +2116,8 @@ static int dce_v11_0_crtc_do_set_base(struct drm_crtc *crtc, y &= ~1 ;WREG32 (mmVIEWPORT_START + amdgpu_crtc->crtc_offset, (x <<16 ) | y); - viewport_w = crtc->mode.hdisplay; - viewport_h = (crtc->mode.vdisplay +1 ) & ~1 ; + viewport_w = crtc->legacy.mode.hdisplay; + viewport_h = (crtc->legacy.mode.vdisplay +1 ) & ~1 ;WREG32 (mmVIEWPORT_SIZE + amdgpu_crtc->crtc_offset, (viewport_w <<16 ) | viewport_h);
@@ -2414,9 +2414,10 @@ static int dce_v11_0_cursor_move_locked(struct drm_crtc *crtc, amdgpu_crtc->cursor_y = y;/* avivo cursor are offset into the total surface */ - x += crtc->x; - y += crtc->y; -DRM_DEBUG ("x %d y %d c->x %d c->y %d\n" , x, y, crtc->x, crtc->y); + x += crtc->legacy.x; + y += crtc->legacy.y; +DRM_DEBUG ("x %d y %d c->x %d c->y %d\n" , x, y, crtc->legacy.x, + crtc->legacy.y);if (x <0 ) { xorigin =min (-x, amdgpu_crtc->max_cursor_width -1 );
drivers/gpu/drm/amd/amdgpu/dce_v6_0.c +13 -12
@@ -845,7 +845,7 @@ static void dce_v6_0_program_watermarks(struct amdgpu_device *adev,struct amdgpu_crtc *amdgpu_crtc, u32 lb_size, u32 num_heads) { - struct drm_display_mode *mode = &amdgpu_crtc->base.mode; + struct drm_display_mode *mode = &amdgpu_crtc->base.legacy.mode;struct dce6_wm_params wm_low, wm_high;u32 dram_channels;u32 active_time;
@@ -857,7 +857,7 @@ static void dce_v6_0_program_watermarks(struct amdgpu_device *adev,u32 tmp, arb_control3, lb_vblank_lead_lines =0 ;fixed20_12 a, b, c; -if (amdgpu_crtc->base.enabled && num_heads && mode) { +if (amdgpu_crtc->base.legacy.enabled && num_heads && mode) { active_time = (u32 )div_u64 ((u64 )mode->crtc_hdisplay *1000000 , (u32 )mode->clock); line_time = (u32) div_u64((u64)mode->crtc_htotal * 1000000,
@@ -1026,7 +1026,7 @@ static u32 dce_v6_0_line_buffer_adjust(struct amdgpu_device *adev,* of crtcs. Ideally for multiple large displays we'd assign them to * non-linked crtcs for maximum line buffer allocation. */ -if (amdgpu_crtc->base.enabled && mode) { +if (amdgpu_crtc->base.legacy.enabled && mode) {if (other_mode) { tmp =0 ;/* 1/2 */ buffer_alloc =1 ;
@@ -1051,7 +1051,7 @@ static u32 dce_v6_0_line_buffer_adjust(struct amdgpu_device *adev,udelay (1 ); } -if (amdgpu_crtc->base.enabled && mode) { +if (amdgpu_crtc->base.legacy.enabled && mode) {switch (tmp) {case 0 :default :
@@ -1087,12 +1087,12 @@ static void dce_v6_0_bandwidth_update(struct amdgpu_device *adev)amdgpu_display_update_priority (adev);for (i =0 ; i < adev->mode_info.num_crtc; i++) { -if (adev->mode_info.crtcs[i]->base.enabled) +if (adev->mode_info.crtcs[i]->base.legacy.enabled) num_heads++; }for (i =0 ; i < adev->mode_info.num_crtc; i +=2 ) { - mode0 = &adev->mode_info.crtcs[i]->base.mode; - mode1 = &adev->mode_info.crtcs[i+1 ]->base.mode; + mode0 = &adev->mode_info.crtcs[i]->base.legacy.mode; + mode1 = &adev->mode_info.crtcs[i+1 ]->base.legacy.mode; lb_size =dce_v6_0_line_buffer_adjust (adev, adev->mode_info.crtcs[i], mode0, mode1);dce_v6_0_program_watermarks (adev, adev->mode_info.crtcs[i], lb_size, num_heads); lb_size =dce_v6_0_line_buffer_adjust (adev, adev->mode_info.crtcs[i+1 ], mode1, mode0);
@@ -2023,8 +2023,8 @@ static int dce_v6_0_crtc_do_set_base(struct drm_crtc *crtc, y &= ~1 ;WREG32 (mmVIEWPORT_START + amdgpu_crtc->crtc_offset, (x <<16 ) | y); - viewport_w = crtc->mode.hdisplay; - viewport_h = (crtc->mode.vdisplay +1 ) & ~1 ; + viewport_w = crtc->legacy.mode.hdisplay; + viewport_h = (crtc->legacy.mode.vdisplay +1 ) & ~1 ;WREG32 (mmVIEWPORT_SIZE + amdgpu_crtc->crtc_offset, (viewport_w <<16 ) | viewport_h);
@@ -2250,9 +2250,10 @@ static int dce_v6_0_cursor_move_locked(struct drm_crtc *crtc, amdgpu_crtc->cursor_y = y;/* avivo cursor are offset into the total surface */ - x += crtc->x; - y += crtc->y; -DRM_DEBUG ("x %d y %d c->x %d c->y %d\n" , x, y, crtc->x, crtc->y); + x += crtc->legacy.x; + y += crtc->legacy.y; +DRM_DEBUG ("x %d y %d c->x %d c->y %d\n" , x, y, crtc->legacy.x, + crtc->legacy.y);if (x <0 ) { xorigin =min (-x, amdgpu_crtc->max_cursor_width -1 );
drivers/gpu/drm/amd/amdgpu/dce_v8_0.c +12 -11
@@ -560,7 +560,7 @@ static u32 dce_v8_0_line_buffer_adjust(struct amdgpu_device *adev,* than 4096, you need use to use 2 display controllers and combine * them using the stereo blender. */ -if (amdgpu_crtc->base.enabled && mode) { +if (amdgpu_crtc->base.legacy.enabled && mode) {if (mode->crtc_hdisplay <1920 ) { tmp =1 ; buffer_alloc =2 ;
@@ -593,7 +593,7 @@ static u32 dce_v8_0_line_buffer_adjust(struct amdgpu_device *adev,udelay (1 ); } -if (amdgpu_crtc->base.enabled && mode) { +if (amdgpu_crtc->base.legacy.enabled && mode) {switch (tmp) {case 0 :default :
@@ -980,14 +980,14 @@ static void dce_v8_0_program_watermarks(struct amdgpu_device *adev,struct amdgpu_crtc *amdgpu_crtc, u32 lb_size, u32 num_heads) { - struct drm_display_mode *mode = &amdgpu_crtc->base.mode; + struct drm_display_mode *mode = &amdgpu_crtc->base.legacy.mode;struct dce8_wm_params wm_low, wm_high;u32 active_time;u32 line_time =0 ;u32 latency_watermark_a =0 , latency_watermark_b =0 ;u32 tmp, wm_mask, lb_vblank_lead_lines =0 ; - if (amdgpu_crtc->base.enabled && num_heads && mode) { + if (amdgpu_crtc->base.legacy.enabled && num_heads && mode) { active_time = (u32) div_u64((u64)mode->crtc_hdisplay * 1000000, (u32)mode->clock); line_time = (u32) div_u64((u64)mode->crtc_htotal * 1000000,
@@ -1119,11 +1119,11 @@ static void dce_v8_0_bandwidth_update(struct amdgpu_device *adev)amdgpu_display_update_priority (adev);for (i =0 ; i < adev->mode_info.num_crtc; i++) { -if (adev->mode_info.crtcs[i]->base.enabled) +if (adev->mode_info.crtcs[i]->base.legacy.enabled) num_heads++; }for (i =0 ; i < adev->mode_info.num_crtc; i++) { - mode = &adev->mode_info.crtcs[i]->base.mode; + mode = &adev->mode_info.crtcs[i]->base.legacy.mode; lb_size =dce_v8_0_line_buffer_adjust (adev, adev->mode_info.crtcs[i], mode);dce_v8_0_program_watermarks (adev, adev->mode_info.crtcs[i], lb_size, num_heads);
@@ -1993,8 +1993,8 @@ static int dce_v8_0_crtc_do_set_base(struct drm_crtc *crtc, y &= ~1 ;WREG32 (mmVIEWPORT_START + amdgpu_crtc->crtc_offset, (x <<16 ) | y); - viewport_w = crtc->mode.hdisplay; - viewport_h = (crtc->mode.vdisplay +1 ) & ~1 ; + viewport_w = crtc->legacy.mode.hdisplay; + viewport_h = (crtc->legacy.mode.vdisplay +1 ) & ~1 ;WREG32 (mmVIEWPORT_SIZE + amdgpu_crtc->crtc_offset, (viewport_w <<16 ) | viewport_h);
@@ -2249,9 +2249,10 @@ static int dce_v8_0_cursor_move_locked(struct drm_crtc *crtc, amdgpu_crtc->cursor_y = y;/* avivo cursor are offset into the total surface */ - x += crtc->x; - y += crtc->y; -DRM_DEBUG ("x %d y %d c->x %d c->y %d\n" , x, y, crtc->x, crtc->y); + x += crtc->legacy.x; + y += crtc->legacy.y; +DRM_DEBUG ("x %d y %d c->x %d c->y %d\n" , x, y, crtc->legacy.x, + crtc->legacy.y);if (x <0 ) { xorigin =min (-x, amdgpu_crtc->max_cursor_width -1 );
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +7 -7
@@ -8498,8 +8498,8 @@ static bool is_content_protection_different(struct drm_crtc_state *new_crtc_stat* * Handles: DESIRED -> DESIRED (Special case) */ -if (!(old_conn_state->crtc && old_conn_state->crtc->enabled) && - new_conn_state->crtc && new_conn_state->crtc->enabled && +if (!(old_conn_state->crtc && old_conn_state->crtc->legacy.enabled) && + new_conn_state->crtc && new_conn_state->crtc->legacy.enabled && connector->state->content_protection ==DRM_MODE_CONTENT_PROTECTION_DESIRED ) { dm_con_state->update_hdcp = false; pr_debug("[HDCP_DM] DESIRED->DESIRED (Stream removed and re-enabled) %s :true\n",
@@ -9635,10 +9635,10 @@ static void dm_set_writeback(struct amdgpu_display_manager *dm, wb_info->dwb_params.cnv_params.cnv_out_bpc =DWB_CNV_OUT_BPC_10BPC ;/* width & height from crtc */ - wb_info->dwb_params.cnv_params.src_width = acrtc->base.mode.crtc_hdisplay; - wb_info->dwb_params.cnv_params.src_height = acrtc->base.mode.crtc_vdisplay; - wb_info->dwb_params.dest_width = acrtc->base.mode.crtc_hdisplay; - wb_info->dwb_params.dest_height = acrtc->base.mode.crtc_vdisplay; + wb_info->dwb_params.cnv_params.src_width = acrtc->base.legacy.mode.crtc_hdisplay; + wb_info->dwb_params.cnv_params.src_height = acrtc->base.legacy.mode.crtc_vdisplay; + wb_info->dwb_params.dest_width = acrtc->base.legacy.mode.crtc_hdisplay; + wb_info->dwb_params.dest_height = acrtc->base.legacy.mode.crtc_vdisplay; wb_info->dwb_params.cnv_params.crop_en = false; wb_info->dwb_params.stereo_params.stereo_enabled = false;
@@ -9880,7 +9880,7 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) stream_update.stream = dm_new_crtc_state->stream;if (scaling_changed) { -update_stream_scaling_settings (&dm_new_con_state->base.crtc->mode, +update_stream_scaling_settings (&dm_new_con_state->base.crtc->legacy.mode, dm_new_con_state, dm_new_crtc_state->stream); stream_update.src = dm_new_crtc_state->stream->src;
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c +1 -1
@@ -721,7 +721,7 @@ int amdgpu_dm_crtc_init(struct amdgpu_display_manager *dm, acrtc->max_cursor_height = dm->adev->dm.dc->caps.max_cursor_size; acrtc->crtc_id = crtc_index; - acrtc->base.enabled = false; + acrtc->base.legacy.enabled = false; acrtc->otg_inst =-1 ; dm->adev->mode_info.crtcs[crtc_index] = acrtc;
drivers/gpu/drm/amd/pm/amdgpu_dpm_internal.c +2 -2
@@ -58,7 +58,7 @@ u32 amdgpu_dpm_get_vblank_time(struct amdgpu_device *adev)if (adev->mode_info.num_crtc && adev->mode_info.mode_config_initialized) {list_for_each_entry (crtc, &dev->mode_config.crtc_list, head) { amdgpu_crtc =to_amdgpu_crtc (crtc); -if (crtc->enabled && amdgpu_crtc->enabled && amdgpu_crtc->hw_mode.clock) { +if (crtc->legacy.enabled && amdgpu_crtc->enabled && amdgpu_crtc->hw_mode.clock) { vblank_in_pixels = amdgpu_crtc->hw_mode.crtc_htotal * (amdgpu_crtc->hw_mode.crtc_vblank_end -
@@ -84,7 +84,7 @@ u32 amdgpu_dpm_get_vrefresh(struct amdgpu_device *adev)if (adev->mode_info.num_crtc && adev->mode_info.mode_config_initialized) {list_for_each_entry (crtc, &dev->mode_config.crtc_list, head) { amdgpu_crtc =to_amdgpu_crtc (crtc); -if (crtc->enabled && amdgpu_crtc->enabled && amdgpu_crtc->hw_mode.clock) { +if (crtc->legacy.enabled && amdgpu_crtc->enabled && amdgpu_crtc->hw_mode.clock) { vrefresh =drm_mode_vrefresh (&amdgpu_crtc->hw_mode);break ; }
drivers/gpu/drm/arm/hdlcd_drv.c +1 -1
@@ -211,7 +211,7 @@ static int hdlcd_show_pxlclock(struct seq_file *m, void *arg)struct drm_device *drm = entry->dev;struct hdlcd_drm_private *hdlcd =drm_to_hdlcd_priv (drm);unsigned long clkrate =clk_get_rate (hdlcd->clk); -unsigned long mode_clock = hdlcd->crtc.mode.crtc_clock *1000 ; +unsigned long mode_clock = hdlcd->crtc.legacy.mode.crtc_clock *1000 ;seq_printf (m,"hw : %lu\n" , clkrate);seq_printf (m,"mode: %lu\n" , mode_clock);
drivers/gpu/drm/arm/malidp_hw.c +1 -1
@@ -1209,7 +1209,7 @@ static irqreturn_t malidp_de_irq(int irq, void *arg) mask =malidp_hw_read (hwdev,MALIDP_REG_MASKIRQ );/* keep the status of the enabled interrupts, plus the error bits */ status &= (mask | de->err_mask); -if ((status & de->vsync_irq) && malidp->crtc.enabled) +if ((status & de->vsync_irq) && malidp->crtc.legacy.enabled)drm_crtc_handle_vblank (&malidp->crtc);#ifdef CONFIG_DEBUG_FS
drivers/gpu/drm/armada/armada_crtc.c +8 -4
@@ -613,10 +613,12 @@ static int armada_drm_crtc_cursor_update(struct armada_crtc *dcrtc, bool reload) xoff = -dcrtc->cursor_x; xscr =0 ; w -=min (xoff, w); - }else if (dcrtc->cursor_x + w > dcrtc->crtc.mode.hdisplay) { + }else if (dcrtc->cursor_x + w > dcrtc->crtc.legacy.mode.hdisplay) { xoff =0 ; xscr = dcrtc->cursor_x; - w =max_t (int, dcrtc->crtc.mode.hdisplay - dcrtc->cursor_x,0 ); + w =max_t (int, + dcrtc->crtc.legacy.mode.hdisplay - dcrtc->cursor_x, +0 ); }else { xoff =0 ; xscr = dcrtc->cursor_x;
@@ -626,10 +628,12 @@ static int armada_drm_crtc_cursor_update(struct armada_crtc *dcrtc, bool reload) yoff = -dcrtc->cursor_y; yscr =0 ; h -=min (yoff, h); - }else if (dcrtc->cursor_y + h > dcrtc->crtc.mode.vdisplay) { + }else if (dcrtc->cursor_y + h > dcrtc->crtc.legacy.mode.vdisplay) { yoff =0 ; yscr = dcrtc->cursor_y; - h =max_t (int, dcrtc->crtc.mode.vdisplay - dcrtc->cursor_y,0 ); + h =max_t (int, + dcrtc->crtc.legacy.mode.vdisplay - dcrtc->cursor_y, +0 ); }else { yoff =0 ; yscr = dcrtc->cursor_y;
drivers/gpu/drm/ast/ast_dp.c +4 -4
@@ -230,7 +230,7 @@ static void ast_dp_set_mode(struct drm_crtc *crtc, struct ast_vbios_mode_info *v ulRefreshRateIndex = vbios_mode->enh_table->refresh_rate_index -1 ; -switch (crtc->mode.crtc_hdisplay) { +switch (crtc->legacy.mode.crtc_hdisplay) {case 320 : ModeIdx = ASTDP_320x240_60;break ;
@@ -253,7 +253,7 @@ static void ast_dp_set_mode(struct drm_crtc *crtc, struct ast_vbios_mode_info *v ModeIdx = ASTDP_1152x864_75;break ;case 1280 : -if (crtc->mode.crtc_vdisplay ==800 ) +if (crtc->legacy.mode.crtc_vdisplay ==800 ) ModeIdx = (ASTDP_1280x800_60_RB - (u8 ) ulRefreshRateIndex);else // 1024 ModeIdx = (ASTDP_1280x1024_60 + (u8 ) ulRefreshRateIndex);
@@ -266,7 +266,7 @@ static void ast_dp_set_mode(struct drm_crtc *crtc, struct ast_vbios_mode_info *v ModeIdx = (ASTDP_1440x900_60_RB - (u8 ) ulRefreshRateIndex);break ;case 1600 : -if (crtc->mode.crtc_vdisplay ==900 ) +if (crtc->legacy.mode.crtc_vdisplay ==900 ) ModeIdx = (ASTDP_1600x900_60_RB - (u8 ) ulRefreshRateIndex);else //1200 ModeIdx = ASTDP_1600x1200_60;
@@ -275,7 +275,7 @@ static void ast_dp_set_mode(struct drm_crtc *crtc, struct ast_vbios_mode_info *v ModeIdx = (ASTDP_1680x1050_60_RB - (u8 ) ulRefreshRateIndex);break ;case 1920 : -if (crtc->mode.crtc_vdisplay ==1080 ) +if (crtc->legacy.mode.crtc_vdisplay ==1080 ) ModeIdx = ASTDP_1920x1080_60;else //1200 ModeIdx = ASTDP_1920x1200_60;
drivers/gpu/drm/drm_atomic_helper.c +4 -4
@@ -1301,15 +1301,15 @@ drm_atomic_helper_update_legacy_modeset_state(struct drm_device *dev,struct drm_plane *primary = crtc->primary;struct drm_plane_state *new_plane_state; - crtc->mode = new_crtc_state->mode; - crtc->enabled = new_crtc_state->enable; + crtc->legacy.mode = new_crtc_state->mode; + crtc->legacy.enabled = new_crtc_state->enable; new_plane_state =drm_atomic_get_new_plane_state (old_state, primary);if (new_plane_state && new_plane_state->crtc == crtc) { - crtc->x = new_plane_state->src_x >>16 ; - crtc->y = new_plane_state->src_y >>16 ; + crtc->legacy.x = new_plane_state->src_x >>16 ; + crtc->legacy.y = new_plane_state->src_y >>16 ; } } }
drivers/gpu/drm/drm_client_modeset.c +5 -5
@@ -703,17 +703,17 @@ static bool drm_client_firmware_config(struct drm_client_dev *client,/* * IMPORTANT: We want to use the adjusted mode (i.e. * after the panel fitter upscaling) as the initial -* config, not the input mode, which is what crtc->mode +* config, not the input mode, which is what crtc->legacy.mode * usually contains. But since our current * code puts a mode derived from the post-pfit timings -* into crtc->mode this works out correctly. +* into crtc->legacy.mode this works out correctly. * -* This is crtc->mode and not crtc->state->mode for the +* This is crtc->legacy.mode and not crtc->state->mode for the * fastboot check to work correctly. */ drm_dbg_kms (dev,"[CONNECTOR:%d:%s] looking for current mode\n" , connector->base.id, connector->name); - modes[i] = &connector->state->crtc->mode; + modes[i] = &connector->state->crtc->legacy.mode; }/* * In case of tiled modes, if all tiles are not present
@@ -1213,7 +1213,7 @@ static void drm_client_modeset_dpms_legacy(struct drm_client_dev *client, int dpDRM_MODESET_LOCK_ALL_BEGIN (dev, ctx,0 , ret);drm_client_for_each_modeset (modeset, client) { -if (!modeset->crtc->enabled) +if (!modeset->crtc->legacy.enabled)continue ;for (j =0 ; j < modeset->num_connectors; j++) {
drivers/gpu/drm/drm_crtc.c +5 -4
@@ -564,11 +564,12 @@ int drm_mode_getcrtc(struct drm_device *dev, crtc_resp->mode_valid =0 ; } }else { - crtc_resp->x = crtc->x; - crtc_resp->y = crtc->y; + crtc_resp->x = crtc->legacy.x; + crtc_resp->y = crtc->legacy.y; -if (crtc->enabled) { -drm_mode_convert_to_umode (&crtc_resp->mode, &crtc->mode); +if (crtc->legacy.enabled) { +drm_mode_convert_to_umode (&crtc_resp->mode, + &crtc->legacy.mode); crtc_resp->mode_valid =1 ; }else {
drivers/gpu/drm/drm_crtc_helper.c +32 -30
133 lines not on this page · raw message
drivers/gpu/drm/drm_fb_helper.c +6 -4
@@ -145,7 +145,7 @@ int drm_fb_helper_debug_enter(struct fb_info *info)list_for_each_entry (helper, &kernel_fb_helper_list, kernel_fb_list) {mutex_lock (&helper->client.modeset_mutex);drm_client_for_each_modeset (mode_set, &helper->client) { -if (!mode_set->crtc->enabled) +if (!mode_set->crtc->legacy.enabled)continue ; funcs = mode_set->crtc->helper_private;
@@ -191,7 +191,7 @@ int drm_fb_helper_debug_leave(struct fb_info *info) funcs = crtc->helper_private; fb = crtc->primary->legacy.fb; -if (!crtc->enabled) +if (!crtc->legacy.enabled)continue ;if (!fb) {
@@ -203,8 +203,10 @@ int drm_fb_helper_debug_leave(struct fb_info *info)continue ;drm_fb_helper_restore_lut_atomic (mode_set->crtc); - funcs->mode_set_base_atomic (mode_set->crtc, fb, crtc->x, - crtc->y,LEAVE_ATOMIC_MODE_SET ); + funcs->mode_set_base_atomic (mode_set->crtc, fb, + crtc->legacy.x, + crtc->legacy.y, +LEAVE_ATOMIC_MODE_SET ); }mutex_unlock (&client->modeset_mutex);
drivers/gpu/drm/drm_plane.c +3 -2
@@ -1467,8 +1467,9 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev, state->src_h, fb); }else { - ret =drm_crtc_check_viewport (crtc, crtc->x, crtc->y, - &crtc->mode, fb); + ret =drm_crtc_check_viewport (crtc, crtc->legacy.x, + crtc->legacy.y, + &crtc->legacy.mode, fb); }if (ret) goto out;
drivers/gpu/drm/drm_plane_helper.c +3 -3
@@ -119,8 +119,8 @@ static int drm_plane_helper_check_update(struct drm_plane *plane, };struct drm_crtc_state crtc_state = { .crtc = crtc, - .enable = crtc->enabled, - .mode = crtc->mode, + .enable = crtc->legacy.enabled, + .mode = crtc->legacy.mode, };int ret;
@@ -172,7 +172,7 @@ int drm_plane_helper_update_primary(struct drm_plane *plane, struct drm_crtc *crstruct drm_mode_set set = { .crtc = crtc, .fb = fb, - .mode = &crtc->mode, + .mode = &crtc->legacy.mode, .x = src_x >>16 , .y = src_y >>16 , };
drivers/gpu/drm/drm_vblank.c +1 -1
@@ -2042,7 +2042,7 @@ int drm_crtc_get_sequence_ioctl(struct drm_device *dev, void *data,if (crtc->state) get_seq->active = crtc->state->enable;else - get_seq->active = crtc->enabled; + get_seq->active = crtc->legacy.enabled;drm_modeset_unlock (&crtc->mutex); get_seq->sequence =drm_vblank_count_and_time (dev, pipe, &now); get_seq->sequence_ns =ktime_to_ns (now);
drivers/gpu/drm/exynos/exynos5433_drm_decon.c +2 -2
@@ -196,7 +196,7 @@ static void decon_setup_trigger(struct decon_context *ctx)static void decon_commit (struct exynos_drm_crtc *crtc) {struct decon_context *ctx = crtc->ctx; -struct drm_display_mode *m = &crtc->base.mode; +struct drm_display_mode *m = &crtc->base.legacy.mode;bool interlaced = false;u32 val;
@@ -410,7 +410,7 @@ static void decon_update_plane(struct exynos_drm_crtc *crtc,dma_addr_t dma_addr =exynos_drm_fb_dma_addr (fb,0 );u32 val; -if (crtc->base.mode.flags &DRM_MODE_FLAG_INTERLACE ) { +if (crtc->base.legacy.mode.flags &DRM_MODE_FLAG_INTERLACE ) { val =COORDINATE_X (state->crtc.x) |COORDINATE_Y (state->crtc.y /2 );writel (val, ctx->addr +DECON_VIDOSDxA (win));
drivers/gpu/drm/gma500/cdv_intel_dp.c +2 -2
@@ -1847,8 +1847,8 @@ cdv_intel_dp_set_property(struct drm_connector *connector, done:if (encoder->base.crtc) {struct drm_crtc *crtc = encoder->base.crtc; -drm_crtc_helper_set_mode (crtc, &crtc->mode, - crtc->x, crtc->y, +drm_crtc_helper_set_mode (crtc, &crtc->legacy.mode, + crtc->legacy.x, crtc->legacy.y, crtc->primary->legacy.fb); }
drivers/gpu/drm/gma500/cdv_intel_hdmi.c +1 -1
@@ -191,7 +191,7 @@ static int cdv_hdmi_set_property(struct drm_connector *connector, crtc->saved_mode.vdisplay != 0) {if (centre) {if (!drm_crtc_helper_set_mode (encoder->crtc, &crtc->saved_mode, - encoder->crtc->x, encoder->crtc->y, + encoder->crtc->legacy.x, encoder->crtc->legacy.y, encoder->crtc->primary->legacy.fb))return -1 ; }else {
drivers/gpu/drm/gma500/cdv_intel_lvds.c +2 -2
@@ -373,8 +373,8 @@ static int cdv_intel_lvds_set_property(struct drm_connector *connector, crtc->saved_mode.vdisplay != 0) {if (!drm_crtc_helper_set_mode (encoder->crtc, &crtc->saved_mode, - encoder->crtc->x, - encoder->crtc->y, + encoder->crtc->legacy.x, + encoder->crtc->legacy.y, encoder->crtc->primary->legacy.fb))return -1 ; }
drivers/gpu/drm/gma500/gma_display.c +5 -3
@@ -152,7 +152,7 @@ void gma_crtc_load_lut(struct drm_crtc *crtc)int i;/* The clocks have to be on to load the palette. */ -if (!crtc->enabled) +if (!crtc->legacy.enabled)return ; r = crtc->gamma_store;
@@ -537,7 +537,8 @@ int gma_crtc_page_flip(struct drm_crtc *crtc,spin_unlock_irqrestore (&dev->event_lock, flags);/* Call this locked if we want an event at vblank interrupt. */ - ret = crtc_funcs->mode_set_base (crtc, crtc->x, crtc->y, old_fb); + ret = crtc_funcs->mode_set_base (crtc, crtc->legacy.x, + crtc->legacy.y, old_fb);if (ret) {spin_lock_irqsave (&dev->event_lock, flags);if (gma_crtc->page_flip_event) {
@@ -547,7 +548,8 @@ int gma_crtc_page_flip(struct drm_crtc *crtc,spin_unlock_irqrestore (&dev->event_lock, flags); } }else { - ret = crtc_funcs->mode_set_base (crtc, crtc->x, crtc->y, old_fb); + ret = crtc_funcs->mode_set_base (crtc, crtc->legacy.x, + crtc->legacy.y, old_fb); }/* Restore previous fb in case of failure. */
drivers/gpu/drm/gma500/psb_intel_lvds.c +2 -2
@@ -568,8 +568,8 @@ int psb_intel_lvds_set_property(struct drm_connector *connector, crtc->saved_mode.vdisplay != 0) {if (!drm_crtc_helper_set_mode (encoder->crtc, &crtc->saved_mode, - encoder->crtc->x, - encoder->crtc->y, + encoder->crtc->legacy.x, + encoder->crtc->legacy.y, encoder->crtc->primary->legacy.fb)) goto set_prop_error; }
drivers/gpu/drm/gma500/psb_intel_sdvo.c +5 -3
@@ -1726,8 +1726,10 @@ psb_intel_sdvo_set_property(struct drm_connector *connector, done:if (psb_intel_sdvo->base.base.crtc) {struct drm_crtc *crtc = psb_intel_sdvo->base.base.crtc; -drm_crtc_helper_set_mode (crtc, &crtc->mode, crtc->x, - crtc->y, crtc->primary->legacy.fb); +drm_crtc_helper_set_mode (crtc, &crtc->legacy.mode, + crtc->legacy.x, + crtc->legacy.y, + crtc->primary->legacy.fb); }return 0 ;
@@ -1755,7 +1757,7 @@ static void psb_intel_sdvo_restore(struct drm_connector *connector)/* Force a full mode set on the crtc. We're supposed to have the mode_config lock already. */ if (connector->status == connector_status_connected) -drm_crtc_helper_set_mode (crtc, &crtc->mode, crtc->x, crtc->y, +drm_crtc_helper_set_mode (crtc, &crtc->legacy.mode, crtc->legacy.x, crtc->legacy.y,NULL ); }
drivers/gpu/drm/i2c/ch7006_drv.c +3 -2
@@ -362,8 +362,9 @@ static int ch7006_encoder_set_property(struct drm_encoder *encoder,drm_helper_probe_single_connector_modes (connector,0 ,0 );if (crtc) -drm_crtc_helper_set_mode (crtc, &crtc->mode, - crtc->x, crtc->y, +drm_crtc_helper_set_mode (crtc, &crtc->legacy.mode, + crtc->legacy.x, + crtc->legacy.y, crtc->primary->legacy.fb); }
drivers/gpu/drm/i2c/sil164_drv.c +1 -1
@@ -219,7 +219,7 @@ sil164_encoder_dpms(struct drm_encoder *encoder, int mode) {struct sil164_priv *priv =to_sil164_priv (encoder);bool on = (mode ==DRM_MODE_DPMS_ON ); -bool duallink = (on && encoder->crtc->mode.clock >165000 ); +bool duallink = (on && encoder->crtc->legacy.mode.clock >165000 );sil164_set_power_state (drm_i2c_encoder_get_client (encoder), on);
drivers/gpu/drm/i915/display/intel_modeset_setup.c +2 -2
@@ -88,7 +88,7 @@ static void intel_crtc_disable_noatomic_begin(struct intel_crtc *crtc, crtc->base.base.id, crtc->base.name); crtc->active = false; - crtc->base.enabled = false; + crtc->base.legacy.enabled = false;if (crtc_state->shared_dpll) intel_unreference_shared_dpll_crtc(crtc,
@@ -725,7 +725,7 @@ static void intel_modeset_readout_hw_state(struct drm_i915_private *i915) crtc_state->hw.enable = crtc_state->hw.active; - crtc->base.enabled = crtc_state->hw.enable; + crtc->base.legacy.enabled = crtc_state->hw.enable; crtc->active = crtc_state->hw.active;if (crtc_state->hw.active)
drivers/gpu/drm/imx/lcdc/imx-lcdc.c +19 -12
@@ -154,24 +154,31 @@ static void imx_lcdc_update_hw_registers(struct drm_simple_display_pipe *pipe,return ;/* Disable PER clock to make register write possible */ -if (old_state && old_state->crtc && old_state->crtc->enabled) +if (old_state && old_state->crtc && old_state->crtc->legacy.enabled)clk_disable_unprepare (lcdc->clk_per);/* Framesize */ - framesize =FIELD_PREP (IMX21LCDC_LSR_XMAX , crtc->mode.hdisplay >>4 ) | -FIELD_PREP (IMX21LCDC_LSR_YMAX , crtc->mode.vdisplay); + framesize =FIELD_PREP (IMX21LCDC_LSR_XMAX , + crtc->legacy.mode.hdisplay >>4 ) | +FIELD_PREP (IMX21LCDC_LSR_YMAX , crtc->legacy.mode.vdisplay);writel (framesize, lcdc->base +IMX21LCDC_LSR );/* HSYNC */ - lhcr =FIELD_PREP (IMX21LCDC_LHCR_HFPORCH , crtc->mode.hsync_start - crtc->mode.hdisplay -1 ) | -FIELD_PREP (IMX21LCDC_LHCR_HWIDTH , crtc->mode.hsync_end - crtc->mode.hsync_start -1 ) | -FIELD_PREP (IMX21LCDC_LHCR_HBPORCH , crtc->mode.htotal - crtc->mode.hsync_end -3 ); + lhcr =FIELD_PREP (IMX21LCDC_LHCR_HFPORCH , + crtc->legacy.mode.hsync_start - crtc->legacy.mode.hdisplay -1 ) | +FIELD_PREP (IMX21LCDC_LHCR_HWIDTH , + crtc->legacy.mode.hsync_end - crtc->legacy.mode.hsync_start -1 ) | +FIELD_PREP (IMX21LCDC_LHCR_HBPORCH , + crtc->legacy.mode.htotal - crtc->legacy.mode.hsync_end -3 );writel (lhcr, lcdc->base +IMX21LCDC_LHCR );/* VSYNC */ - lvcr =FIELD_PREP (IMX21LCDC_LVCR_VFPORCH , crtc->mode.vsync_start - crtc->mode.vdisplay) | -FIELD_PREP (IMX21LCDC_LVCR_VWIDTH , crtc->mode.vsync_end - crtc->mode.vsync_start) | -FIELD_PREP (IMX21LCDC_LVCR_VBPORCH , crtc->mode.vtotal - crtc->mode.vsync_end); + lvcr =FIELD_PREP (IMX21LCDC_LVCR_VFPORCH , + crtc->legacy.mode.vsync_start - crtc->legacy.mode.vdisplay) | +FIELD_PREP (IMX21LCDC_LVCR_VWIDTH , + crtc->legacy.mode.vsync_end - crtc->legacy.mode.vsync_start) | +FIELD_PREP (IMX21LCDC_LVCR_VBPORCH , + crtc->legacy.mode.vtotal - crtc->legacy.mode.vsync_end);writel (lvcr, lcdc->base +IMX21LCDC_LVCR ); lpcr =readl (lcdc->base +IMX21LCDC_LPCR );
@@ -183,7 +190,7 @@ static void imx_lcdc_update_hw_registers(struct drm_simple_display_pipe *pipe,writel (new_state->fb->pitches[0 ] /4 , lcdc->base +IMX21LCDC_LVPWR );/* Enable PER clock */ -if (new_state->crtc->enabled) +if (new_state->crtc->legacy.enabled)clk_prepare_enable (lcdc->clk_per); }
@@ -195,7 +202,7 @@ static void imx_lcdc_pipe_enable(struct drm_simple_display_pipe *pipe,int clk_div;int bpp;struct imx_lcdc *lcdc =imx_lcdc_from_drmdev (pipe->crtc.dev); -struct drm_display_mode *mode = &pipe->crtc.mode; +struct drm_display_mode *mode = &pipe->crtc.legacy.mode;struct drm_display_info *disp_info = &lcdc->connector->display_info;const int hsync_pol = (mode->flags &DRM_MODE_FLAG_PHSYNC ) ?0 :1 ;const int vsync_pol = (mode->flags &DRM_MODE_FLAG_PVSYNC ) ?0 :1 ;
@@ -257,7 +264,7 @@ static void imx_lcdc_pipe_disable(struct drm_simple_display_pipe *pipe)clk_disable_unprepare (lcdc->clk_ahb);clk_disable_unprepare (lcdc->clk_ipg); -if (pipe->crtc.enabled) +if (pipe->crtc.legacy.enabled)clk_disable_unprepare (lcdc->clk_per);spin_lock_irq (&lcdc->drm.event_lock);
drivers/gpu/drm/mediatek/mtk_crtc.c +3 -3
@@ -211,9 +211,9 @@ static void mtk_crtc_mode_set_nofb(struct drm_crtc *crtc) {struct mtk_crtc_state *state =to_mtk_crtc_state (crtc->state); - state->pending_width = crtc->mode.hdisplay; - state->pending_height = crtc->mode.vdisplay; - state->pending_vrefresh =drm_mode_vrefresh (&crtc->mode); + state->pending_width = crtc->legacy.mode.hdisplay; + state->pending_height = crtc->legacy.mode.vdisplay; + state->pending_vrefresh =drm_mode_vrefresh (&crtc->legacy.mode);wmb ();/* Make sure the above parameters are set before update */ state->pending_config = true; }
drivers/gpu/drm/meson/meson_overlay.c +1 -1
@@ -482,7 +482,7 @@ static void meson_overlay_atomic_update(struct drm_plane *plane,DRM_DEBUG_DRIVER ("\n" ); - interlace_mode = new_state->crtc->mode.flags &DRM_MODE_FLAG_INTERLACE ; + interlace_mode = new_state->crtc->legacy.mode.flags &DRM_MODE_FLAG_INTERLACE ;spin_lock_irqsave (&priv->drm->event_lock, flags);
drivers/gpu/drm/meson/meson_plane.c +4 -4
@@ -251,7 +251,7 @@ static void meson_plane_atomic_update(struct drm_plane *plane, hf_bank_len =4 ; vf_bank_len =4 ; -if (new_state->crtc->mode.flags &DRM_MODE_FLAG_INTERLACE ) { +if (new_state->crtc->legacy.mode.flags &DRM_MODE_FLAG_INTERLACE ) { vsc_bot_rcv_num =6 ; vsc_bot_rpt_p0_num =2 ; }
@@ -273,7 +273,7 @@ static void meson_plane_atomic_update(struct drm_plane *plane,* But the vertical scaler can provide such funtionnality if * is configured for 2:1 scaling with interlace options enabled. */ -if (new_state->crtc->mode.flags &DRM_MODE_FLAG_INTERLACE ) { +if (new_state->crtc->legacy.mode.flags &DRM_MODE_FLAG_INTERLACE ) { dest.y1 /=2 ; dest.y2 /=2 ; dst_h /=2 ;
@@ -282,7 +282,7 @@ static void meson_plane_atomic_update(struct drm_plane *plane, hf_phase_step = ((src_w <<18 ) / dst_w) <<6 ; vf_phase_step = (src_h <<20 ) / dst_h; -if (new_state->crtc->mode.flags &DRM_MODE_FLAG_INTERLACE ) +if (new_state->crtc->legacy.mode.flags &DRM_MODE_FLAG_INTERLACE ) bot_ini_phase = ((vf_phase_step /2 ) >>4 );else bot_ini_phase =0 ;
@@ -314,7 +314,7 @@ static void meson_plane_atomic_update(struct drm_plane *plane,VSC_TOP_RPT_L0_NUM (vsc_ini_rpt_p0_num) |VSC_VERTICAL_SCALER_EN ; -if (new_state->crtc->mode.flags &DRM_MODE_FLAG_INTERLACE ) +if (new_state->crtc->legacy.mode.flags &DRM_MODE_FLAG_INTERLACE ) priv->viu.osd_sc_v_ctrl0 |=VSC_BOT_INI_RCV_NUM (vsc_bot_rcv_num) | VSC_BOT_RPT_L0_NUM(vsc_bot_rpt_p0_num) |
drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c +11 -7
@@ -170,7 +170,7 @@ int dpu_core_perf_crtc_check(struct drm_crtc *crtc, curr_client_type =dpu_crtc_get_client_type (crtc);drm_for_each_crtc (tmp_crtc, crtc->dev) { -if (tmp_crtc->enabled && +if (tmp_crtc->legacy.enabled &&dpu_crtc_get_client_type (tmp_crtc) == curr_client_type && tmp_crtc != crtc) { struct dpu_crtc_state *tmp_cstate =
@@ -219,7 +219,7 @@ static int _dpu_core_perf_crtc_update_bus(struct dpu_kms *kms,return 0 ;drm_for_each_crtc (tmp_crtc, crtc->dev) { -if (tmp_crtc->enabled && +if (tmp_crtc->legacy.enabled && curr_client_type ==dpu_crtc_get_client_type (tmp_crtc)) { dpu_cstate =to_dpu_crtc_state (tmp_crtc->state);
@@ -291,7 +291,7 @@ static u64 _dpu_core_perf_get_core_clk_rate(struct dpu_kms *kms) clk_rate =0 ;drm_for_each_crtc (crtc, kms->dev) { -if (crtc->enabled) { +if (crtc->legacy.enabled) { dpu_cstate =to_dpu_crtc_state (crtc->state); clk_rate =max (dpu_cstate->new_perf.core_clk_rate, clk_rate);
@@ -323,12 +323,13 @@ int dpu_core_perf_crtc_update(struct drm_crtc *crtc, dpu_cstate =to_dpu_crtc_state (crtc->state);DRM_DEBUG_ATOMIC ("crtc:%d enabled:%d core_clk:%llu\n" , - crtc->base.id, crtc->enabled, kms->perf.core_clk_rate); + crtc->base.id, crtc->legacy.enabled, + kms->perf.core_clk_rate); old = &dpu_crtc->cur_perf; new = &dpu_cstate->new_perf; -if (crtc->enabled) { +if (crtc->legacy.enabled) {/* * cases for bus bandwidth update. * 1. new bandwidth vote - "ab or ib vote" is higher
@@ -361,7 +362,8 @@ int dpu_core_perf_crtc_update(struct drm_crtc *crtc, }trace_dpu_perf_crtc_update (crtc->base.id, new->bw_ctl, - new->core_clk_rate, !crtc->enabled, update_bus, update_clk); + new->core_clk_rate, !crtc->legacy.enabled, update_bus, + update_clk);if (update_bus) { ret =_dpu_core_perf_crtc_update_bus (kms, crtc);
@@ -381,7 +383,9 @@ int dpu_core_perf_crtc_update(struct drm_crtc *crtc,DRM_DEBUG_ATOMIC ("clk:%llu\n" , clk_rate); -trace_dpu_core_perf_update_clk (kms->dev, !crtc->enabled, clk_rate); +trace_dpu_core_perf_update_clk (kms->dev, + !crtc->legacy.enabled, + clk_rate); clk_rate =min (clk_rate, kms->perf.max_core_clk_rate); ret =dev_pm_opp_set_rate (&kms->pdev->dev, clk_rate);
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +10 -6
@@ -1139,12 +1139,12 @@ static void dpu_plane_sspp_atomic_update(struct drm_plane *plane) &fmt->pixel_format, MSM_FORMAT_IS_UBWC(fmt));dpu_plane_sspp_update_pipe (plane, pipe, pipe_cfg, fmt, -drm_mode_vrefresh (&crtc->mode), +drm_mode_vrefresh (&crtc->legacy.mode), layout_valid ? &layout :NULL );if (r_pipe->sspp) {dpu_plane_sspp_update_pipe (plane, r_pipe, r_pipe_cfg, fmt, -drm_mode_vrefresh (&crtc->mode), +drm_mode_vrefresh (&crtc->legacy.mode), layout_valid ? &layout :NULL ); }
@@ -1152,14 +1152,18 @@ static void dpu_plane_sspp_atomic_update(struct drm_plane *plane) pstate->needs_qos_remap = false; pstate->plane_fetch_bw =_dpu_plane_calc_bw (pdpu->catalog, fmt, - &crtc->mode, pipe_cfg); + &crtc->legacy.mode, + pipe_cfg); - pstate->plane_clk =_dpu_plane_calc_clk (&crtc->mode, pipe_cfg); + pstate->plane_clk =_dpu_plane_calc_clk (&crtc->legacy.mode, pipe_cfg);if (r_pipe->sspp) { - pstate->plane_fetch_bw +=_dpu_plane_calc_bw (pdpu->catalog, fmt, &crtc->mode, r_pipe_cfg); + pstate->plane_fetch_bw +=_dpu_plane_calc_bw (pdpu->catalog, fmt, + &crtc->legacy.mode, + r_pipe_cfg); - pstate->plane_clk =max (pstate->plane_clk,_dpu_plane_calc_clk (&crtc->mode, r_pipe_cfg)); + pstate->plane_clk =max (pstate->plane_clk, +_dpu_plane_calc_clk (&crtc->legacy.mode, r_pipe_cfg)); } }
drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c +2 -2
@@ -842,8 +842,8 @@ static void mdp5_crtc_atomic_flush(struct drm_crtc *crtc,static void get_roi (struct drm_crtc *crtc,uint32_t *roi_w,uint32_t *roi_h) {struct mdp5_crtc *mdp5_crtc =to_mdp5_crtc (crtc); -uint32_t xres = crtc->mode.hdisplay; -uint32_t yres = crtc->mode.vdisplay; +uint32_t xres = crtc->legacy.mode.hdisplay; +uint32_t yres = crtc->legacy.mode.vdisplay;/* * Cursor Region Of Interest (ROI) is a plane read from cursor
drivers/gpu/drm/nouveau/dispnv04/crtc.c +5 -4
@@ -735,7 +735,7 @@ static void nv_crtc_commit(struct drm_crtc *crtc)struct nouveau_crtc *nv_crtc =nouveau_crtc (crtc);nouveau_hw_load_state (dev, nv_crtc->index, &nv04_display (dev)->mode_reg); -nv04_crtc_mode_set_base (crtc, crtc->x, crtc->y,NULL ); +nv04_crtc_mode_set_base (crtc, crtc->legacy.x, crtc->legacy.y,NULL );#ifdef __BIG_ENDIAN/* turn on LFB swapping */
@@ -899,7 +899,8 @@ nv04_crtc_do_mode_set_base(struct drm_crtc *crtc,nv_set_crtc_base (dev, nv_crtc->index, regp->fb_start);/* Update the arbitration parameters. */ -nouveau_calc_arb (dev, crtc->mode.clock, drm_fb->format->cpp[0 ] *8 , +nouveau_calc_arb (dev, crtc->legacy.mode.clock, + drm_fb->format->cpp[0 ] *8 , &arb_burst, &arb_lwm); regp->CRTC[NV_CIO_CRE_FF_INDEX ] = arb_burst;
@@ -1097,8 +1098,8 @@ nv04_flip_complete(struct nvif_event *event, void *argv, u32 argc)if (!nv04_finish_page_flip (chan, &state)) {nv_set_crtc_base (drm->dev,drm_crtc_index (state.crtc), - state.offset + state.crtc->y * - state.pitch + state.crtc->x * + state.offset + state.crtc->legacy.y * + state.pitch + state.crtc->legacy.x * state.bpp /8 ); }
drivers/gpu/drm/nouveau/dispnv04/cursor.c +1 -1
@@ -47,7 +47,7 @@ nv04_cursor_set_offset(struct nouveau_crtc *nv_crtc, uint32_t offset)XLATE (offset,17 ,NV_CIO_CRE_HCUR_ADDR0_ADR ); regp->CRTC[NV_CIO_CRE_HCUR_ADDR1_INDEX ] =XLATE (offset,11 ,NV_CIO_CRE_HCUR_ADDR1_ADR ); -if (crtc->mode.flags &DRM_MODE_FLAG_DBLSCAN ) +if (crtc->legacy.mode.flags &DRM_MODE_FLAG_DBLSCAN ) regp->CRTC[NV_CIO_CRE_HCUR_ADDR1_INDEX ] |=MASK (NV_CIO_CRE_HCUR_ADDR1_CUR_DBL ); regp->CRTC[NV_CIO_CRE_HCUR_ADDR2_INDEX ] = offset >>24 ;
drivers/gpu/drm/nouveau/dispnv04/tvmodesnv17.c +2 -2
@@ -315,7 +315,7 @@ static void tv_setup_filter(struct drm_encoder *encoder) {struct nv17_tv_encoder *tv_enc =to_tv_enc (encoder);struct nv17_tv_norm_params *tv_norm =get_tv_norm (encoder); -struct drm_display_mode *mode = &encoder->crtc->mode; +struct drm_display_mode *mode = &encoder->crtc->legacy.mode;uint32_t (*filters[])[4 ][7 ] = {&tv_enc->state.hfilter, &tv_enc->state.vfilter};int i, j, k;
@@ -544,7 +544,7 @@ void nv17_ctv_update_rescaler(struct drm_encoder *encoder)struct nv17_tv_encoder *tv_enc =to_tv_enc (encoder);int head =nouveau_crtc (encoder->crtc)->index;struct nv04_crtc_reg *regs = &nv04_display (dev)->mode_reg.crtc_reg[head]; -struct drm_display_mode *crtc_mode = &encoder->crtc->mode; +struct drm_display_mode *crtc_mode = &encoder->crtc->legacy.mode;struct drm_display_mode *output_mode = &get_tv_norm (encoder)->ctv_enc_mode.mode;int overscan, hmargin, vmargin, hratio, vratio;
drivers/gpu/drm/nouveau/dispnv04/tvnv17.c +3 -2
@@ -754,8 +754,9 @@ static int nv17_tv_set_property(struct drm_encoder *encoder,/* Disable the crtc to ensure a full modeset is * performed whenever it's turned on again. */ if (crtc) -drm_crtc_helper_set_mode (crtc, &crtc->mode, - crtc->x, crtc->y, +drm_crtc_helper_set_mode (crtc, &crtc->legacy.mode, + crtc->legacy.x, + crtc->legacy.y, crtc->primary->legacy.fb); }
drivers/gpu/drm/nouveau/nouveau_connector.c +3 -3
@@ -807,9 +807,9 @@ nouveau_connector_set_property(struct drm_connector *connector,if (connector->encoder && connector->encoder->crtc) { ret =drm_crtc_helper_set_mode (connector->encoder->crtc, - &connector->encoder->crtc->mode, - connector->encoder->crtc->x, - connector->encoder->crtc->y, + &connector->encoder->crtc->legacy.mode, + connector->encoder->crtc->legacy.x, + connector->encoder->crtc->legacy.y,NULL );if (!ret)return -EINVAL ;
drivers/gpu/drm/qxl/qxl_display.c +3 -3
@@ -337,12 +337,12 @@ static void qxl_crtc_update_monitors_config(struct drm_crtc *crtc, head.surface_id =0 ; oldcount = qdev->monitors_config->count;if (crtc->state->active) { -struct drm_display_mode *mode = &crtc->mode; +struct drm_display_mode *mode = &crtc->legacy.mode; head.width = mode->hdisplay; head.height = mode->vdisplay; - head.x = crtc->x; - head.y = crtc->y; + head.x = crtc->legacy.x; + head.y = crtc->legacy.y;if (qdev->monitors_config->count < i +1 ) qdev->monitors_config->count = i +1 ;if (qdev->primary_bo == qdev->dumb_shadow_bo)
drivers/gpu/drm/radeon/atombios_crtc.c +6 -6
@@ -1426,10 +1426,10 @@ static int dce4_crtc_do_set_base(struct drm_crtc *crtc, y &= ~1 ;WREG32 (EVERGREEN_VIEWPORT_START + radeon_crtc->crtc_offset, (x <<16 ) | y); - viewport_w = crtc->mode.hdisplay; - viewport_h = (crtc->mode.vdisplay +1 ) & ~1 ; + viewport_w = crtc->legacy.mode.hdisplay; + viewport_h = (crtc->legacy.mode.vdisplay +1 ) & ~1 ;if ((rdev->family >=CHIP_BONAIRE ) && - (crtc->mode.flags &DRM_MODE_FLAG_INTERLACE )) + (crtc->legacy.mode.flags &DRM_MODE_FLAG_INTERLACE )) viewport_h *=2 ;WREG32 (EVERGREEN_VIEWPORT_SIZE + radeon_crtc->crtc_offset, (viewport_w <<16 ) | viewport_h);
@@ -1637,8 +1637,8 @@ static int avivo_crtc_do_set_base(struct drm_crtc *crtc, y &= ~1 ;WREG32 (AVIVO_D1MODE_VIEWPORT_START + radeon_crtc->crtc_offset, (x <<16 ) | y); - viewport_w = crtc->mode.hdisplay; - viewport_h = (crtc->mode.vdisplay +1 ) & ~1 ; + viewport_w = crtc->legacy.mode.hdisplay; + viewport_h = (crtc->legacy.mode.vdisplay +1 ) & ~1 ;WREG32 (AVIVO_D1MODE_VIEWPORT_SIZE + radeon_crtc->crtc_offset, (viewport_w <<16 ) | viewport_h);
@@ -1812,7 +1812,7 @@ static int radeon_get_shared_nondp_ppll(struct drm_crtc *crtc) }/* for non-DP check the clock */ test_adjusted_clock = test_radeon_crtc->adjusted_clock; -if ((crtc->mode.clock == test_crtc->mode.clock) && +if ((crtc->legacy.mode.clock == test_crtc->legacy.mode.clock) && (adjusted_clock == test_adjusted_clock) && (radeon_crtc->ss_enabled == test_radeon_crtc->ss_enabled) && (test_radeon_crtc->pll_id !=ATOM_PPLL_INVALID ))
drivers/gpu/drm/radeon/cik.c +6 -6
@@ -8811,7 +8811,7 @@ static u32 dce8_line_buffer_adjust(struct radeon_device *rdev,* than 4096, you need use to use 2 display controllers and combine * them using the stereo blender. */ -if (radeon_crtc->base.enabled && mode) { +if (radeon_crtc->base.legacy.enabled && mode) {if (mode->crtc_hdisplay <1920 ) { tmp =1 ; buffer_alloc =2 ;
@@ -8843,7 +8843,7 @@ static u32 dce8_line_buffer_adjust(struct radeon_device *rdev,udelay (1 ); } -if (radeon_crtc->base.enabled && mode) { +if (radeon_crtc->base.legacy.enabled && mode) {switch (tmp) {case 0 :default :
@@ -9230,14 +9230,14 @@ static void dce8_program_watermarks(struct radeon_device *rdev,struct radeon_crtc *radeon_crtc, u32 lb_size, u32 num_heads) { - struct drm_display_mode *mode = &radeon_crtc->base.mode; + struct drm_display_mode *mode = &radeon_crtc->base.legacy.mode;struct dce8_wm_params wm_low, wm_high;u32 active_time;u32 line_time =0 ;u32 latency_watermark_a =0 , latency_watermark_b =0 ;u32 tmp, wm_mask; - if (radeon_crtc->base.enabled && num_heads && mode) { + if (radeon_crtc->base.legacy.enabled && num_heads && mode) { active_time = (u32) div_u64((u64)mode->crtc_hdisplay * 1000000, (u32)mode->clock); line_time = (u32) div_u64((u64)mode->crtc_htotal * 1000000,
@@ -9374,11 +9374,11 @@ void dce8_bandwidth_update(struct radeon_device *rdev)radeon_update_display_priority (rdev);for (i =0 ; i < rdev->num_crtc; i++) { -if (rdev->mode_info.crtcs[i]->base.enabled) +if (rdev->mode_info.crtcs[i]->base.legacy.enabled) num_heads++; }for (i =0 ; i < rdev->num_crtc; i++) { - mode = &rdev->mode_info.crtcs[i]->base.mode; + mode = &rdev->mode_info.crtcs[i]->base.legacy.mode; lb_size =dce8_line_buffer_adjust (rdev, rdev->mode_info.crtcs[i], mode);dce8_program_watermarks (rdev, rdev->mode_info.crtcs[i], lb_size, num_heads); }
drivers/gpu/drm/radeon/evergreen.c +7 -7
@@ -1851,7 +1851,7 @@ static u32 evergreen_line_buffer_adjust(struct radeon_device *rdev,* of crtcs. Ideally for multiple large displays we'd assign them to * non-linked crtcs for maximum line buffer allocation. */ -if (radeon_crtc->base.enabled && mode) { +if (radeon_crtc->base.legacy.enabled && mode) {if (other_mode) { tmp =0 ;/* 1/2 */ buffer_alloc =1 ;
@@ -1880,7 +1880,7 @@ static u32 evergreen_line_buffer_adjust(struct radeon_device *rdev, } } -if (radeon_crtc->base.enabled && mode) { +if (radeon_crtc->base.legacy.enabled && mode) {switch (tmp) {case 0 :case 4 :
@@ -2156,7 +2156,7 @@ static void evergreen_program_watermarks(struct radeon_device *rdev,struct radeon_crtc *radeon_crtc, u32 lb_size, u32 num_heads) { - struct drm_display_mode *mode = &radeon_crtc->base.mode; + struct drm_display_mode *mode = &radeon_crtc->base.legacy.mode;struct evergreen_wm_params wm_low, wm_high;u32 dram_channels;u32 active_time;
@@ -2169,7 +2169,7 @@ static void evergreen_program_watermarks(struct radeon_device *rdev,u32 tmp, arb_control3;fixed20_12 a, b, c; -if (radeon_crtc->base.enabled && num_heads && mode) { +if (radeon_crtc->base.legacy.enabled && num_heads && mode) { active_time = (u32 )div_u64 ((u64 )mode->crtc_hdisplay *1000000 , (u32 )mode->clock); line_time = (u32) div_u64((u64)mode->crtc_htotal * 1000000,
@@ -2334,12 +2334,12 @@ void evergreen_bandwidth_update(struct radeon_device *rdev)radeon_update_display_priority (rdev);for (i =0 ; i < rdev->num_crtc; i++) { -if (rdev->mode_info.crtcs[i]->base.enabled) +if (rdev->mode_info.crtcs[i]->base.legacy.enabled) num_heads++; }for (i =0 ; i < rdev->num_crtc; i +=2 ) { - mode0 = &rdev->mode_info.crtcs[i]->base.mode; - mode1 = &rdev->mode_info.crtcs[i+1 ]->base.mode; + mode0 = &rdev->mode_info.crtcs[i]->base.legacy.mode; + mode1 = &rdev->mode_info.crtcs[i +1 ]->base.legacy.mode; lb_size =evergreen_line_buffer_adjust (rdev, rdev->mode_info.crtcs[i], mode0, mode1);evergreen_program_watermarks (rdev, rdev->mode_info.crtcs[i], lb_size, num_heads); lb_size =evergreen_line_buffer_adjust (rdev, rdev->mode_info.crtcs[i+1 ], mode1, mode0);
drivers/gpu/drm/radeon/r100.c +5 -5
@@ -1499,7 +1499,7 @@ int r100_cs_packet_parse_vline(struct radeon_cs_parser *p) radeon_crtc =to_radeon_crtc (crtc); crtc_id = radeon_crtc->crtc_id; -if (!crtc->enabled) { +if (!crtc->legacy.enabled) {/* if the CRTC isn't enabled - we need to nop out the wait until */ ib[h_idx +2 ] =PACKET2 (0 ); ib[h_idx +3 ] =PACKET2 (0 );
@@ -3242,19 +3242,19 @@ void r100_bandwidth_update(struct radeon_device *rdev)radeon_update_display_priority (rdev); -if (rdev->mode_info.crtcs[0 ]->base.enabled) { +if (rdev->mode_info.crtcs[0 ]->base.legacy.enabled) {const struct drm_framebuffer *fb = rdev->mode_info.crtcs[0 ]->base.primary->legacy.fb; - mode1 = &rdev->mode_info.crtcs[0 ]->base.mode; + mode1 = &rdev->mode_info.crtcs[0 ]->base.legacy.mode; pixel_bytes1 = fb->format->cpp[0 ]; }if (!(rdev->flags &RADEON_SINGLE_CRTC )) { -if (rdev->mode_info.crtcs[1 ]->base.enabled) { +if (rdev->mode_info.crtcs[1 ]->base.legacy.enabled) {const struct drm_framebuffer *fb = rdev->mode_info.crtcs[1 ]->base.primary->legacy.fb; - mode2 = &rdev->mode_info.crtcs[1 ]->base.mode; + mode2 = &rdev->mode_info.crtcs[1 ]->base.legacy.mode; pixel_bytes2 = fb->format->cpp[0 ]; } }
drivers/gpu/drm/radeon/r600_cs.c +1 -1
@@ -892,7 +892,7 @@ int r600_cs_common_vline_parse(struct radeon_cs_parser *p, radeon_crtc =to_radeon_crtc (crtc); crtc_id = radeon_crtc->crtc_id; -if (!crtc->enabled) { +if (!crtc->legacy.enabled) {/* CRTC isn't enabled - we need to nop out the WAIT_REG_MEM */ ib[h_idx +2 ] =PACKET2 (0 ); ib[h_idx +3 ] =PACKET2 (0 );
drivers/gpu/drm/radeon/r600_dpm.c +2 -2
@@ -162,7 +162,7 @@ u32 r600_dpm_get_vblank_time(struct radeon_device *rdev)if (rdev->num_crtc && rdev->mode_info.mode_config_initialized) {list_for_each_entry (crtc, &dev->mode_config.crtc_list, head) { radeon_crtc =to_radeon_crtc (crtc); -if (crtc->enabled && radeon_crtc->enabled && radeon_crtc->hw_mode.clock) { +if (crtc->legacy.enabled && radeon_crtc->enabled && radeon_crtc->hw_mode.clock) { vblank_in_pixels = radeon_crtc->hw_mode.crtc_htotal * (radeon_crtc->hw_mode.crtc_vblank_end -
@@ -188,7 +188,7 @@ u32 r600_dpm_get_vrefresh(struct radeon_device *rdev)if (rdev->num_crtc && rdev->mode_info.mode_config_initialized) {list_for_each_entry (crtc, &dev->mode_config.crtc_list, head) { radeon_crtc =to_radeon_crtc (crtc); -if (crtc->enabled && radeon_crtc->enabled && radeon_crtc->hw_mode.clock) { +if (crtc->legacy.enabled && radeon_crtc->enabled && radeon_crtc->hw_mode.clock) { vrefresh =drm_mode_vrefresh (&radeon_crtc->hw_mode);break ; }
drivers/gpu/drm/radeon/radeon_connectors.c +3 -3
@@ -90,9 +90,9 @@ static void radeon_property_change_mode(struct drm_encoder *encoder) {struct drm_crtc *crtc = encoder->crtc; -if (crtc && crtc->enabled) { -drm_crtc_helper_set_mode (crtc, &crtc->mode, - crtc->x, crtc->y, +if (crtc && crtc->legacy.enabled) { +drm_crtc_helper_set_mode (crtc, &crtc->legacy.mode, + crtc->legacy.x, crtc->legacy.y, crtc->primary->legacy.fb); } }
drivers/gpu/drm/radeon/radeon_cursor.c +15 -14
@@ -153,8 +153,8 @@ static int radeon_cursor_move_locked(struct drm_crtc *crtc, int x, int y)if (ASIC_IS_AVIVO (rdev)) {/* avivo cursor are offset into the total surface */ - x += crtc->x; - y += crtc->y; + x += crtc->legacy.x; + y += crtc->legacy.y; }if (x <0 )
@@ -163,10 +163,11 @@ static int radeon_cursor_move_locked(struct drm_crtc *crtc, int x, int y) yorigin =min (-y, radeon_crtc->max_cursor_height -1 );if (!ASIC_IS_AVIVO (rdev)) { - x += crtc->x; - y += crtc->y; + x += crtc->legacy.x; + y += crtc->legacy.y; } -DRM_DEBUG ("x %d y %d c->x %d c->y %d\n" , x, y, crtc->x, crtc->y); +DRM_DEBUG ("x %d y %d c->x %d c->y %d\n" , x, y, crtc->legacy.x, + crtc->legacy.y);/* fixed on DCE6 and newer */ if (ASIC_IS_AVIVO (rdev) && !ASIC_IS_DCE6 (rdev)) {
@@ -177,20 +178,20 @@ static int radeon_cursor_move_locked(struct drm_crtc *crtc, int x, int y)* avivo cursor image can't end on 128 pixel boundary or * go past the end of the frame if both crtcs are enabled * -* NOTE: It is safe to access crtc->enabled of other crtcs +* NOTE: It is safe to access crtc->legacy.enabled of other crtcs * without holding either the mode_config lock or the other * crtc's lock as long as write access to this flag _always_ * grabs all locks. */ list_for_each_entry (crtc_p, &crtc->dev->mode_config.crtc_list, head) { -if (crtc_p->enabled) +if (crtc_p->legacy.enabled) i++; }if (i >1 ) {int cursor_end, frame_end; cursor_end = x + w; - frame_end = crtc->x + crtc->mode.crtc_hdisplay; + frame_end = crtc->legacy.x + crtc->legacy.mode.crtc_hdisplay;if (cursor_end >= frame_end) { w = w - (cursor_end - frame_end);if (!(frame_end &0x7f ))
@@ -206,9 +207,9 @@ static int radeon_cursor_move_locked(struct drm_crtc *crtc, int x, int y) } } -if (x <= (crtc->x - w) || y <= (crtc->y - radeon_crtc->cursor_height) || - x >= (crtc->x + crtc->mode.hdisplay) || - y >= (crtc->y + crtc->mode.vdisplay)) +if (x <= (crtc->legacy.x - w) || y <= (crtc->legacy.y - radeon_crtc->cursor_height) || + x >= (crtc->legacy.x + crtc->legacy.mode.hdisplay) || + y >= (crtc->legacy.y + crtc->legacy.mode.vdisplay)) goto out_of_bounds; x += xorigin;
@@ -225,10 +226,10 @@ static int radeon_cursor_move_locked(struct drm_crtc *crtc, int x, int y)WREG32 (AVIVO_D1CUR_SIZE + radeon_crtc->crtc_offset, ((w -1 ) <<16 ) | (radeon_crtc->cursor_height -1 )); }else { - x -= crtc->x; - y -= crtc->y; + x -= crtc->legacy.x; + y -= crtc->legacy.y; -if (crtc->mode.flags &DRM_MODE_FLAG_DBLSCAN ) +if (crtc->legacy.mode.flags &DRM_MODE_FLAG_DBLSCAN ) y *=2 ; WREG32(RADEON_CUR_HORZ_VERT_OFF + radeon_crtc->crtc_offset,
drivers/gpu/drm/radeon/radeon_display.c +11 -11
@@ -223,7 +223,7 @@ void radeon_crtc_load_lut(struct drm_crtc *crtc)struct drm_device *dev = crtc->dev;struct radeon_device *rdev = dev->dev_private; -if (!crtc->enabled) +if (!crtc->legacy.enabled)return ;if (ASIC_IS_DCE5 (rdev))
@@ -553,11 +553,11 @@ static int radeon_crtc_page_flip_target(struct drm_crtc *crtc, base &= ~0x7ff ; }else {int byteshift = fb->format->cpp[0 ] *8 >>4 ; -int tile_addr = (((crtc->y >>3 ) * pitch_pixels + crtc->x) >> (8 - byteshift)) <<11 ; - base += tile_addr + ((crtc->x << byteshift) %256 ) + ((crtc->y %8 ) <<8 ); +int tile_addr = (((crtc->legacy.y >>3 ) * pitch_pixels + crtc->legacy.x) >> (8 - byteshift)) <<11 ; + base += tile_addr + ((crtc->legacy.x << byteshift) %256 ) + ((crtc->legacy.y %8 ) <<8 ); } }else { -int offset = crtc->y * pitch_pixels + crtc->x; +int offset = crtc->legacy.y * pitch_pixels + crtc->legacy.x;switch (fb->format->cpp[0 ] *8 ) {case 8 :default :
@@ -641,7 +641,7 @@ radeon_crtc_set_config(struct drm_mode_set *set, ret =drm_crtc_helper_set_config (set, ctx);list_for_each_entry (crtc, &dev->mode_config.crtc_list, head) -if (crtc->enabled) +if (crtc->legacy.enabled) active = true;pm_runtime_mark_last_busy (dev->dev);
@@ -1712,9 +1712,9 @@ bool radeon_crtc_scaling_mode_fixup(struct drm_crtc *crtc,memcpy (&radeon_crtc->native_mode, &radeon_encoder->native_mode,sizeof (struct drm_display_mode )); - src_v = crtc->mode.vdisplay; + src_v = crtc->legacy.mode.vdisplay; dst_v = radeon_crtc->native_mode.vdisplay; - src_h = crtc->mode.hdisplay; + src_h = crtc->legacy.mode.hdisplay; dst_h = radeon_crtc->native_mode.hdisplay;/* fix up for overscan on hdmi */
@@ -1733,10 +1733,10 @@ bool radeon_crtc_scaling_mode_fixup(struct drm_crtc *crtc,else radeon_crtc->v_border = (mode->vdisplay >>5 ) +16 ; radeon_crtc->rmx_type =RMX_FULL ; - src_v = crtc->mode.vdisplay; - dst_v = crtc->mode.vdisplay - (radeon_crtc->v_border *2 ); - src_h = crtc->mode.hdisplay; - dst_h = crtc->mode.hdisplay - (radeon_crtc->h_border *2 ); + src_v = crtc->legacy.mode.vdisplay; + dst_v = crtc->legacy.mode.vdisplay - (radeon_crtc->v_border *2 ); + src_h = crtc->legacy.mode.hdisplay; + dst_h = crtc->legacy.mode.hdisplay - (radeon_crtc->h_border *2 ); } first = false; }else {
drivers/gpu/drm/radeon/radeon_drv.c +1 -1
@@ -472,7 +472,7 @@ static int radeon_pmops_runtime_idle(struct device *dev) }list_for_each_entry (crtc, &drm_dev->mode_config.crtc_list, head) { -if (crtc->enabled) { +if (crtc->legacy.enabled) {DRM_DEBUG_DRIVER ("failing to power off - crtc active\n" );return -EBUSY ; }
drivers/gpu/drm/radeon/radeon_legacy_crtc.c +1 -1
@@ -1080,7 +1080,7 @@ static void radeon_crtc_commit(struct drm_crtc *crtc)* Reenable the CRTCs that should be running. */ list_for_each_entry (crtci, &dev->mode_config.crtc_list, head) { -if (crtci->enabled) +if (crtci->legacy.enabled)radeon_crtc_dpms (crtci,DRM_MODE_DPMS_ON ); } }
drivers/gpu/drm/radeon/radeon_legacy_encoders.c +1 -1
@@ -1538,7 +1538,7 @@ static enum drm_connector_status radeon_legacy_tv_dac_detect(struct drm_encoder/* find out if crtc2 is in use or if this encoder is using it */ list_for_each_entry (crtc, &dev->mode_config.crtc_list, head) {struct radeon_crtc *radeon_crtc =to_radeon_crtc (crtc); -if ((radeon_crtc->crtc_id ==1 ) && crtc->enabled) { +if ((radeon_crtc->crtc_id ==1 ) && crtc->legacy.enabled) {if (encoder->crtc != crtc) {return connector_status_disconnected; }
drivers/gpu/drm/radeon/radeon_pm.c +1 -1
@@ -1783,7 +1783,7 @@ static void radeon_pm_compute_clocks_dpm(struct radeon_device *rdev)list_for_each_entry (crtc, &ddev->mode_config.crtc_list, head) { radeon_crtc =to_radeon_crtc (crtc); -if (crtc->enabled) { +if (crtc->legacy.enabled) { rdev->pm.dpm.new_active_crtcs |= (1 << radeon_crtc->crtc_id); rdev->pm.dpm.new_active_crtc_count++;if (!radeon_crtc->connector)
drivers/gpu/drm/radeon/rs600.c +4 -4
@@ -908,10 +908,10 @@ void rs600_bandwidth_update(struct radeon_device *rdev)radeon_update_display_priority (rdev); -if (rdev->mode_info.crtcs[0 ]->base.enabled) - mode0 = &rdev->mode_info.crtcs[0 ]->base.mode; -if (rdev->mode_info.crtcs[1 ]->base.enabled) - mode1 = &rdev->mode_info.crtcs[1 ]->base.mode; +if (rdev->mode_info.crtcs[0 ]->base.legacy.enabled) + mode0 = &rdev->mode_info.crtcs[0 ]->base.legacy.mode; +if (rdev->mode_info.crtcs[1 ]->base.legacy.enabled) + mode1 = &rdev->mode_info.crtcs[1 ]->base.legacy.mode;rs690_line_buffer_adjust (rdev, mode0, mode1);
drivers/gpu/drm/radeon/rs690.c +11 -11
@@ -274,14 +274,14 @@ static void rs690_crtc_bandwidth_compute(struct radeon_device *rdev, struct rs690_watermark *wm, bool low) { -struct drm_display_mode *mode = &crtc->base.mode; +struct drm_display_mode *mode = &crtc->base.legacy.mode;fixed20_12 a, b, c;fixed20_12 pclk, request_fifo_depth, tolerable_latency, estimated_width;fixed20_12 consumption_time, line_time, chunk_time, read_delay_latency;fixed20_12 sclk, core_bandwidth, max_bandwidth;u32 selected_sclk; -if (!crtc->base.enabled) { +if (!crtc->base.legacy.enabled) {/* FIXME: wouldn't it better to set priority mark to maximum */ wm->lb_request_fifo_depth =4 ;return ;
@@ -348,7 +348,7 @@ static void rs690_crtc_bandwidth_compute(struct radeon_device *rdev,* LineTime = total number of horizontal pixels * pclk = pixel clock period(ns) */ - a.full =dfixed_const (crtc->base.mode.crtc_htotal); + a.full =dfixed_const (crtc->base.legacy.mode.crtc_htotal); line_time.full =dfixed_mul (a, pclk);/* Determine active time
@@ -356,8 +356,8 @@ static void rs690_crtc_bandwidth_compute(struct radeon_device *rdev,* hactive = total number of horizontal active pixels * htotal = total number of horizontal pixels */ - a.full =dfixed_const (crtc->base.mode.crtc_htotal); - b.full =dfixed_const (crtc->base.mode.crtc_hdisplay); + a.full =dfixed_const (crtc->base.legacy.mode.crtc_htotal); + b.full =dfixed_const (crtc->base.legacy.mode.crtc_hdisplay); wm->active_time.full =dfixed_mul (line_time, b); wm->active_time.full =dfixed_div (wm->active_time, a);
@@ -440,14 +440,14 @@ static void rs690_crtc_bandwidth_compute(struct radeon_device *rdev,* width = viewport width in pixels */ a.full =dfixed_const (16 ); - wm->priority_mark_max.full =dfixed_const (crtc->base.mode.crtc_hdisplay); + wm->priority_mark_max.full =dfixed_const (crtc->base.legacy.mode.crtc_hdisplay); wm->priority_mark_max.full =dfixed_div (wm->priority_mark_max, a); wm->priority_mark_max.full =dfixed_ceil (wm->priority_mark_max);/* Determine estimated width */ estimated_width.full = tolerable_latency.full - wm->worst_case_latency.full; estimated_width.full =dfixed_div (estimated_width, consumption_time); -if (dfixed_trunc (estimated_width) > crtc->base.mode.crtc_hdisplay) { +if (dfixed_trunc (estimated_width) > crtc->base.legacy.mode.crtc_hdisplay) { wm->priority_mark.full =dfixed_const (10 ); }else { a.full =dfixed_const (16 );
@@ -596,10 +596,10 @@ void rs690_bandwidth_update(struct radeon_device *rdev)radeon_update_display_priority (rdev); -if (rdev->mode_info.crtcs[0 ]->base.enabled) - mode0 = &rdev->mode_info.crtcs[0 ]->base.mode; -if (rdev->mode_info.crtcs[1 ]->base.enabled) - mode1 = &rdev->mode_info.crtcs[1 ]->base.mode; +if (rdev->mode_info.crtcs[0 ]->base.legacy.enabled) + mode0 = &rdev->mode_info.crtcs[0 ]->base.legacy.mode; +if (rdev->mode_info.crtcs[1 ]->base.legacy.enabled) + mode1 = &rdev->mode_info.crtcs[1 ]->base.legacy.mode;/* * Set display0/1 priority up in the memory controller for * modes if the user specifies HIGH for displaypriority
drivers/gpu/drm/radeon/rs780_dpm.c +3 -3
@@ -60,11 +60,11 @@ static void rs780_get_pm_mode_parameters(struct radeon_device *rdev)for (i =0 ; i < rdev->num_crtc; i++) { crtc = (struct drm_crtc *)minfo->crtcs[i]; -if (crtc && crtc->enabled) { +if (crtc && crtc->legacy.enabled) { radeon_crtc =to_radeon_crtc (crtc); pi->crtc_id = radeon_crtc->crtc_id; -if (crtc->mode.htotal && crtc->mode.vtotal) - pi->refresh_rate =drm_mode_vrefresh (&crtc->mode); +if (crtc->legacy.mode.htotal && crtc->legacy.mode.vtotal) + pi->refresh_rate =drm_mode_vrefresh (&crtc->legacy.mode);break ; } }
drivers/gpu/drm/radeon/rv515.c +15 -15
@@ -925,14 +925,14 @@ static void rv515_crtc_bandwidth_compute(struct radeon_device *rdev, struct rv515_watermark *wm, bool low) { -struct drm_display_mode *mode = &crtc->base.mode; +struct drm_display_mode *mode = &crtc->base.legacy.mode;fixed20_12 a, b, c;fixed20_12 pclk, request_fifo_depth, tolerable_latency, estimated_width;fixed20_12 consumption_time, line_time, chunk_time, read_delay_latency;fixed20_12 sclk;u32 selected_sclk; -if (!crtc->base.enabled) { +if (!crtc->base.legacy.enabled) {/* FIXME: wouldn't it better to set priority mark to maximum */ wm->lb_request_fifo_depth =4 ;return ;
@@ -996,7 +996,7 @@ static void rv515_crtc_bandwidth_compute(struct radeon_device *rdev,* LineTime = total number of horizontal pixels * pclk = pixel clock period(ns) */ - a.full =dfixed_const (crtc->base.mode.crtc_htotal); + a.full =dfixed_const (crtc->base.legacy.mode.crtc_htotal); line_time.full =dfixed_mul (a, pclk);/* Determine active time
@@ -1004,8 +1004,8 @@ static void rv515_crtc_bandwidth_compute(struct radeon_device *rdev,* hactive = total number of horizontal active pixels * htotal = total number of horizontal pixels */ - a.full =dfixed_const (crtc->base.mode.crtc_htotal); - b.full =dfixed_const (crtc->base.mode.crtc_hdisplay); + a.full =dfixed_const (crtc->base.legacy.mode.crtc_htotal); + b.full =dfixed_const (crtc->base.legacy.mode.crtc_hdisplay); wm->active_time.full =dfixed_mul (line_time, b); wm->active_time.full =dfixed_div (wm->active_time, a);
@@ -1059,14 +1059,14 @@ static void rv515_crtc_bandwidth_compute(struct radeon_device *rdev,* width = viewport width in pixels */ a.full =dfixed_const (16 ); - wm->priority_mark_max.full =dfixed_const (crtc->base.mode.crtc_hdisplay); + wm->priority_mark_max.full =dfixed_const (crtc->base.legacy.mode.crtc_hdisplay); wm->priority_mark_max.full =dfixed_div (wm->priority_mark_max, a); wm->priority_mark_max.full =dfixed_ceil (wm->priority_mark_max);/* Determine estimated width */ estimated_width.full = tolerable_latency.full - wm->worst_case_latency.full; estimated_width.full =dfixed_div (estimated_width, consumption_time); -if (dfixed_trunc (estimated_width) > crtc->base.mode.crtc_hdisplay) { +if (dfixed_trunc (estimated_width) > crtc->base.legacy.mode.crtc_hdisplay) { wm->priority_mark.full = wm->priority_mark_max.full; }else { a.full =dfixed_const (16 );
@@ -1210,10 +1210,10 @@ void rv515_bandwidth_avivo_update(struct radeon_device *rdev)u32 d1mode_priority_a_cnt, d1mode_priority_b_cnt;u32 d2mode_priority_a_cnt, d2mode_priority_b_cnt; -if (rdev->mode_info.crtcs[0 ]->base.enabled) - mode0 = &rdev->mode_info.crtcs[0 ]->base.mode; -if (rdev->mode_info.crtcs[1 ]->base.enabled) - mode1 = &rdev->mode_info.crtcs[1 ]->base.mode; +if (rdev->mode_info.crtcs[0 ]->base.legacy.enabled) + mode0 = &rdev->mode_info.crtcs[0 ]->base.legacy.mode; +if (rdev->mode_info.crtcs[1 ]->base.legacy.enabled) + mode1 = &rdev->mode_info.crtcs[1 ]->base.legacy.mode;rs690_line_buffer_adjust (rdev, mode0, mode1);rv515_crtc_bandwidth_compute (rdev, rdev->mode_info.crtcs[0 ], &wm0_high, false);
@@ -1252,10 +1252,10 @@ void rv515_bandwidth_update(struct radeon_device *rdev)radeon_update_display_priority (rdev); -if (rdev->mode_info.crtcs[0 ]->base.enabled) - mode0 = &rdev->mode_info.crtcs[0 ]->base.mode; -if (rdev->mode_info.crtcs[1 ]->base.enabled) - mode1 = &rdev->mode_info.crtcs[1 ]->base.mode; +if (rdev->mode_info.crtcs[0 ]->base.legacy.enabled) + mode0 = &rdev->mode_info.crtcs[0 ]->base.legacy.mode; +if (rdev->mode_info.crtcs[1 ]->base.legacy.enabled) + mode1 = &rdev->mode_info.crtcs[1 ]->base.legacy.mode;/* * Set display0/1 priority up in the memory controller for * modes if the user specifies HIGH for displaypriority
drivers/gpu/drm/radeon/si.c +7 -7
@@ -1964,7 +1964,7 @@ static u32 dce6_line_buffer_adjust(struct radeon_device *rdev,* of crtcs. Ideally for multiple large displays we'd assign them to * non-linked crtcs for maximum line buffer allocation. */ -if (radeon_crtc->base.enabled && mode) { +if (radeon_crtc->base.legacy.enabled && mode) {if (other_mode) { tmp =0 ;/* 1/2 */ buffer_alloc =1 ;
@@ -1989,7 +1989,7 @@ static u32 dce6_line_buffer_adjust(struct radeon_device *rdev,udelay (1 ); } -if (radeon_crtc->base.enabled && mode) { +if (radeon_crtc->base.legacy.enabled && mode) {switch (tmp) {case 0 :default :
@@ -2275,7 +2275,7 @@ static void dce6_program_watermarks(struct radeon_device *rdev,struct radeon_crtc *radeon_crtc, u32 lb_size, u32 num_heads) { - struct drm_display_mode *mode = &radeon_crtc->base.mode; + struct drm_display_mode *mode = &radeon_crtc->base.legacy.mode;struct dce6_wm_params wm_low, wm_high;u32 dram_channels;u32 active_time;
@@ -2287,7 +2287,7 @@ static void dce6_program_watermarks(struct radeon_device *rdev,u32 tmp, arb_control3;fixed20_12 a, b, c; -if (radeon_crtc->base.enabled && num_heads && mode) { +if (radeon_crtc->base.legacy.enabled && num_heads && mode) { active_time = (u32 )div_u64 ((u64 )mode->crtc_hdisplay *1000000 , (u32 )mode->clock); line_time = (u32) div_u64((u64)mode->crtc_htotal * 1000000,
@@ -2450,12 +2450,12 @@ void dce6_bandwidth_update(struct radeon_device *rdev)radeon_update_display_priority (rdev);for (i =0 ; i < rdev->num_crtc; i++) { -if (rdev->mode_info.crtcs[i]->base.enabled) +if (rdev->mode_info.crtcs[i]->base.legacy.enabled) num_heads++; }for (i =0 ; i < rdev->num_crtc; i +=2 ) { - mode0 = &rdev->mode_info.crtcs[i]->base.mode; - mode1 = &rdev->mode_info.crtcs[i+1 ]->base.mode; + mode0 = &rdev->mode_info.crtcs[i]->base.legacy.mode; + mode1 = &rdev->mode_info.crtcs[i +1 ]->base.legacy.mode; lb_size =dce6_line_buffer_adjust (rdev, rdev->mode_info.crtcs[i], mode0, mode1);dce6_program_watermarks (rdev, rdev->mode_info.crtcs[i], lb_size, num_heads); lb_size =dce6_line_buffer_adjust (rdev, rdev->mode_info.crtcs[i+1 ], mode1, mode0);
drivers/gpu/drm/renesas/rcar-du/rcar_du_crtc.c +1 -1
@@ -600,7 +600,7 @@ static void rcar_du_crtc_start(struct rcar_du_crtc *rcrtc)* sync mode (with the HSYNC and VSYNC signals configured as outputs and * actively driven). */ - interlaced = rcrtc->crtc.mode.flags &DRM_MODE_FLAG_INTERLACE ; + interlaced = rcrtc->crtc.legacy.mode.flags &DRM_MODE_FLAG_INTERLACE ;rcar_du_crtc_dsysr_clr_set (rcrtc,DSYSR_TVM_MASK |DSYSR_SCM_MASK , (interlaced ?DSYSR_SCM_INT_VIDEO :0 ) |DSYSR_TVM_MASTER );
drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c +1 -1
@@ -112,7 +112,7 @@ static void shmob_drm_crtc_setup_geometry(struct shmob_drm_crtc *scrtc)struct drm_crtc *crtc = &scrtc->base;struct shmob_drm_device *sdev =to_shmob_device (crtc->dev);const struct drm_display_info *info = &sdev->connector->display_info; -const struct drm_display_mode *mode = &crtc->mode; +const struct drm_display_mode *mode = &crtc->legacy.mode;unsigned int i;u32 value;
drivers/gpu/drm/rockchip/rockchip_drm_vop.c +2 -2
@@ -958,8 +958,8 @@ static void vop_plane_atomic_update(struct drm_plane *plane, dsp_info = (drm_rect_height (dest) -1 ) <<16 ; dsp_info |= (drm_rect_width (dest) -1 ) &0xffff ; - dsp_stx = dest->x1 + crtc->mode.htotal - crtc->mode.hsync_start; - dsp_sty = dest->y1 + crtc->mode.vtotal - crtc->mode.vsync_start; + dsp_stx = dest->x1 + crtc->legacy.mode.htotal - crtc->legacy.mode.hsync_start; + dsp_sty = dest->y1 + crtc->legacy.mode.vtotal - crtc->legacy.mode.vsync_start; dsp_st = dsp_sty <<16 | (dsp_stx &0xffff );if (fb->format->char_per_block[0 ])
drivers/gpu/drm/sti/sti_crtc.c +2 -2
@@ -83,9 +83,9 @@ sti_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *mode) goto pix_error; } -sti_vtg_set_config (compo->vtg[mixer->id], &crtc->mode); +sti_vtg_set_config (compo->vtg[mixer->id], &crtc->legacy.mode); -if (sti_mixer_active_video_area (mixer, &crtc->mode)) { +if (sti_mixer_active_video_area (mixer, &crtc->legacy.mode)) {DRM_ERROR ("Can't set active video area\n" ); goto mixer_error; }
drivers/gpu/drm/sti/sti_cursor.c +1 -1
@@ -277,7 +277,7 @@ static void sti_cursor_atomic_update(struct drm_plane *drm_plane,if (!crtc || !fb)return ; - mode = &crtc->mode; + mode = &crtc->legacy.mode; dst_x = newstate->crtc_x; dst_y = newstate->crtc_y;
drivers/gpu/drm/sti/sti_gdp.c +1 -1
@@ -755,7 +755,7 @@ static void sti_gdp_atomic_update(struct drm_plane *drm_plane,clk_prepare_enable (gdp->clk_pix); } - mode = &crtc->mode; + mode = &crtc->legacy.mode; dst_x = newstate->crtc_x; dst_y = newstate->crtc_y; dst_w =clamp_val (newstate->crtc_w,0 , mode->hdisplay - dst_x);
drivers/gpu/drm/sti/sti_hqvdp.c +1 -1
@@ -1150,7 +1150,7 @@ static void sti_hqvdp_atomic_update(struct drm_plane *drm_plane,return ; } - mode = &crtc->mode; + mode = &crtc->legacy.mode; dst_x = newstate->crtc_x; dst_y = newstate->crtc_y; dst_w =clamp_val (newstate->crtc_w,0 , mode->hdisplay - dst_x);
drivers/gpu/drm/sti/sti_tvout.c +3 -3
@@ -633,7 +633,7 @@ static void sti_dvo_encoder_enable(struct drm_encoder *encoder) {struct sti_tvout *tvout =to_sti_tvout (encoder); -tvout_preformatter_set_matrix (tvout, &encoder->crtc->mode); +tvout_preformatter_set_matrix (tvout, &encoder->crtc->legacy.mode);tvout_dvo_start (tvout,sti_crtc_is_main (encoder->crtc)); }
@@ -683,7 +683,7 @@ static void sti_hda_encoder_enable(struct drm_encoder *encoder) {struct sti_tvout *tvout =to_sti_tvout (encoder); -tvout_preformatter_set_matrix (tvout, &encoder->crtc->mode); +tvout_preformatter_set_matrix (tvout, &encoder->crtc->legacy.mode);tvout_hda_start (tvout,sti_crtc_is_main (encoder->crtc)); }
@@ -734,7 +734,7 @@ static void sti_hdmi_encoder_enable(struct drm_encoder *encoder) {struct sti_tvout *tvout =to_sti_tvout (encoder); -tvout_preformatter_set_matrix (tvout, &encoder->crtc->mode); +tvout_preformatter_set_matrix (tvout, &encoder->crtc->legacy.mode);tvout_hdmi_start (tvout,sti_crtc_is_main (encoder->crtc)); }
drivers/gpu/drm/sti/sti_vid.c +1 -1
@@ -140,7 +140,7 @@ void sti_vid_commit(struct sti_vid *vid, struct drm_plane_state *state) {struct drm_crtc *crtc = state->crtc; -struct drm_display_mode *mode = &crtc->mode; +struct drm_display_mode *mode = &crtc->legacy.mode;int dst_x = state->crtc_x;int dst_y = state->crtc_y;int dst_w =clamp_val (state->crtc_w,0 , mode->hdisplay - dst_x);
drivers/gpu/drm/tilcdc/tilcdc_crtc.c +5 -5
@@ -71,10 +71,10 @@ static void set_scanout(struct drm_crtc *crtc, struct drm_framebuffer *fb) gem =drm_fb_dma_get_gem_obj (fb,0 ); start = gem->dma_addr + fb->offsets[0 ] + - crtc->y * fb->pitches[0 ] + - crtc->x * fb->format->cpp[0 ]; + crtc->legacy.y * fb->pitches[0 ] + + crtc->legacy.x * fb->format->cpp[0 ]; - end = start + (crtc->mode.vdisplay * fb->pitches[0 ]); + end = start + (crtc->legacy.mode.vdisplay * fb->pitches[0 ]);/* Write LCDC_DMA_FB_BASE_ADDR_0_REG and LCDC_DMA_FB_CEILING_ADDR_0_REG * with a single insruction, if available. This should make it more
@@ -211,7 +211,7 @@ static void tilcdc_crtc_set_clk(struct drm_crtc *crtc) clkdiv =2 ;/* first try using a standard divider of 2 */ /* mode.clock is in KHz, set_rate wants parameter in Hz */ - pclk_rate = crtc->mode.clock *1000 ; + pclk_rate = crtc->legacy.mode.clock *1000 ; ret =clk_set_rate (priv->clk, pclk_rate * clkdiv); clk_rate =clk_get_rate (priv->clk);
@@ -252,7 +252,7 @@ static void tilcdc_crtc_set_clk(struct drm_crtc *crtc) tilcdc_crtc->lcd_fck_rate = clk_rate;DBG ("lcd_clk=%u, mode clock=%d, div=%u" , - tilcdc_crtc->lcd_fck_rate, crtc->mode.clock, clkdiv); + tilcdc_crtc->lcd_fck_rate, crtc->legacy.mode.clock, clkdiv);/* Configure the LCD clock divisor. */ tilcdc_write(dev, LCDC_CTRL_REG, LCDC_CLK_DIVISOR(clkdiv) |
drivers/gpu/drm/tiny/arcpgu.c +1 -1
@@ -343,7 +343,7 @@ static int arcpgu_show_pxlclock(struct seq_file *m, void *arg)struct drm_device *drm = node->minor->dev;struct arcpgu_drm_private *arcpgu =dev_to_arcpgu (drm);unsigned long clkrate =clk_get_rate (arcpgu->clk); -unsigned long mode_clock = arcpgu->pipe.crtc.mode.crtc_clock *1000 ; +unsigned long mode_clock = arcpgu->pipe.crtc.legacy.mode.crtc_clock *1000 ;seq_printf (m,"hw : %lu\n" , clkrate);seq_printf (m,"mode: %lu\n" , mode_clock);
drivers/gpu/drm/vboxvideo/vbox_mode.c +1 -1
@@ -56,7 +56,7 @@ static void vbox_do_modeset(struct drm_crtc *crtc)* screen is programmed this way, so try to fake it. */ if (vbox_crtc->crtc_id ==0 && fb && - vbox_crtc->fb_offset / pitch <0xffff - crtc->y && + vbox_crtc->fb_offset / pitch <0xffff - crtc->legacy.y && vbox_crtc->fb_offset % (bpp /8 ) ==0 ) {vbox_write_ioport (VBE_DISPI_INDEX_XRES , width);vbox_write_ioport (VBE_DISPI_INDEX_YRES , height);
drivers/gpu/drm/vc4/vc4_dpi.c +1 -1
@@ -134,7 +134,7 @@ static void vc4_dpi_encoder_disable(struct drm_encoder *encoder)static void vc4_dpi_encoder_enable (struct drm_encoder *encoder) {struct drm_device *dev = encoder->dev; -struct drm_display_mode *mode = &encoder->crtc->mode; +struct drm_display_mode *mode = &encoder->crtc->legacy.mode;struct vc4_dpi *dpi =to_vc4_dpi (encoder);struct drm_connector_list_iter conn_iter;struct drm_connector *connector =NULL , *connector_scan;
drivers/gpu/drm/vc4/vc4_plane.c +2 -2
@@ -1342,8 +1342,8 @@ static int vc4_plane_mode_set(struct drm_plane *plane,/* crtc_* are already clipped coordinates. */ covers_screen = vc4_state->crtc_x ==0 && vc4_state->crtc_y ==0 && - vc4_state->crtc_w == state->crtc->mode.hdisplay && - vc4_state->crtc_h == state->crtc->mode.vdisplay; + vc4_state->crtc_w == state->crtc->legacy.mode.hdisplay && + vc4_state->crtc_h == state->crtc->legacy.mode.vdisplay;/* Background fill might be necessary when the plane has per-pixel * alpha content or a non-opaque plane alpha and could blend from the * background or does not cover the entire screen.
drivers/gpu/drm/virtio/virtgpu_display.c +2 -2
@@ -90,8 +90,8 @@ static void virtio_gpu_crtc_mode_set_nofb(struct drm_crtc *crtc)struct virtio_gpu_output *output =drm_crtc_to_virtio_gpu_output (crtc);virtio_gpu_cmd_set_scanout (vgdev, output->index,0 , - crtc->mode.hdisplay, - crtc->mode.vdisplay,0 ,0 ); + crtc->legacy.mode.hdisplay, + crtc->legacy.mode.vdisplay,0 ,0 );virtio_gpu_notify (vgdev); }
drivers/gpu/drm/vkms/vkms_composer.c +2 -2
@@ -187,7 +187,7 @@ static void blend(struct vkms_writeback_job *wb,const struct pixel_argb_u16 background_color = { .a =0xffff }; -size_t crtc_y_limit = crtc_state->base.crtc->mode.vdisplay; +size_t crtc_y_limit = crtc_state->base.crtc->legacy.mode.vdisplay;/* * The planes are composed line-by-line to avoid heavy memory usage. It is a necessary
@@ -270,7 +270,7 @@ static int compose_active_planes(struct vkms_writeback_job *active_wb,if (WARN_ON (check_format_funcs (crtc_state, active_wb)))return -EINVAL ; - line_width = crtc_state->base.crtc->mode.hdisplay; + line_width = crtc_state->base.crtc->legacy.mode.hdisplay; stage_buffer.n_pixels = line_width; output_buffer.n_pixels = line_width;
drivers/gpu/drm/vkms/vkms_crtc.c +1 -1
@@ -64,7 +64,7 @@ static int vkms_enable_vblank(struct drm_crtc *crtc)struct drm_vblank_crtc *vblank =drm_crtc_vblank_crtc (crtc);struct vkms_output *out =drm_crtc_to_vkms_output (crtc); -drm_calc_timestamping_constants (crtc, &crtc->mode); +drm_calc_timestamping_constants (crtc, &crtc->legacy.mode);hrtimer_init (&out->vblank_hrtimer,CLOCK_MONOTONIC ,HRTIMER_MODE_REL ); out->vblank_hrtimer.function = &vkms_vblank_simulate;
drivers/gpu/drm/vkms/vkms_writeback.c +2 -2
@@ -131,8 +131,8 @@ static void vkms_wb_atomic_commit(struct drm_connector *conn,struct drm_connector_state *conn_state = wb_conn->base.state;struct vkms_crtc_state *crtc_state = output->composer_state;struct drm_framebuffer *fb = connector_state->writeback_job->fb; -u16 crtc_height = crtc_state->base.crtc->mode.vdisplay; -u16 crtc_width = crtc_state->base.crtc->mode.hdisplay; +u16 crtc_height = crtc_state->base.crtc->legacy.mode.vdisplay; +u16 crtc_width = crtc_state->base.crtc->legacy.mode.hdisplay;struct vkms_writeback_job *active_wb;struct vkms_frame_info *wb_frame_info;u32 wb_format = fb->format->format;
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +4 -4
@@ -2352,10 +2352,10 @@ int vmw_kms_helper_dirty(struct vmw_private *dev_priv,for (k =0 ; k < num_units; k++) {struct vmw_display_unit *unit = units[k]; -s32 crtc_x = unit->crtc.x; -s32 crtc_y = unit->crtc.y; -s32 crtc_width = unit->crtc.mode.hdisplay; -s32 crtc_height = unit->crtc.mode.vdisplay; +s32 crtc_x = unit->crtc.legacy.x; +s32 crtc_y = unit->crtc.legacy.y; +s32 crtc_width = unit->crtc.legacy.mode.hdisplay; +s32 crtc_height = unit->crtc.legacy.mode.vdisplay;const struct drm_clip_rect *clips_ptr = clips;const struct drm_vmw_rect *vclips_ptr = vclips;
drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c +12 -6
@@ -92,8 +92,10 @@ static int vmw_ldu_commit_list(struct vmw_private *dev_priv)int w =0 , h =0 ;list_for_each_entry (entry, &lds->active, active) { crtc = &entry->base.crtc; - w =max (w, crtc->x + crtc->mode.hdisplay); - h =max (h, crtc->y + crtc->mode.vdisplay); + w =max (w, + crtc->legacy.x + crtc->legacy.mode.hdisplay); + h =max (h, + crtc->legacy.y + crtc->legacy.mode.vdisplay); }if (crtc ==NULL )
@@ -123,10 +125,14 @@ static int vmw_ldu_commit_list(struct vmw_private *dev_priv)vmw_write (dev_priv,SVGA_REG_DISPLAY_ID , i);vmw_write (dev_priv,SVGA_REG_DISPLAY_IS_PRIMARY , !i); -vmw_write (dev_priv,SVGA_REG_DISPLAY_POSITION_X , crtc->x); -vmw_write (dev_priv,SVGA_REG_DISPLAY_POSITION_Y , crtc->y); -vmw_write (dev_priv,SVGA_REG_DISPLAY_WIDTH , crtc->mode.hdisplay); -vmw_write (dev_priv,SVGA_REG_DISPLAY_HEIGHT , crtc->mode.vdisplay); +vmw_write (dev_priv,SVGA_REG_DISPLAY_POSITION_X , + crtc->legacy.x); +vmw_write (dev_priv,SVGA_REG_DISPLAY_POSITION_Y , + crtc->legacy.y); +vmw_write (dev_priv,SVGA_REG_DISPLAY_WIDTH , + crtc->legacy.mode.hdisplay); +vmw_write (dev_priv,SVGA_REG_DISPLAY_HEIGHT , + crtc->legacy.mode.vdisplay); i++; }
drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c +5 -4
@@ -249,10 +249,11 @@ static void vmw_sou_crtc_mode_set_nofb(struct drm_crtc *crtc) x = vmw_conn_state->gui_x; y = vmw_conn_state->gui_y; - ret =vmw_sou_fifo_create (dev_priv, sou, x, y, &crtc->mode); + ret =vmw_sou_fifo_create (dev_priv, sou, x, y, + &crtc->legacy.mode);if (ret)DRM_ERROR ("Failed to define Screen Object %dx%d\n" , - crtc->x, crtc->y); + crtc->legacy.x, crtc->legacy.y); }else { sou->buffer =NULL ;
@@ -993,8 +994,8 @@ static void vmw_sou_surface_fifo_commit(struct vmw_kms_dirty *dirty)struct vmw_kms_sou_surface_dirty *sdirty =container_of (dirty,typeof (*sdirty), base);struct vmw_kms_sou_dirty_cmd *cmd = dirty->cmd; -s32 trans_x = dirty->unit->crtc.x - sdirty->dst_x; -s32 trans_y = dirty->unit->crtc.y - sdirty->dst_y; +s32 trans_x = dirty->unit->crtc.legacy.x - sdirty->dst_x; +s32 trans_y = dirty->unit->crtc.legacy.y - sdirty->dst_y;size_t region_size = dirty->num_hits *sizeof (SVGASignedRect);SVGASignedRect *blit = (SVGASignedRect *) &cmd[1 ];int i;
drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c +2 -2
@@ -406,11 +406,11 @@ static void vmw_stdu_crtc_mode_set_nofb(struct drm_crtc *crtc) y = vmw_conn_state->gui_y;vmw_svga_enable (dev_priv); - ret =vmw_stdu_define_st (dev_priv, stdu, &crtc->mode, x, y); + ret =vmw_stdu_define_st (dev_priv, stdu, &crtc->legacy.mode, x, y);if (ret)DRM_ERROR ("Failed to define Screen Target of size %dx%d\n" , - crtc->x, crtc->y); + crtc->legacy.x, crtc->legacy.y); } static void vmw_stdu_crtc_atomic_disable(struct drm_crtc *crtc,
drivers/gpu/drm/vmwgfx/vmwgfx_vkms.c +1 -1
@@ -288,7 +288,7 @@ vmw_vkms_enable_vblank(struct drm_crtc *crtc)if (!vmw->vkms_enabled)return -EINVAL ; -drm_calc_timestamping_constants (crtc, &crtc->mode); +drm_calc_timestamping_constants (crtc, &crtc->legacy.mode);hrtimer_init (&du->vkms.timer,CLOCK_MONOTONIC ,HRTIMER_MODE_REL ); du->vkms.timer.function = &vmw_vkms_vblank_simulate;
drivers/gpu/drm/xen/xen_drm_front_kms.c +1 -1
@@ -116,7 +116,7 @@ static void display_enable(struct drm_simple_display_pipe *pipe,if (!drm_dev_enter (pipe->crtc.dev, &idx))return ; - ret =xen_drm_front_mode_set (pipeline, crtc->x, crtc->y, + ret =xen_drm_front_mode_set (pipeline, crtc->legacy.x, crtc->legacy.y, fb->width, fb->height, fb->format->cpp[0 ] *8 ,xen_drm_front_fb_to_cookie (fb));
include/drm/drm_crtc.h +39 -36
87 lines not on this page · raw message
Signature · 1 line
2.45.2
Louis Chauvet
maintainerRe: [PATCH 2/2] drm: Move crtc->{x, y, mode, enabled} to legacy sub-structure
Quoted 6 lines · Ville Syrjala
From: Ville Syrjälä <[email protected]>
Atomic drivers shouldn't be using the legacy state stored directly under
drm_crtc. Move that junk into a 'legacy' sub structure to highlight the offenders, of which there are quite a few unfortunately.
Hi,
Do we need to do something particular in an atomic driver except using state content?
I proposed some modifications for VKMS bellow. If you think this is good, I can send a patch to avoid being an offender :-) I just tested it, and it seems to work.
Quoted 8 lines
I'm hoping we could get all these fixed and then declare the legacy state off limits for atomic drivers (which is what did long ago for plane->fb/etc). And maybe eventually turn
crtc->legacyinto a pointer and only allocate it on legacy drivers.TODO: hwmode should probably go there too but it probably
needs a closer look, maybe other stuff too...
[...]
drivers/gpu/drm/vkms/vkms_composer.c static void blend(struct vkms_writeback_job *wb, · line 190
Quoted 10 lines
drivers/gpu/drm/vkms/vkms_composer.c +1
-1@@ -187,7 +187,7 @@ static void blend(struct vkms_writeback_job *wb,const struct pixel_argb_u16 background_color = { .a =0xffff }; -size_t crtc_y_limit = crtc_state->base.crtc->mode.vdisplay; +size_t crtc_y_limit = crtc_state->base.crtc->legacy.mode.vdisplay;
size_t crtc_y_limit = crtc_state->base.mode.vdisplay;
drivers/gpu/drm/vkms/vkms_composer.c static int compose_active_planes(struct vkms_writeback_job *active_wb, · line 273
Quoted 8 lines
drivers/gpu/drm/vkms/vkms_composer.c +1
-1/* * The planes are composed line-by-line to avoid heavy memory usage. It is a necessary @@ -270,7 +270,7 @@ static int compose_active_planes(struct vkms_writeback_job *active_wb,if (WARN_ON (check_format_funcs (crtc_state, active_wb)))return -EINVAL ; - line_width = crtc_state->base.crtc->mode.hdisplay; + line_width = crtc_state->base.crtc->legacy.mode.hdisplay;
line_width = crtc_state->base.mode.hdisplay;
drivers/gpu/drm/vkms/vkms_crtc.c static int vkms_enable_vblank(struct drm_crtc *crtc) · line 67
Quoted 13 lines
drivers/gpu/drm/vkms/vkms_composer.c +0
-0stage_buffer.n_pixels = line_width; output_buffer.n_pixels = line_width;drivers/gpu/drm/vkms/vkms_crtc.c +1
-1@@ -64,7 +64,7 @@ static int vkms_enable_vblank(struct drm_crtc *crtc)struct drm_vblank_crtc *vblank =drm_crtc_vblank_crtc (crtc);struct vkms_output *out =drm_crtc_to_vkms_output (crtc); -drm_calc_timestamping_constants (crtc, &crtc->mode); +drm_calc_timestamping_constants (crtc, &crtc->legacy.mode);
drm_calc_timestamping_constants(crtc, &crtc->state->mode);
Quoted 7 lines
drivers/gpu/drm/vkms/vkms_crtc.c +0
-0hrtimer_init (&out->vblank_hrtimer,CLOCK_MONOTONIC ,HRTIMER_MODE_REL ); out->vblank_hrtimer.function = &vkms_vblank_simulate;drivers/gpu/drm/vkms/vkms_writeback.c +0
-0
drivers/gpu/drm/vkms/vkms_writeback.c static void vkms_wb_atomic_commit(struct drm_connector *conn, · line 135
Quoted 7 lines
drivers/gpu/drm/vkms/vkms_writeback.c +2
-2@@ -131,8 +131,8 @@ static void vkms_wb_atomic_commit(struct drm_connector *conn,struct drm_connector_state *conn_state = wb_conn->base.state;struct vkms_crtc_state *crtc_state = output->composer_state;struct drm_framebuffer *fb = connector_state->writeback_job->fb; -u16 crtc_height = crtc_state->base.crtc->mode.vdisplay; -u16 crtc_width = crtc_state->base.crtc->mode.hdisplay; +u16 crtc_height = crtc_state->base.crtc->legacy.mode.vdisplay; +u16 crtc_width = crtc_state->base.crtc->legacy.mode.hdisplay;
u16 crtc_height = crtc_state->base.mode.vdisplay; u16 crtc_width = crtc_state->base.mode.hdisplay;
Quoted 3 lines
drivers/gpu/drm/vkms/vkms_writeback.c +0
-0struct vkms_writeback_job *active_wb;struct vkms_frame_info *wb_frame_info;u32 wb_format = fb->format->format;
[...]
Signature · 3 lines
Louis Chauvet, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
Re: [PATCH 2/2] drm: Move crtc->{x, y, mode, enabled} to legacy sub-structure
Quoted 63 lines · Louis Chauvet
Quoted 6 lines · Ville Syrjala
From: Ville Syrjälä <[email protected]>
Atomic drivers shouldn't be using the legacy state stored directly under
drm_crtc. Move that junk into a 'legacy' sub structure to highlight the offenders, of which there are quite a few unfortunately.Hi,
Do we need to do something particular in an atomic driver except using state content?
I proposed some modifications for VKMS bellow. If you think this is good, I can send a patch to avoid being an offender :-) I just tested it, and it seems to work.
Quoted 8 lines
I'm hoping we could get all these fixed and then declare the legacy state off limits for atomic drivers (which is what did long ago for plane->fb/etc). And maybe eventually turn
crtc->legacyinto a pointer and only allocate it on legacy drivers.TODO: hwmode should probably go there too but it probably
needs a closer look, maybe other stuff too...[...]
drivers/gpu/drm/vkms/vkms_composer.c static void blend(struct vkms_writeback_job *wb, · line 190
Quoted 10 lines
drivers/gpu/drm/vkms/vkms_composer.c +1
-1@@ -187,7 +187,7 @@ static void blend(struct vkms_writeback_job *wb,const struct pixel_argb_u16 background_color = { .a =0xffff }; -size_t crtc_y_limit = crtc_state->base.crtc->mode.vdisplay; +size_t crtc_y_limit = crtc_state->base.crtc->legacy.mode.vdisplay;size_t crtc_y_limit = crtc_state->base.mode.vdisplay;drivers/gpu/drm/vkms/vkms_composer.c static int compose_active_planes(struct vkms_writeback_job *active_wb, · line 273
Quoted 8 lines
drivers/gpu/drm/vkms/vkms_composer.c +1
-1/* * The planes are composed line-by-line to avoid heavy memory usage. It is a necessary @@ -270,7 +270,7 @@ static int compose_active_planes(struct vkms_writeback_job *active_wb,if (WARN_ON (check_format_funcs (crtc_state, active_wb)))return -EINVAL ; - line_width = crtc_state->base.crtc->mode.hdisplay; + line_width = crtc_state->base.crtc->legacy.mode.hdisplay;line_width = crtc_state->base.mode.hdisplay;Quoted 11 lines
drivers/gpu/drm/vkms/vkms_composer.c +0
-0stage_buffer.n_pixels = line_width; output_buffer.n_pixels = line_width;drivers/gpu/drm/vkms/vkms_crtc.c +0
-0@@ -64,7 +64,7 @@ static int vkms_enable_vblank(struct drm_crtc *crtc)struct drm_vblank_crtc *vblank =drm_crtc_vblank_crtc (crtc);struct vkms_output *out =drm_crtc_to_vkms_output (crtc);
Quoted 4 lines
drivers/gpu/drm/vkms/vkms_crtc.c static int vkms_enable_vblank(struct drm_crtc *crtc) · line 67
Quoted 2 lines
drivers/gpu/drm/vkms/vkms_crtc.c +1
-1-drm_calc_timestamping_constants (crtc, &crtc->mode); +drm_calc_timestamping_constants (crtc, &crtc->legacy.mode);drm_calc_timestamping_constants(crtc, &crtc->state->mode);
This one doesn't look safe. You want to call that during your atomic commit already.
The rest look reasonable.
Quoted 29 lines
Quoted 8 lines
drivers/gpu/drm/vkms/vkms_crtc.c +0
-0hrtimer_init (&out->vblank_hrtimer,CLOCK_MONOTONIC ,HRTIMER_MODE_REL ); out->vblank_hrtimer.function = &vkms_vblank_simulate;drivers/gpu/drm/vkms/vkms_writeback.c +0
-0drivers/gpu/drm/vkms/vkms_writeback.c static void vkms_wb_atomic_commit(struct drm_connector *conn, · line 135
Quoted 7 lines
drivers/gpu/drm/vkms/vkms_writeback.c +2
-2@@ -131,8 +131,8 @@ static void vkms_wb_atomic_commit(struct drm_connector *conn,struct drm_connector_state *conn_state = wb_conn->base.state;struct vkms_crtc_state *crtc_state = output->composer_state;struct drm_framebuffer *fb = connector_state->writeback_job->fb; -u16 crtc_height = crtc_state->base.crtc->mode.vdisplay; -u16 crtc_width = crtc_state->base.crtc->mode.hdisplay; +u16 crtc_height = crtc_state->base.crtc->legacy.mode.vdisplay; +u16 crtc_width = crtc_state->base.crtc->legacy.mode.hdisplay;u16 crtc_height = crtc_state->base.mode.vdisplay; u16 crtc_width = crtc_state->base.mode.hdisplay;Quoted 3 lines
drivers/gpu/drm/vkms/vkms_writeback.c +0
-0struct vkms_writeback_job *active_wb;struct vkms_frame_info *wb_frame_info;u32 wb_format = fb->format->format;[...]
Signature · 3 lines
Louis Chauvet, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
Signature · 2 lines
Ville Syrjälä Intel
Louis Chauvet
maintainerRe: [PATCH 2/2] drm: Move crtc->{x, y, mode, enabled} to legacy sub-structure
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
drivers/gpu/drm/vkms/vkms_crtc.c +0
-0@@ -64,7 +64,7 @@ static int vkms_enable_vblank(struct drm_crtc *crtc)struct drm_vblank_crtc *vblank =drm_crtc_vblank_crtc (crtc);struct vkms_output *out =drm_crtc_to_vkms_output (crtc);
Quoted 8 lines
Quoted 4 lines
drivers/gpu/drm/vkms/vkms_crtc.c static int vkms_enable_vblank(struct drm_crtc *crtc) · line 67
Quoted 2 lines
drivers/gpu/drm/vkms/vkms_crtc.c +1
-1-drm_calc_timestamping_constants (crtc, &crtc->mode); +drm_calc_timestamping_constants (crtc, &crtc->legacy.mode);drm_calc_timestamping_constants(crtc, &crtc->state->mode);This one doesn't look safe. You want to call that during your atomic commit already.
This was already not safe with the previous implementation? Or it is only unsafe because now I use state->mode instead of legacy.mode?
After inspecting the code, I think I don't need to call it as:
In vkms_atomic_commit_tail (used in @vkms_mode_config_helpers.atomic_commit_tail), we call drm_atomic_helper_commit_modeset_disables, which call drm_atomic_helper_calc_timestamping_constants which call drm_calc_timestamping_constants for every CRTC.
I tested kms_vblank, all of them are SUCCESS/SKIP, do you know other tests that can trigger bugs?
Signature · 3 lines
Louis Chauvet, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
Re: [PATCH 2/2] drm: Move crtc->{x, y, mode, enabled} to legacy sub-structure
Quoted 14 lines · Louis Chauvet
Quoted 14 lines
Quoted 13 lines
drivers/gpu/drm/vkms/vkms_crtc.c static int vkms_enable_vblank(struct drm_crtc *crtc) · line 67
Quoted 11 lines
drivers/gpu/drm/vkms/vkms_crtc.c +1
-1@@ -64,7 +64,7 @@ static int vkms_enable_vblank(struct drm_crtc *crtc)struct drm_vblank_crtc *vblank =drm_crtc_vblank_crtc (crtc);struct vkms_output *out =drm_crtc_to_vkms_output (crtc); -drm_calc_timestamping_constants (crtc, &crtc->mode); +drm_calc_timestamping_constants (crtc, &crtc->legacy.mode);drm_calc_timestamping_constants(crtc, &crtc->state->mode);
Quoted 6 lines
Quoted 3 lines
This one doesn't look safe. You want to call that during your atomic commit already.
This was already not safe with the previous implementation? Or it is only unsafe because now I use
state->modeinstead of legacy.mode?
Yeah, if you want to look at obj->state then you need the corresponding lock.
obj->state is also not necessarily the correct state you want because a parallel commit could have already swapped in a new state but the hardware is still on the old state.
Basically 99.9% of code should never even look at obj->state, and instead should always use the for_each_new_<obj>_in_state() and drm_atomic_get_new_<obj>_state() stuff. Currently that is a pipe dream though because a lot of drivers haven't been fixed to do things properly. If we ever manage to fix everything then we could remove the stall hacks from drm_atomic_helper_swap_state() and allow a commit pipeline of arbitrary length.
Quoted 8 lines
After inspecting the code, I think I don't need to call it as:
In
vkms_atomic_commit_tail(used in@vkms_mode_config_helpers.atomic_commit_tail), we calldrm_atomic_helper_commit_modeset_disables, which calldrm_atomic_helper_calc_timestamping_constantswhich calldrm_calc_timestamping_constantsfor every CRTC.
Slightly odd place for it, but I think that's just because it was originally part of drm_atomic_helper_update_legacy_modeset_state() and I didn't bother looking for a better home for it when I split it out. But seems like it should work fine as is.
Quoted 3 lines
I tested
kms_vblank, all of them are SUCCESS/SKIP, do you know other tests that can trigger bugs?
You would explicitly have to race commits against vblank_enable. Could of course sprinkle sleep()s around to widen the race window if you're really keen to hit it.
Signature · 2 lines
Ville Syrjälä Intel
Louis Chauvet
maintainerRe: [PATCH 2/2] drm: Move crtc->{x, y, mode, enabled} to legacy sub-structure
Quoted 46 lines · Ville Syrjälä
Quoted 14 lines · Louis Chauvet
Quoted 14 lines
Quoted 13 lines
drivers/gpu/drm/vkms/vkms_crtc.c static int vkms_enable_vblank(struct drm_crtc *crtc) · line 67
Quoted 11 lines
drivers/gpu/drm/vkms/vkms_crtc.c +1
-1@@ -64,7 +64,7 @@ static int vkms_enable_vblank(struct drm_crtc *crtc)struct drm_vblank_crtc *vblank =drm_crtc_vblank_crtc (crtc);struct vkms_output *out =drm_crtc_to_vkms_output (crtc); -drm_calc_timestamping_constants (crtc, &crtc->mode); +drm_calc_timestamping_constants (crtc, &crtc->legacy.mode);drm_calc_timestamping_constants(crtc, &crtc->state->mode);Quoted 6 lines
Quoted 3 lines
This one doesn't look safe. You want to call that during your atomic commit already.
This was already not safe with the previous implementation? Or it is only unsafe because now I use
state->modeinstead of legacy.mode?Yeah, if you want to look at
obj->statethen you need the corresponding lock.
obj->stateis also not necessarily the correct state you want because a parallel commit could have already swapped in a new state but the hardware is still on the old state.Basically 99.9% of code should never even look at
obj->state, and instead should always use the for_each_new_<obj>_in_state() and drm_atomic_get_new_<obj>_state() stuff. Currently that is a pipe dream though because a lot of drivers haven't been fixed to do things properly. If we ever manage to fix everything then we could remove the stall hacks fromdrm_atomic_helper_swap_state()and allow a commit pipeline of arbitrary length.Quoted 8 lines
After inspecting the code, I think I don't need to call it as:
In
vkms_atomic_commit_tail(used in@vkms_mode_config_helpers.atomic_commit_tail), we calldrm_atomic_helper_commit_modeset_disables, which calldrm_atomic_helper_calc_timestamping_constantswhich calldrm_calc_timestamping_constantsfor every CRTC.
Quoted 4 lines
Slightly odd place for it, but I think that's just because it was originally part of
drm_atomic_helper_update_legacy_modeset_state()and I didn't bother looking for a better home for it when I split it out. But seems like it should work fine as is.
I just send a patch for this! Thanks for your help!
[1]:https://lore.kernel.org/all/[email protected]/
Quoted 11 lines
Quoted 3 lines
I tested
kms_vblank, all of them are SUCCESS/SKIP, do you know other tests that can trigger bugs?You would explicitly have to race commits against
vblank_enable. Could of course sprinkle sleep()s around to widen the race window if you're really keen to hit it.Signature · 2 lines
Ville Syrjälä Intel
Signature · 3 lines
Louis Chauvet, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
Patchwork
CI✗ Fi.CI.CHECKPATCH: warning for drm: Treewide plane/crtc legacy state sweeping
In reply to Ville Syrjala== Series Details ==
== Series Details ==
Series: drm: Treewide plane/crtc legacy state sweeping
URL : https://patchwork.freedesktop.org/series/139445/
State : warning
== Summary ==
Error: dim checkpatch failed7a2c47a03bf1 drm: Move plane->{fb, old_fb, crtc} to legacy sub-structure -:403: CHECK:BRACES: braces {} should be used on all arms of this statement #403: FILE: drivers/gpu/drm/drm_crtc_helper.c:644:
+ if (set->crtc->primary->legacy.fb == NULL) {
[...]
- } else if (set->fb->format != set->crtc->primary->fb->format) {
[...]
mode_changed = true;
[...]
-:403: CHECK:COMPARISON_TO_NULL: Comparison to NULL could be written "!set->crtc->primary->legacy.fb" #403: FILE: drivers/gpu/drm/drm_crtc_helper.c:644:
+ if (set->crtc->primary->legacy.fb == NULL) {
-:529: WARNING:LONG_LINE: line length of 111 exceeds 100 columns #529: FILE: drivers/gpu/drm/drm_plane.c:843:
+ else if (!plane->state && plane->legacy.crtc && drm_lease_held(file_priv, plane->legacy.crtc->base.id))
-:597: CHECK:COMPARISON_TO_NULL: Comparison to NULL could be written "plane->legacy.crtc" #597: FILE: drivers/gpu/drm/drm_plane.c:1181:
+ WARN_ON(plane->legacy.crtc != crtc && plane->legacy.crtc != NULL);
-:663: CHECK:COMPARISON_TO_NULL: Comparison to NULL could be written "!crtc->primary->legacy.fb" #663: FILE: drivers/gpu/drm/gma500/cdv_intel_display.c:465:
+ if (crtc->primary->legacy.fb == NULL || !gma_crtc->active)
-:782: CHECK:COMPARISON_TO_NULL: Comparison to NULL could be written "!crtc->primary->legacy.fb" #782: FILE: drivers/gpu/drm/gma500/psb_intel_display.c:115:
+ if (crtc->primary->legacy.fb == NULL) {
total: 0 errors, 1 warnings, 5 checks, 1006 lines checkede2357259a1b8 drm: Move crtc->{x, y, mode, enabled} to legacy sub-structure
-:113: CHECK:UNNECESSARY_PARENTHESES: Unnecessary parentheses around 'crtc->legacy.mode.clock == test_crtc->legacy.mode.clock' #113: FILE: drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c:351:
+ if ((crtc->legacy.mode.clock == test_crtc->legacy.mode.clock) &&
(adjusted_clock == test_adjusted_clock) &&
(amdgpu_crtc->ss_enabled == test_amdgpu_crtc->ss_enabled) && (test_amdgpu_crtc->pll_id != ATOM_PPLL_INVALID))
-:113: CHECK:UNNECESSARY_PARENTHESES: Unnecessary parentheses around 'adjusted_clock == test_adjusted_clock' #113: FILE: drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c:351:
+ if ((crtc->legacy.mode.clock == test_crtc->legacy.mode.clock) &&
(adjusted_clock == test_adjusted_clock) && (amdgpu_crtc->ss_enabled == test_amdgpu_crtc->ss_enabled) && (test_amdgpu_crtc->pll_id != ATOM_PPLL_INVALID))
-:113: CHECK:UNNECESSARY_PARENTHESES: Unnecessary parentheses around 'amdgpu_crtc->ss_enabled == test_amdgpu_crtc->ss_enabled' #113: FILE: drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c:351:
+ if ((crtc->legacy.mode.clock == test_crtc->legacy.mode.clock) &&
(adjusted_clock == test_adjusted_clock) &&
(amdgpu_crtc->ss_enabled == test_amdgpu_crtc->ss_enabled) && (test_amdgpu_crtc->pll_id != ATOM_PPLL_INVALID))
-:113: CHECK:UNNECESSARY_PARENTHESES: Unnecessary parentheses around 'test_amdgpu_crtc->pll_id != ATOM_PPLL_INVALID' #113: FILE: drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c:351:
+ if ((crtc->legacy.mode.clock == test_crtc->legacy.mode.clock) &&
(adjusted_clock == test_adjusted_clock) &&
(amdgpu_crtc->ss_enabled == test_amdgpu_crtc->ss_enabled) && (test_amdgpu_crtc->pll_id != ATOM_PPLL_INVALID))
-:338: CHECK:SPACING: spaces preferred around that '+' (ctx:VxV) #338: FILE: drivers/gpu/drm/amd/amdgpu/dce_v6_0.c:1095:
+ mode1 = &adev->mode_info.crtcs[i+1]->base.legacy.mode;
^
-:456: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #456: FILE: drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c:8502:
+ if (!(old_conn_state->crtc && old_conn_state->crtc->legacy.enabled) &&
+ new_conn_state->crtc && new_conn_state->crtc->legacy.enabled &&
-:481: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #481: FILE: drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c:9884:
+ update_stream_scaling_settings(&dm_new_con_state->base.crtc->legacy.mode,
dm_new_con_state, dm_new_crtc_state->stream);
-:506: WARNING:LONG_LINE: line length of 105 exceeds 100 columns #506: FILE: drivers/gpu/drm/amd/pm/amdgpu_dpm_internal.c:61:
+ if (crtc->legacy.enabled && amdgpu_crtc->enabled && amdgpu_crtc->hw_mode.clock) {
-:515: WARNING:LONG_LINE: line length of 105 exceeds 100 columns #515: FILE: drivers/gpu/drm/amd/pm/amdgpu_dpm_internal.c:87:
+ if (crtc->legacy.enabled && amdgpu_crtc->enabled && amdgpu_crtc->hw_mode.clock) {
-:978: WARNING:LONG_LINE: line length of 111 exceeds 100 columns #978: FILE: drivers/gpu/drm/gma500/cdv_intel_hdmi.c:194:
+ encoder->crtc->legacy.x, encoder->crtc->legacy.y,
-:1138: ERROR:CODE_INDENT: code indent should use tabs where possible #1138: FILE: drivers/gpu/drm/imx/lcdc/imx-lcdc.c:162:
+^I^I crtc->legacy.mode.hdisplay >> 4) |$
-:1138: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #1138: FILE: drivers/gpu/drm/imx/lcdc/imx-lcdc.c:162:
+ framesize = FIELD_PREP(IMX21LCDC_LSR_XMAX,
+ crtc->legacy.mode.hdisplay >> 4) |
-:1147: ERROR:CODE_INDENT: code indent should use tabs where possible #1147: FILE: drivers/gpu/drm/imx/lcdc/imx-lcdc.c:168:
+^I^I crtc->legacy.mode.hsync_start - crtc->legacy.mode.hdisplay - 1) |$
-:1147: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #1147: FILE: drivers/gpu/drm/imx/lcdc/imx-lcdc.c:168:
+ lhcr = FIELD_PREP(IMX21LCDC_LHCR_HFPORCH,
+ crtc->legacy.mode.hsync_start - crtc->legacy.mode.hdisplay - 1) |
-:1149: ERROR:CODE_INDENT: code indent should use tabs where possible #1149: FILE: drivers/gpu/drm/imx/lcdc/imx-lcdc.c:170:
+^I^I crtc->legacy.mode.hsync_end - crtc->legacy.mode.hsync_start - 1) |$
-:1151: ERROR:CODE_INDENT: code indent should use tabs where possible #1151: FILE: drivers/gpu/drm/imx/lcdc/imx-lcdc.c:172:
+^I^I crtc->legacy.mode.htotal - crtc->legacy.mode.hsync_end - 3);$
-:1159: ERROR:CODE_INDENT: code indent should use tabs where possible #1159: FILE: drivers/gpu/drm/imx/lcdc/imx-lcdc.c:177:
+^I^I crtc->legacy.mode.vsync_start - crtc->legacy.mode.vdisplay) |$
-:1159: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #1159: FILE: drivers/gpu/drm/imx/lcdc/imx-lcdc.c:177:
+ lvcr = FIELD_PREP(IMX21LCDC_LVCR_VFPORCH,
+ crtc->legacy.mode.vsync_start - crtc->legacy.mode.vdisplay) |
-:1161: ERROR:CODE_INDENT: code indent should use tabs where possible #1161: FILE: drivers/gpu/drm/imx/lcdc/imx-lcdc.c:179:
+^I^I crtc->legacy.mode.vsync_end - crtc->legacy.mode.vsync_start) |$
-:1163: ERROR:CODE_INDENT: code indent should use tabs where possible #1163: FILE: drivers/gpu/drm/imx/lcdc/imx-lcdc.c:181:
+^I^I crtc->legacy.mode.vtotal - crtc->legacy.mode.vsync_end);$
-:1283: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #1283: FILE: drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c:223:
+ if (tmp_crtc->legacy.enabled &&
curr_client_type ==
-:1384: CHECK:PREFER_KERNEL_TYPES: Prefer kernel type 'u32' over 'uint32_t' #1384: FILE: drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c:845:
+ uint32_t xres = crtc->legacy.mode.hdisplay;
-:1385: CHECK:PREFER_KERNEL_TYPES: Prefer kernel type 'u32' over 'uint32_t' #1385: FILE: drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c:846:
+ uint32_t yres = crtc->legacy.mode.vdisplay;
-:1545: CHECK:UNNECESSARY_PARENTHESES: Unnecessary parentheses around 'crtc->legacy.mode.clock == test_crtc->legacy.mode.clock' #1545: FILE: drivers/gpu/drm/radeon/atombios_crtc.c:1815:
+ if ((crtc->legacy.mode.clock == test_crtc->legacy.mode.clock) &&
(adjusted_clock == test_adjusted_clock) &&
(radeon_crtc->ss_enabled == test_radeon_crtc->ss_enabled) && (test_radeon_crtc->pll_id != ATOM_PPLL_INVALID))
-:1545: CHECK:UNNECESSARY_PARENTHESES: Unnecessary parentheses around 'adjusted_clock == test_adjusted_clock' #1545: FILE: drivers/gpu/drm/radeon/atombios_crtc.c:1815:
+ if ((crtc->legacy.mode.clock == test_crtc->legacy.mode.clock) &&
(adjusted_clock == test_adjusted_clock) && (radeon_crtc->ss_enabled == test_radeon_crtc->ss_enabled) && (test_radeon_crtc->pll_id != ATOM_PPLL_INVALID))
-:1545: CHECK:UNNECESSARY_PARENTHESES: Unnecessary parentheses around 'radeon_crtc->ss_enabled == test_radeon_crtc->ss_enabled' #1545: FILE: drivers/gpu/drm/radeon/atombios_crtc.c:1815:
+ if ((crtc->legacy.mode.clock == test_crtc->legacy.mode.clock) &&
(adjusted_clock == test_adjusted_clock) &&
(radeon_crtc->ss_enabled == test_radeon_crtc->ss_enabled) && (test_radeon_crtc->pll_id != ATOM_PPLL_INVALID))
-:1545: CHECK:UNNECESSARY_PARENTHESES: Unnecessary parentheses around 'test_radeon_crtc->pll_id != ATOM_PPLL_INVALID' #1545: FILE: drivers/gpu/drm/radeon/atombios_crtc.c:1815:
+ if ((crtc->legacy.mode.clock == test_crtc->legacy.mode.clock) &&
(adjusted_clock == test_adjusted_clock) &&
(radeon_crtc->ss_enabled == test_radeon_crtc->ss_enabled) && (test_radeon_crtc->pll_id != ATOM_PPLL_INVALID))
-:1717: WARNING:LONG_LINE: line length of 105 exceeds 100 columns #1717: FILE: drivers/gpu/drm/radeon/r600_dpm.c:165:
+ if (crtc->legacy.enabled && radeon_crtc->enabled && radeon_crtc->hw_mode.clock) {
-:1726: WARNING:LONG_LINE: line length of 105 exceeds 100 columns #1726: FILE: drivers/gpu/drm/radeon/r600_dpm.c:191:
+ if (crtc->legacy.enabled && radeon_crtc->enabled && radeon_crtc->hw_mode.clock) {
-:1847: WARNING:LONG_LINE: line length of 132 exceeds 100 columns #1847: FILE: drivers/gpu/drm/radeon/radeon_display.c:556:
+ int tile_addr = (((crtc->legacy.y >> 3) * pitch_pixels + crtc->legacy.x) >> (8 - byteshift)) << 11;
-:1848: WARNING:LONG_LINE: line length of 120 exceeds 100 columns #1848: FILE: drivers/gpu/drm/radeon/radeon_display.c:557:
+ base += tile_addr + ((crtc->legacy.x << byteshift) % 256) + ((crtc->legacy.y % 8) << 8);
-:1848: WARNING:LINE_SPACING: Missing a blank line after declarations #1848: FILE: drivers/gpu/drm/radeon/radeon_display.c:557:
+ int tile_addr = (((crtc->legacy.y >> 3) * pitch_pixels + crtc->legacy.x) >> (8 - byteshift)) << 11;
+ base += tile_addr + ((crtc->legacy.x << byteshift) % 256) + ((crtc->legacy.y % 8) << 8);
-:1927: CHECK:UNNECESSARY_PARENTHESES: Unnecessary parentheses around 'radeon_crtc->crtc_id == 1' #1927: FILE: drivers/gpu/drm/radeon/radeon_legacy_encoders.c:1541:
+ if ((radeon_crtc->crtc_id == 1) && crtc->legacy.enabled) {
total: 7 errors, 8 warnings, 18 checks, 2123 lines checked
Patchwork
CI✗ Fi.CI.SPARSE: warning for drm: Treewide plane/crtc legacy state sweeping
In reply to Ville Syrjala== Series Details ==
== Series Details ==
Series: drm: Treewide plane/crtc legacy state sweeping
URL : https://patchwork.freedesktop.org/series/139445/
State : warning
== Summary ==
Error: dim sparse failed
Sparse version: v0.6.2
Fast mode used, each commit won't be checked separately.
Patchwork
CI✗ Fi.CI.BAT: failure for drm: Treewide plane/crtc legacy state sweeping
In reply to Ville Syrjala== Series Details ==
== Series Details ==
Series: drm: Treewide plane/crtc legacy state sweeping
URL : https://patchwork.freedesktop.org/series/139445/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_15475 -> Patchwork_139445v1
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with Patchwork_139445v1 absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes
introduced in Patchwork_139445v1, please notify your bug team ([email protected]) to allow them to document this new failure mode, which will reduce false positives in CI.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_139445v1/index.html
Participating hosts (43 -> 41)
------------------------------
Missing (2): bat-arls-1 fi-snb-2520m
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in Patchwork_139445v1:
### IGT changes ###
#### Possible regressions ####
* igt@i915_selftest@live:
- fi-bsw-n3050: [PASS][1] -> [ABORT][2] +1 other test abort
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15475/fi-bsw-n3050/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_139445v1/fi-bsw-n3050/igt@[email protected]
* igt@i915_selftest@live@active:
- fi-bsw-nick: [PASS][3] -> [DMESG-FAIL][4]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15475/fi-bsw-nick/igt@i915_selftest@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_139445v1/fi-bsw-nick/igt@i915_selftest@[email protected]
Known issues
------------
Here are the changes found in Patchwork_139445v1 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@i915_selftest@live:
- bat-mtlp-8: [PASS][5] -> [ABORT][6] ([i915#12216]) +1 other test abort
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15475/bat-mtlp-8/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_139445v1/bat-mtlp-8/igt@[email protected]
- bat-arlh-2: [PASS][7] -> [ABORT][8] ([i915#12133])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15475/bat-arlh-2/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_139445v1/bat-arlh-2/igt@[email protected]
- fi-bsw-nick: [PASS][9] -> [DMESG-FAIL][10] ([i915#12172])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15475/fi-bsw-nick/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_139445v1/fi-bsw-nick/igt@[email protected]
* igt@i915_selftest@live@workarounds:
- bat-arlh-2: [PASS][11] -> [ABORT][12] ([i915#12061])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15475/bat-arlh-2/igt@i915_selftest@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_139445v1/bat-arlh-2/igt@i915_selftest@[email protected]
* igt@kms_chamelium_edid@vga-edid-read:
- bat-dg2-13: NOTRUN -> [SKIP][13] ([Intel XE#484] / [i915#4550]) +1 other test skip
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_139445v1/bat-dg2-13/igt@[email protected]
* igt@kms_chamelium_hpd@dp-hpd-fast:
- bat-dg2-13: NOTRUN -> [SKIP][14] ([Intel XE#484]) +2 other tests skip
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_139445v1/bat-dg2-13/igt@[email protected]
#### Possible fixes ####
* igt@i915_module_load@reload:
- fi-kbl-7567u: [DMESG-WARN][15] ([i915#11621] / [i915#180] / [i915#1982]) -> [PASS][16] +1 other test pass
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15475/fi-kbl-7567u/igt@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_139445v1/fi-kbl-7567u/igt@[email protected]
* igt@i915_selftest@live:
- {bat-arlh-3}: [ABORT][17] ([i915#12133]) -> [PASS][18]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15475/bat-arlh-3/igt@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_139445v1/bat-arlh-3/igt@[email protected]
- bat-twl-2: [INCOMPLETE][19] ([i915#12133] / [i915#9413]) -> [PASS][20]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15475/bat-twl-2/igt@[email protected]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_139445v1/bat-twl-2/igt@[email protected]
* igt@i915_selftest@live@gt_lrc:
- bat-twl-2: [INCOMPLETE][21] ([i915#9413]) -> [PASS][22]
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15475/bat-twl-2/igt@i915_selftest@live@gt_lrc.html
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_139445v1/bat-twl-2/igt@i915_selftest@live@gt_lrc.html
* igt@i915_selftest@live@sanitycheck:
- fi-kbl-7567u: [DMESG-WARN][23] ([i915#11621]) -> [PASS][24] +81 other tests pass
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15475/fi-kbl-7567u/igt@i915_selftest@[email protected]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_139445v1/fi-kbl-7567u/igt@i915_selftest@[email protected]
* igt@i915_selftest@live@workarounds:
- {bat-arlh-3}: [ABORT][25] ([i915#12061]) -> [PASS][26]
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15475/bat-arlh-3/igt@i915_selftest@[email protected]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_139445v1/bat-arlh-3/igt@i915_selftest@[email protected]
- bat-mtlp-6: [ABORT][27] ([i915#12216]) -> [PASS][28] +1 other test pass
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15475/bat-mtlp-6/igt@i915_selftest@[email protected]
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_139445v1/bat-mtlp-6/igt@i915_selftest@[email protected]
* igt@kms_busy@basic@flip:
- fi-kbl-7567u: [DMESG-WARN][29] ([i915#180]) -> [PASS][30]
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15475/fi-kbl-7567u/igt@kms_busy@[email protected]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_139445v1/fi-kbl-7567u/igt@kms_busy@[email protected]
* igt@kms_pm_rpm@basic-pci-d3-state:
- fi-kbl-7567u: [DMESG-WARN][31] ([i915#11621] / [i915#180]) -> [PASS][32] +50 other tests pass
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15475/fi-kbl-7567u/igt@[email protected]
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_139445v1/fi-kbl-7567u/igt@[email protected]
#### Warnings ####
* igt@core_hotunplug@unbind-rebind:
- bat-arls-5: [DMESG-WARN][33] ([i915#11637] / [i915#1982]) -> [DMESG-WARN][34] ([i915#11637])
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_15475/bat-arls-5/igt@[email protected]
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_139445v1/bat-arls-5/igt@[email protected]
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[Intel XE#484]: https://gitlab.freedesktop.org/drm/xe/kernel/issues/484
[i915#11621]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/11621
[i915#11637]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/11637
[i915#12061]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/12061
[i915#12133]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/12133
[i915#12172]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/12172
[i915#12216]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/12216
[i915#180]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/180
[i915#1982]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/1982
[i915#4550]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/4550
[i915#9413]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/9413
Build changes
-------------
* Linux: CI_DRM_15475 -> Patchwork_139445v1
CI-20190529: 20190529
CI_DRM_15475: 789d5631453c3edad1988cd47db1643555e52ac9 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_8049: 909157f3cc3c0676a4f896752276d438c3ec3959 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_139445v1: 789d5631453c3edad1988cd47db1643555e52ac9 @ git://anongit.freedesktop.org/gfx-ci/linux
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_139445v1/index.html
Quoted 11 lines · Ville Syrjala
From: Ville Syrjälä <[email protected]>
An attempt to hide the drm_plane/crtc legacy state better.
This also highlights the fact that a lot of supposedly atomic drivers are poking around in the legacy crtc state, which is rather questionable. For planes we did force the legacy state to NULL already to force drivers to behave. But even then it seems capable of confusing people with its high profile location directly under
drm_plane.
Quoted 6 lines
This might end up as some kind of conflict
galore, but the alternative would involve trying
to wean the atomic drivers off one by one,
which would probably take forever. At least with
this the issue becomes visible and shouldn't be
forgotten as easily.
Ping, anyone have thoughts on this? I'd like to get something like this in at some point to make the legacy state (ab)users easily visible...
Quoted 150 lines
The cc list was getting way out of hand, so I had
to trim it a bit. Hopefully I didn't chop off too
many names...Cc Abhinav Kumar <[email protected]>Cc Alain Volmat <[email protected]>Cc Alex Deucher <[email protected]>Cc Alexey Brodkin <[email protected]>Cc Andy Yan <[email protected]>Cc "Christian König" <[email protected]>Cc Danilo Krummrich <[email protected]>Cc Dmitry Baryshkov <[email protected]>Cc Hans de Goede <[email protected]>Cc "Heiko Stübner" <[email protected]>Cc Inki Dae <[email protected]>Cc Jyri Sarha <[email protected]>Cc Karol Herbst <[email protected]>Cc Liviu Dudau <[email protected]>Cc Lyude Paul <[email protected]>Cc "Maíra Canal" <[email protected]>Cc Marijn Suijten <[email protected]>Cc Patrik Jakobsson <[email protected]>Cc Rob Clark <[email protected]>Cc Russell King <[email protected]>Cc Sandy Huang <[email protected]>Cc Sean Paul <[email protected]>Cc Xinhui Pan <[email protected]>Cc Zack Rusin <[email protected]>Ville Syrjälä (2):
drm: Move plane->{fb,old_fb,crtc} to legacy sub-structure
drm: Move crtc->{x,y,mode,enabled} to legacy sub-structure.../gpu/drm/amd/amdgpu/amdgpu_connectors.c | 7 +- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 20 ++--- drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c | 2 +- drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 35 ++++---- drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 35 ++++---- drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 37 ++++----- drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 35 ++++---- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 14 ++-- .../amd/display/amdgpu_dm/amdgpu_dm_crtc.c | 2 +- drivers/gpu/drm/amd/pm/amdgpu_dpm_internal.c | 4 +- drivers/gpu/drm/arm/hdlcd_drv.c | 2 +- drivers/gpu/drm/arm/malidp_hw.c | 2 +- drivers/gpu/drm/armada/armada_crtc.c | 12 ++- drivers/gpu/drm/ast/ast_dp.c | 8 +- drivers/gpu/drm/drm_atomic.c | 6 +- drivers/gpu/drm/drm_atomic_helper.c | 8 +- drivers/gpu/drm/drm_client_modeset.c | 10 +-- drivers/gpu/drm/drm_crtc.c | 31 +++---- drivers/gpu/drm/drm_crtc_helper.c | 80 ++++++++++--------- drivers/gpu/drm/drm_fb_helper.c | 12 +-- drivers/gpu/drm/drm_framebuffer.c | 4 +- drivers/gpu/drm/drm_plane.c | 69 ++++++++-------- drivers/gpu/drm/drm_plane_helper.c | 6 +- drivers/gpu/drm/drm_vblank.c | 2 +- drivers/gpu/drm/exynos/exynos5433_drm_decon.c | 4 +- drivers/gpu/drm/gma500/cdv_intel_display.c | 2 +- drivers/gpu/drm/gma500/cdv_intel_dp.c | 6 +- drivers/gpu/drm/gma500/cdv_intel_hdmi.c | 3 +- drivers/gpu/drm/gma500/cdv_intel_lvds.c | 6 +- drivers/gpu/drm/gma500/gma_display.c | 22 ++--- drivers/gpu/drm/gma500/oaktrail_crtc.c | 2 +- drivers/gpu/drm/gma500/psb_intel_display.c | 2 +- drivers/gpu/drm/gma500/psb_intel_lvds.c | 6 +- drivers/gpu/drm/gma500/psb_intel_sdvo.c | 8 +- drivers/gpu/drm/i2c/ch7006_drv.c | 7 +- drivers/gpu/drm/i2c/sil164_drv.c | 2 +- .../drm/i915/display/intel_modeset_setup.c | 4 +- drivers/gpu/drm/imx/lcdc/imx-lcdc.c | 31 ++++--- drivers/gpu/drm/mediatek/mtk_crtc.c | 6 +- drivers/gpu/drm/meson/meson_overlay.c | 2 +- drivers/gpu/drm/meson/meson_plane.c | 8 +- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 18 +++-- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 6 +- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 16 ++-- drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c | 4 +- drivers/gpu/drm/nouveau/dispnv04/crtc.c | 25 +++--- drivers/gpu/drm/nouveau/dispnv04/cursor.c | 2 +- drivers/gpu/drm/nouveau/dispnv04/dfp.c | 2 +- drivers/gpu/drm/nouveau/dispnv04/disp.c | 4 +- .../gpu/drm/nouveau/dispnv04/tvmodesnv17.c | 4 +- drivers/gpu/drm/nouveau/dispnv04/tvnv17.c | 7 +- drivers/gpu/drm/nouveau/nouveau_connector.c | 6 +- drivers/gpu/drm/qxl/qxl_display.c | 6 +- drivers/gpu/drm/radeon/atombios_crtc.c | 28 +++---- drivers/gpu/drm/radeon/cik.c | 12 +-- drivers/gpu/drm/radeon/evergreen.c | 16 ++-- drivers/gpu/drm/radeon/r100.c | 16 ++-- drivers/gpu/drm/radeon/r600_cs.c | 2 +- drivers/gpu/drm/radeon/r600_dpm.c | 4 +- drivers/gpu/drm/radeon/radeon_connectors.c | 7 +- drivers/gpu/drm/radeon/radeon_cursor.c | 29 +++---- drivers/gpu/drm/radeon/radeon_device.c | 2 +- drivers/gpu/drm/radeon/radeon_display.c | 26 +++--- drivers/gpu/drm/radeon/radeon_drv.c | 2 +- drivers/gpu/drm/radeon/radeon_legacy_crtc.c | 16 ++-- .../gpu/drm/radeon/radeon_legacy_encoders.c | 2 +- drivers/gpu/drm/radeon/radeon_pm.c | 2 +- drivers/gpu/drm/radeon/rs600.c | 10 +-- drivers/gpu/drm/radeon/rs690.c | 22 ++--- drivers/gpu/drm/radeon/rs780_dpm.c | 6 +- drivers/gpu/drm/radeon/rv515.c | 30 +++---- drivers/gpu/drm/radeon/rv770.c | 2 +- drivers/gpu/drm/radeon/si.c | 14 ++-- .../gpu/drm/renesas/rcar-du/rcar_du_crtc.c | 2 +- .../gpu/drm/renesas/shmobile/shmob_drm_crtc.c | 2 +- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 6 +- drivers/gpu/drm/sti/sti_crtc.c | 4 +- drivers/gpu/drm/sti/sti_cursor.c | 2 +- drivers/gpu/drm/sti/sti_gdp.c | 2 +- drivers/gpu/drm/sti/sti_hqvdp.c | 2 +- drivers/gpu/drm/sti/sti_tvout.c | 6 +- drivers/gpu/drm/sti/sti_vid.c | 2 +- drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 10 +-- drivers/gpu/drm/tiny/arcpgu.c | 2 +- drivers/gpu/drm/vboxvideo/vbox_mode.c | 2 +- drivers/gpu/drm/vc4/vc4_dpi.c | 2 +- drivers/gpu/drm/vc4/vc4_plane.c | 4 +- drivers/gpu/drm/virtio/virtgpu_display.c | 4 +- drivers/gpu/drm/vkms/vkms_composer.c | 4 +- drivers/gpu/drm/vkms/vkms_crtc.c | 2 +- drivers/gpu/drm/vkms/vkms_writeback.c | 4 +- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 8 +- drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c | 18 +++-- drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c | 9 ++- drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c | 4 +- drivers/gpu/drm/vmwgfx/vmwgfx_vkms.c | 2 +- drivers/gpu/drm/xen/xen_drm_front_kms.c | 2 +- include/drm/drm_crtc.h | 75 ++++++++--------- include/drm/drm_plane.h | 52 ++++++------ 100 files changed, 599 insertions(+), 547 deletions(-)Signature · 1 line
2.45.2
Signature · 2 lines
Ville Syrjälä Intel
Quoted 20 lines · Ville Syrjälä
Quoted 11 lines · Ville Syrjala
From: Ville Syrjälä <[email protected]>
An attempt to hide the drm_plane/crtc legacy state better.
This also highlights the fact that a lot of supposedly atomic drivers are poking around in the legacy crtc state, which is rather questionable. For planes we did force the legacy state to NULL already to force drivers to behave. But even then it seems capable of confusing people with its high profile location directly under
drm_plane.Quoted 6 lines
This might end up as some kind of conflict galore, but the alternative would involve trying to wean the atomic drivers off one by one,
which would probably take forever. At least with this the issue becomes visible and shouldn't be forgotten as easily.
Quoted 3 lines
Ping, anyone have thoughts on this? I'd like to get something like this in at some point to make the legacy state (ab)users easily visible...
I think that's a good idea. I hope to find a time slot and check the (ab)using of legacy state in drm/msm driver.
Quoted 5 lines
Quoted 5 lines
The cc list was getting way out of hand, so I had to trim it a bit. Hopefully I didn't chop off too many names...
Signature · 2 lines
With best wishes Dmitry
Quoted 19 lines · Ville Syrjälä
Quoted 11 lines · Ville Syrjala
From: Ville Syrjälä <[email protected]>
An attempt to hide the drm_plane/crtc legacy state better.
This also highlights the fact that a lot of supposedly atomic drivers are poking around in the legacy crtc state, which is rather questionable. For planes we did force the legacy state to NULL already to force drivers to behave. But even then it seems capable of confusing people with its high profile location directly under
drm_plane.Quoted 6 lines
This might end up as some kind of conflict
galore, but the alternative would involve trying
to wean the atomic drivers off one by one,
which would probably take forever. At least with
this the issue becomes visible and shouldn't be
forgotten as easily.
Quoted 3 lines
Ping, anyone have thoughts on this? I'd like to get something like this in at some point to make the legacy state (ab)users easily visible...
On the approach,
with or without converting legacy into a pointer, up to you.
Quoted 151 lines
Quoted 151 lines
The cc list was getting way out of hand, so I had
to trim it a bit. Hopefully I didn't chop off too
many names...Cc Abhinav Kumar <[email protected]>Cc Alain Volmat <[email protected]>Cc Alex Deucher <[email protected]>Cc Alexey Brodkin <[email protected]>Cc Andy Yan <[email protected]>Cc "Christian König" <[email protected]>Cc Danilo Krummrich <[email protected]>Cc Dmitry Baryshkov <[email protected]>Cc Hans de Goede <[email protected]>Cc "Heiko Stübner" <[email protected]>Cc Inki Dae <[email protected]>Cc Jyri Sarha <[email protected]>Cc Karol Herbst <[email protected]>Cc Liviu Dudau <[email protected]>Cc Lyude Paul <[email protected]>Cc "Maíra Canal" <[email protected]>Cc Marijn Suijten <[email protected]>Cc Patrik Jakobsson <[email protected]>Cc Rob Clark <[email protected]>Cc Russell King <[email protected]>Cc Sandy Huang <[email protected]>Cc Sean Paul <[email protected]>Cc Xinhui Pan <[email protected]>Cc Zack Rusin <[email protected]>Ville Syrjälä (2):
drm: Move plane->{fb,old_fb,crtc} to legacy sub-structure
drm: Move crtc->{x,y,mode,enabled} to legacy sub-structure.../gpu/drm/amd/amdgpu/amdgpu_connectors.c | 7 +- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 20 ++--- drivers/gpu/drm/amd/amdgpu/amdgpu_pll.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c | 2 +- drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 35 ++++---- drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 35 ++++---- drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 37 ++++----- drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 35 ++++---- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 14 ++-- .../amd/display/amdgpu_dm/amdgpu_dm_crtc.c | 2 +- drivers/gpu/drm/amd/pm/amdgpu_dpm_internal.c | 4 +- drivers/gpu/drm/arm/hdlcd_drv.c | 2 +- drivers/gpu/drm/arm/malidp_hw.c | 2 +- drivers/gpu/drm/armada/armada_crtc.c | 12 ++- drivers/gpu/drm/ast/ast_dp.c | 8 +- drivers/gpu/drm/drm_atomic.c | 6 +- drivers/gpu/drm/drm_atomic_helper.c | 8 +- drivers/gpu/drm/drm_client_modeset.c | 10 +-- drivers/gpu/drm/drm_crtc.c | 31 +++---- drivers/gpu/drm/drm_crtc_helper.c | 80 ++++++++++--------- drivers/gpu/drm/drm_fb_helper.c | 12 +-- drivers/gpu/drm/drm_framebuffer.c | 4 +- drivers/gpu/drm/drm_plane.c | 69 ++++++++-------- drivers/gpu/drm/drm_plane_helper.c | 6 +- drivers/gpu/drm/drm_vblank.c | 2 +- drivers/gpu/drm/exynos/exynos5433_drm_decon.c | 4 +- drivers/gpu/drm/gma500/cdv_intel_display.c | 2 +- drivers/gpu/drm/gma500/cdv_intel_dp.c | 6 +- drivers/gpu/drm/gma500/cdv_intel_hdmi.c | 3 +- drivers/gpu/drm/gma500/cdv_intel_lvds.c | 6 +- drivers/gpu/drm/gma500/gma_display.c | 22 ++--- drivers/gpu/drm/gma500/oaktrail_crtc.c | 2 +- drivers/gpu/drm/gma500/psb_intel_display.c | 2 +- drivers/gpu/drm/gma500/psb_intel_lvds.c | 6 +- drivers/gpu/drm/gma500/psb_intel_sdvo.c | 8 +- drivers/gpu/drm/i2c/ch7006_drv.c | 7 +- drivers/gpu/drm/i2c/sil164_drv.c | 2 +- .../drm/i915/display/intel_modeset_setup.c | 4 +- drivers/gpu/drm/imx/lcdc/imx-lcdc.c | 31 ++++--- drivers/gpu/drm/mediatek/mtk_crtc.c | 6 +- drivers/gpu/drm/meson/meson_overlay.c | 2 +- drivers/gpu/drm/meson/meson_plane.c | 8 +- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 18 +++-- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 6 +- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 16 ++-- drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c | 4 +- drivers/gpu/drm/nouveau/dispnv04/crtc.c | 25 +++--- drivers/gpu/drm/nouveau/dispnv04/cursor.c | 2 +- drivers/gpu/drm/nouveau/dispnv04/dfp.c | 2 +- drivers/gpu/drm/nouveau/dispnv04/disp.c | 4 +- .../gpu/drm/nouveau/dispnv04/tvmodesnv17.c | 4 +- drivers/gpu/drm/nouveau/dispnv04/tvnv17.c | 7 +- drivers/gpu/drm/nouveau/nouveau_connector.c | 6 +- drivers/gpu/drm/qxl/qxl_display.c | 6 +- drivers/gpu/drm/radeon/atombios_crtc.c | 28 +++---- drivers/gpu/drm/radeon/cik.c | 12 +-- drivers/gpu/drm/radeon/evergreen.c | 16 ++-- drivers/gpu/drm/radeon/r100.c | 16 ++-- drivers/gpu/drm/radeon/r600_cs.c | 2 +- drivers/gpu/drm/radeon/r600_dpm.c | 4 +- drivers/gpu/drm/radeon/radeon_connectors.c | 7 +- drivers/gpu/drm/radeon/radeon_cursor.c | 29 +++---- drivers/gpu/drm/radeon/radeon_device.c | 2 +- drivers/gpu/drm/radeon/radeon_display.c | 26 +++--- drivers/gpu/drm/radeon/radeon_drv.c | 2 +- drivers/gpu/drm/radeon/radeon_legacy_crtc.c | 16 ++-- .../gpu/drm/radeon/radeon_legacy_encoders.c | 2 +- drivers/gpu/drm/radeon/radeon_pm.c | 2 +- drivers/gpu/drm/radeon/rs600.c | 10 +-- drivers/gpu/drm/radeon/rs690.c | 22 ++--- drivers/gpu/drm/radeon/rs780_dpm.c | 6 +- drivers/gpu/drm/radeon/rv515.c | 30 +++---- drivers/gpu/drm/radeon/rv770.c | 2 +- drivers/gpu/drm/radeon/si.c | 14 ++-- .../gpu/drm/renesas/rcar-du/rcar_du_crtc.c | 2 +- .../gpu/drm/renesas/shmobile/shmob_drm_crtc.c | 2 +- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 6 +- drivers/gpu/drm/sti/sti_crtc.c | 4 +- drivers/gpu/drm/sti/sti_cursor.c | 2 +- drivers/gpu/drm/sti/sti_gdp.c | 2 +- drivers/gpu/drm/sti/sti_hqvdp.c | 2 +- drivers/gpu/drm/sti/sti_tvout.c | 6 +- drivers/gpu/drm/sti/sti_vid.c | 2 +- drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 10 +-- drivers/gpu/drm/tiny/arcpgu.c | 2 +- drivers/gpu/drm/vboxvideo/vbox_mode.c | 2 +- drivers/gpu/drm/vc4/vc4_dpi.c | 2 +- drivers/gpu/drm/vc4/vc4_plane.c | 4 +- drivers/gpu/drm/virtio/virtgpu_display.c | 4 +- drivers/gpu/drm/vkms/vkms_composer.c | 4 +- drivers/gpu/drm/vkms/vkms_crtc.c | 2 +- drivers/gpu/drm/vkms/vkms_writeback.c | 4 +- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 8 +- drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c | 18 +++-- drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c | 9 ++- drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c | 4 +- drivers/gpu/drm/vmwgfx/vmwgfx_vkms.c | 2 +- drivers/gpu/drm/xen/xen_drm_front_kms.c | 2 +- include/drm/drm_crtc.h | 75 ++++++++--------- include/drm/drm_plane.h | 52 ++++++------ 100 files changed, 599 insertions(+), 547 deletions(-)Signature · 1 line
2.45.2
Signature · 1 line
Jani Nikula, Intel