diff options
author | Weizhung Ding <weizhungding@google.com> | 2022-09-29 21:54:49 +0800 |
---|---|---|
committer | TreeHugger Robot <treehugger-gerrit@google.com> | 2023-01-04 00:31:45 +0000 |
commit | 0aa5f9e85f1eae017e325f62dcc2d8384be4a1c1 (patch) | |
tree | b18d69486b48dd59f2a8bad839a4dec216f15b0f /samsung | |
parent | 788303615c3a549040404a99fcf20616248e5f60 (diff) | |
download | display-0aa5f9e85f1eae017e325f62dcc2d8384be4a1c1.tar.gz |
drm: samsung: add rcd_id property
Add property to report rcd id.
Bug: 227584297
Test: get rcd id in hwc
Change-Id: I0c38eaa310f9b18c946805a7904e56f123dd2ab7
Signed-off-by: Weizhung Ding <weizhungding@google.com>
Diffstat (limited to 'samsung')
-rw-r--r-- | samsung/exynos_drm_crtc.c | 26 | ||||
-rw-r--r-- | samsung/exynos_drm_drv.h | 1 |
2 files changed, 27 insertions, 0 deletions
diff --git a/samsung/exynos_drm_crtc.c b/samsung/exynos_drm_crtc.c index 6a5987a..eff9eb8 100644 --- a/samsung/exynos_drm_crtc.c +++ b/samsung/exynos_drm_crtc.c @@ -624,6 +624,8 @@ static int exynos_drm_crtc_get_property(struct drm_crtc *crtc, dma_buf_fd(exynos_crtc_state->cgc_gem->dma_buf, 0) : 0; else if (property == exynos_crtc->props.expected_present_time) *val = exynos_crtc_state->expected_present_time; + else if (property == exynos_crtc->props.rcd_plane_id) + *val = decon->rcd->plane.base.base.id; else return -EINVAL; @@ -881,6 +883,23 @@ exynos_drm_crtc_create_partial_property(struct exynos_drm_crtc *exynos_crtc) return 0; } +static int exynos_drm_crtc_create_rcd_id_property(struct exynos_drm_crtc *exynos_crtc, + u32 rcd_plane_id) +{ + struct drm_crtc *crtc = &exynos_crtc->base; + struct drm_property *prop; + + prop = drm_property_create_range(crtc->dev, DRM_MODE_PROP_IMMUTABLE, "rcd_plane_id", 0, + UINT_MAX); + if (!prop) + return -ENOMEM; + + drm_object_attach_property(&crtc->base, prop, rcd_plane_id); + exynos_crtc->props.rcd_plane_id = prop; + + return 0; +} + struct exynos_drm_crtc *exynos_drm_crtc_create(struct drm_device *drm_dev, struct drm_plane *plane, enum exynos_drm_output_type type, @@ -972,6 +991,13 @@ struct exynos_drm_crtc *exynos_drm_crtc_create(struct drm_device *drm_dev, goto err_crtc; } + if (decon->rcd) { + ret = exynos_drm_crtc_create_rcd_id_property(exynos_crtc, + decon->rcd->plane.base.base.id); + if (ret) + goto err_crtc; + } + ret = exynos_drm_crtc_create_partial_property(exynos_crtc); if (ret) goto err_crtc; diff --git a/samsung/exynos_drm_drv.h b/samsung/exynos_drm_drv.h index 3a56368..88ea0b8 100644 --- a/samsung/exynos_drm_drv.h +++ b/samsung/exynos_drm_drv.h @@ -318,6 +318,7 @@ struct exynos_drm_crtc { struct drm_property *partial; struct drm_property *cgc_lut_fd; struct drm_property *expected_present_time; + struct drm_property *rcd_plane_id; } props; u8 active_state; u32 rcd_plane_mask; |