All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/display: add hardware_planes_only to list of affected planes
       [not found]   ` <BN6PR12MB18264CC2ACA29BB715F1F152F2480-/b2+HYfkarSCndJ3FSsNdQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
@ 2017-10-13 14:45     ` S, Shirish
  0 siblings, 0 replies; only message in thread
From: S, Shirish @ 2017-10-13 14:45 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Wentland, Harry,
	Deucher, Alexander


From: Shirish S <shirish.s@amd.com>

For SoC's having software designed cursor plane,
should be treated differently than hardware cursor planes.

The DRM core initializes cursor plane by default with
legacy_cursor_update set.

Hence legacy_cursor_update can be use effectively
to handle software cursor planes' update and atomicity
functionalities.

This patch uses this variable to decide in the atomic_check
to whether add a requested plane to the list of affected planes or
not, hence fixing the issue of co-existence of MPO, i.e,
setting of available hardware planes like underlay and
updation of cursor planes as well.

Without this patch when underlay is set from user space,
only blank screen with backlight is visible.

Change-Id: Ic394c80801dfc4a7f8af4be2aed75737f451554b
Signed-off-by: Shirish S <shirish.s@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 30 ++++++++++++++++++-----
 1 file changed, 24 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 0861828..a94ef3c 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -4103,6 +4103,8 @@ int amdgpu_dm_atomic_commit(
                if (drm_atomic_crtc_needs_modeset(new_state) && old_acrtc_state->stream)
                        manage_dm_interrupts(adev, acrtc, false);
        }
+       /* Add check here for SoC's that support hardware cursor plane, to
+        * unset legacy_cursor_update */

        return drm_atomic_helper_commit(dev, state, nonblock);

@@ -4757,7 +4759,7 @@ int amdgpu_dm_atomic_check(struct drm_device *dev,
        struct drm_connector *connector;
        struct drm_connector_state *conn_state;
        struct drm_crtc *crtc;
-       struct drm_crtc_state *crtc_state;
+       struct drm_crtc_state *old_crtc_state, *crtc_state;

        /*
         * This bool will be set for true for any modeset/reset
@@ -4766,18 +4768,34 @@ int amdgpu_dm_atomic_check(struct drm_device *dev,
        bool lock_and_validation_needed = false;

        ret = drm_atomic_helper_check_modeset(dev, state);
-
        if (ret) {
                DRM_ERROR("Atomic state validation failed with error :%d !\n", ret);
                return ret;
        }

        /*
-        * Hack: Commit needs planes right now, specifically for gamma
-        * TODO rework commit to check CRTC for gamma change
+        * 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.
         */
-       for_each_crtc_in_state(state, crtc, crtc_state, i) {
-               if (crtc_state->color_mgmt_changed) {
+       if (state->legacy_cursor_update) {
+               for_each_crtc_in_state(state, crtc, crtc_state, i) {
+                       if (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, crtc_state, i) {
+                       if (!crtc_state->enable)
+                               continue;
+
+                       ret = drm_atomic_add_affected_connectors(state, crtc);
+                       if (ret)
+                               return ret;
+
                        ret = drm_atomic_add_affected_planes(state, crtc);
                        if (ret)
                                goto fail;
--
2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-10-13 14:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1507884414-13974-1-git-send-email-shirish.s12@gmail.com>
     [not found] ` <BN6PR12MB18264CC2ACA29BB715F1F152F2480@BN6PR12MB1826.namprd12.prod.outlook.com>
     [not found]   ` <BN6PR12MB18264CC2ACA29BB715F1F152F2480-/b2+HYfkarSCndJ3FSsNdQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2017-10-13 14:45     ` [PATCH] drm/amd/display: add hardware_planes_only to list of affected planes S, Shirish

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.