summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRahul Sharma <rahsha@codeaurora.org>2019-01-22 15:27:02 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2019-02-08 00:50:07 -0800
commitc021cd0f307bb604a8244dd6e494ce701b4eae65 (patch)
tree3f099fb561278f73fd9a46d9199abcaa6b3ad0f7
parent6e84efb6ff902cb99af71f6f087ba4e69e82f73f (diff)
drm/msm/sde: set correct timeline at fence create
This change adds the offset to the associated timeline when the retire and release fences are created. The DRM client queries the fences using the atomic commit instead of set_property ioctl. So the sync point should contain the updated timeline before sending the FDs to client. Change-Id: I1ac9507934223bd1091be6960805c63cb4aacfb1 Signed-off-by: Abhijit Kulkarni <kabhijit@codeaurora.org> Signed-off-by: Rahul Sharma <rahsha@codeaurora.org>
-rw-r--r--drivers/gpu/drm/msm/sde/sde_connector.c5
-rw-r--r--drivers/gpu/drm/msm/sde/sde_crtc.c7
2 files changed, 11 insertions, 1 deletions
diff --git a/drivers/gpu/drm/msm/sde/sde_connector.c b/drivers/gpu/drm/msm/sde/sde_connector.c
index 5da02221103c..83aaeee13d73 100644
--- a/drivers/gpu/drm/msm/sde/sde_connector.c
+++ b/drivers/gpu/drm/msm/sde/sde_connector.c
@@ -477,7 +477,10 @@ static int sde_connector_atomic_set_property(struct drm_connector *connector,
if (!val)
goto end;
- rc = sde_fence_create(&c_conn->retire_fence, &fence_fd, 0);
+ /*
+ * update the the offset to a timeline for commit completion
+ */
+ rc = sde_fence_create(&c_conn->retire_fence, &fence_fd, 1);
if (rc) {
SDE_ERROR("fence create failed rc:%d\n", rc);
goto end;
diff --git a/drivers/gpu/drm/msm/sde/sde_crtc.c b/drivers/gpu/drm/msm/sde/sde_crtc.c
index 02b344410cfc..9805c8e8acb4 100644
--- a/drivers/gpu/drm/msm/sde/sde_crtc.c
+++ b/drivers/gpu/drm/msm/sde/sde_crtc.c
@@ -1720,6 +1720,13 @@ static int _sde_crtc_get_output_fence(struct drm_crtc *crtc,
offset = sde_crtc_get_property(cstate, CRTC_PROP_OUTPUT_FENCE_OFFSET);
+ /*
+ * Hwcomposer now queries the fences using the commit list in atomic
+ * commit ioctl. The offset should be set to next timeline
+ * which will be incremented during the prepare commit phase
+ */
+ offset++;
+
return sde_fence_create(&sde_crtc->output_fence, val, offset);
}