Skip to contentSkip to conversation

drm/amd/display: no distinct handling of cursor required

PATCH New S, Shirish 1 participant 1 message Nov 16, 2017 2 messages not in the archive

Subsystems (3)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): 1510829030-21631-1-git-send-email-shirish.s12-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

S, Shirish

author
#2 lore raw

PATCH 1/1 drm/amd/display: no distinct handling of cursor required

From: Shirish S <[email protected]>

Currently the atomic check code uses legacy_cursor_update to differnetiate if the cursor plane is being requested by the user, which is not required as we shall be updating plane only if modeset is requested/required.

Have tested cursor plane and underlay get updated seamlessly, without any lag or frame drops.

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 41 +++++++----------------
 1 file changed, 12 insertions(+), 29 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -2
index 8638f1c..2df2e32 100644
@@ -4752,8 +4752,6 @@ static int dm_update_planes_state(struct dc *dc,  static int amdgpu_dm_atomic_check(struct drm_device *dev,
 				  struct drm_atomic_state *state)
 {
-	int i;
-	int ret;
 	struct amdgpu_device *adev = dev->dev_private;
 	struct dc *dc = adev->dm.dc;
 	struct dm_atomic_state *dm_state = to_dm_atomic_state(state); @@ -4761,6 +4759,7 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,
 	struct drm_connector_state *old_con_state, *new_con_state;

struct drm_crtc *crtc;
struct drm_crtc_state *old_crtc_state, *new_crtc_state;
+ int ret, i;

/*
* This bool will be set for true for any modeset/reset @@ -4772,36 +4771,20 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,
if (ret)
goto fail;

- /*
- * legacy_cursor_update should be made false for SoC's having
- * a dedicated hardware plane for cursor in amdgpu_dm_atomic_commit(),
- * otherwise for software cursor plane,
- * we should not add it to list of affected planes.
- */
- if (state->legacy_cursor_update) {
- for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) {
- if (new_crtc_state->color_mgmt_changed) {
- ret = drm_atomic_add_affected_planes(state, crtc);
- if (ret)
- goto fail;
- }
- }
- } else {
- for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) {
- if (!drm_atomic_crtc_needs_modeset(new_crtc_state))
- continue;
+ for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) {
+ if (!drm_atomic_crtc_needs_modeset(new_crtc_state))
+ continue;

- if (!new_crtc_state->enable)
- continue;
+ if (!new_crtc_state->enable)
+ continue;

- ret = drm_atomic_add_affected_connectors(state, crtc);
- if (ret)
- return ret;
+ ret = drm_atomic_add_affected_connectors(state, crtc);
+ if (ret)
+ return ret;

- ret = drm_atomic_add_affected_planes(state, crtc);
- if (ret)
- goto fail;
- }
+ ret = drm_atomic_add_affected_planes(state, crtc);
+ if (ret)
+ goto fail;
}

dm_state->context = dc_create_state();
--
2.7.4

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