[DPU PATCH v2 5/6] drm/msm: hook up DPU with upstream DSI
Sean Paul
seanpaul at chromium.org
Thu May 17 21:01:45 UTC 2018
On Thu, Apr 19, 2018 at 04:52:03PM -0700, Jeykumar Sankaran wrote:
> Switch DPU from dsi-staging to upstream dsi driver. To make
> the switch atomic, this change includes:
> - remove dpu connector layers
> - clean up dpu connector dependencies in encoder/crtc
> - compile out writeback and display port drivers
> - compile out dsi-staging driver (separate patch submitted to
> remove the driver)
> - adapt upstream device hierarchy
>
> changes in v2:
> - remove files not applicable upstream (Sean Paul)
> - remove compiled out non-dsi display init (Sean Paul)
> - split unrelated changes into separate patch set (Sean Paul)
>
> Signed-off-by: Jeykumar Sankaran <jsanka at codeaurora.org>
> ---
> drivers/gpu/drm/msm/Makefile | 1 -
> drivers/gpu/drm/msm/disp/dpu1/dpu_connector.c | 1184 --------------------
> drivers/gpu/drm/msm/disp/dpu1/dpu_connector.h | 555 ---------
> drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 9 -
> drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 179 +--
> drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h | 10 +-
> drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h | 8 +-
> .../gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c | 6 +-
> drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 489 +-------
> drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h | 6 -
> drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c | 54 +-
> drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h | 11 +
> drivers/gpu/drm/msm/dpu_dbg.c | 3 -
> drivers/gpu/drm/msm/msm_drv.c | 47 +-
> drivers/gpu/drm/msm/msm_drv.h | 39 -
> 15 files changed, 158 insertions(+), 2443 deletions(-)
> delete mode 100644 drivers/gpu/drm/msm/disp/dpu1/dpu_connector.c
> delete mode 100644 drivers/gpu/drm/msm/disp/dpu1/dpu_connector.h
>
/snip
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c
> index c8c12d3..af8205f 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c
> @@ -23,7 +23,6 @@
> #include "dpu_hw_intf.h"
> #include "dpu_hw_wb.h"
> #include "dpu_encoder.h"
> -#include "dpu_connector.h"
>
> #define RESERVED_BY_OTHER(h, r) \
> ((h)->rsvp && ((h)->rsvp->enc_id != (r)->enc_id))
> @@ -158,6 +157,18 @@ struct dpu_hw_mdp *dpu_rm_get_mdp(struct dpu_rm *rm)
> return rm->hw_mdp;
> }
>
> +enum dpu_rm_topology_name
> +dpu_rm_get_topology_name(struct msm_display_topology topology)
> +{
> + int i;
> +
> + for (i = 0; i < DPU_RM_TOPOLOGY_MAX; i++)
> + if (RM_IS_TOPOLOGY_MATCH(g_top_table[i], topology))
> + return g_top_table[i].top_name;
> +
> + return DPU_RM_TOPOLOGY_NONE;
> +}
> +
> void dpu_rm_init_hw_iter(
> struct dpu_rm_hw_iter *iter,
> uint32_t enc_id,
> @@ -954,20 +965,19 @@ static int _dpu_rm_populate_requirements(
> struct drm_encoder *enc,
> struct drm_crtc_state *crtc_state,
> struct drm_connector_state *conn_state,
> - struct dpu_rm_requirements *reqs)
> + struct dpu_rm_requirements *reqs,
> + struct msm_display_topology req_topology)
> {
> const struct drm_display_mode *mode = &crtc_state->mode;
> int i;
>
> memset(reqs, 0, sizeof(*reqs));
>
> - reqs->top_ctrl = dpu_connector_get_property(conn_state,
> - CONNECTOR_PROP_TOPOLOGY_CONTROL);
> dpu_encoder_get_hw_resources(enc, &reqs->hw_res, conn_state);
>
> for (i = 0; i < DPU_RM_TOPOLOGY_MAX; i++) {
> if (RM_IS_TOPOLOGY_MATCH(g_top_table[i],
> - reqs->hw_res.topology)) {
> + req_topology)) {
> reqs->topology = &g_top_table[i];
> break;
> }
> @@ -978,10 +988,6 @@ static int _dpu_rm_populate_requirements(
> return -EINVAL;
> }
>
> - /* DSC blocks are hardwired for control path 0 and 1 */
> - if (reqs->topology->num_comp_enc)
> - reqs->top_ctrl |= BIT(DPU_RM_TOPCTL_DSPP);
> -
> /**
> * Set the requirement based on caps if not set from user space
> * This will ensure to select LM tied with DS blocks
> @@ -1110,9 +1116,6 @@ void dpu_rm_release(struct dpu_rm *rm, struct drm_encoder *enc)
> goto end;
> }
>
> - top_ctrl = dpu_connector_get_property(conn->state,
> - CONNECTOR_PROP_TOPOLOGY_CONTROL);
> -
> if (top_ctrl & BIT(DPU_RM_TOPCTL_RESERVE_LOCK)) {
../drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c: In function ‘dpu_rm_release’:
../drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c:1119:15: warning: ‘top_ctrl’ may be used uninitialized in this function [-Wmaybe-uninitialized]
> DPU_DEBUG("rsvp[s%de%d] not releasing locked resources\n",
> rsvp->seq, rsvp->enc_id);
> @@ -1120,12 +1123,6 @@ void dpu_rm_release(struct dpu_rm *rm, struct drm_encoder *enc)
> DPU_DEBUG("release rsvp[s%de%d]\n", rsvp->seq,
> rsvp->enc_id);
> _dpu_rm_release_rsvp(rm, rsvp, conn);
> -
> - (void) msm_property_set_property(
> - dpu_connector_get_propinfo(conn),
> - dpu_connector_get_property_state(conn->state),
> - CONNECTOR_PROP_TOPOLOGY_NAME,
> - DPU_RM_TOPOLOGY_NONE);
> }
>
> end:
> @@ -1141,18 +1138,6 @@ static int _dpu_rm_commit_rsvp(
> enum dpu_hw_blk_type type;
> int ret = 0;
>
> - ret = msm_property_set_property(
> - dpu_connector_get_propinfo(conn_state->connector),
> - dpu_connector_get_property_state(conn_state),
> - CONNECTOR_PROP_TOPOLOGY_NAME,
> - rsvp->topology);
> - if (ret) {
> - DPU_ERROR("failed to set topology name property, ret %d\n",
> - ret);
> - _dpu_rm_release_rsvp(rm, rsvp, conn_state->connector);
> - return ret;
> - }
> -
> /* Swap next rsvp to be the active */
> for (type = 0; type < DPU_HW_BLK_MAX; type++) {
> list_for_each_entry(blk, &rm->hw_blks[type], list) {
> @@ -1177,6 +1162,7 @@ int dpu_rm_reserve(
> struct drm_encoder *enc,
> struct drm_crtc_state *crtc_state,
> struct drm_connector_state *conn_state,
> + struct msm_display_topology topology,
> bool test_only)
> {
> struct dpu_rm_rsvp *rsvp_cur, *rsvp_nxt;
> @@ -1202,7 +1188,7 @@ int dpu_rm_reserve(
> _dpu_rm_print_rsvps(rm, DPU_RM_STAGE_BEGIN);
>
> ret = _dpu_rm_populate_requirements(rm, enc, crtc_state,
> - conn_state, &reqs);
> + conn_state, &reqs, topology);
> if (ret) {
> DPU_ERROR("failed to populate hw requirements\n");
> goto end;
> @@ -1237,12 +1223,6 @@ int dpu_rm_reserve(
> _dpu_rm_release_rsvp(rm, rsvp_cur, conn_state->connector);
> rsvp_cur = NULL;
> _dpu_rm_print_rsvps(rm, DPU_RM_STAGE_AFTER_CLEAR);
> - (void) msm_property_set_property(
> - dpu_connector_get_propinfo(
> - conn_state->connector),
> - dpu_connector_get_property_state(conn_state),
> - CONNECTOR_PROP_TOPOLOGY_NAME,
> - DPU_RM_TOPOLOGY_NONE);
> }
>
> /* Check the proposed reservation, store it in hw's "next" field */
/snip
--
Sean Paul, Software Engineer, Google / Chromium OS
More information about the dri-devel
mailing list