summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorClarence Ip <cip@codeaurora.org>2016-09-27 17:43:10 -0400
committerClarence Ip <cip@codeaurora.org>2016-10-05 10:54:02 -0400
commit0043536acfd2dd8890eb58004866e0cf14e73d81 (patch)
tree50aa7899303b4eec90a753a0767b769e8d0024ac /drivers/gpu
parent2ec153e47e2aaa9f3bf8f658dce60cc5160f2177 (diff)
drm/msm/sde: break out plane decimation to separate properties
Separate the horizontal and vertical decimation configuration to separate properties instead of bundling them with the scaler property. This allows for some planes to support decimation even if the customized scaler configuration is not available. Change-Id: Icdb16d41139f2a90ffb4dc8a6fa73de5336f892a Signed-off-by: Clarence Ip <cip@codeaurora.org>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/msm/msm_drv.h2
-rw-r--r--drivers/gpu/drm/msm/sde/sde_hw_catalog_8996.c4
-rw-r--r--drivers/gpu/drm/msm/sde/sde_plane.c68
3 files changed, 27 insertions, 47 deletions
diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h
index 2266d2ab2f00..136366a58b1a 100644
--- a/drivers/gpu/drm/msm/msm_drv.h
+++ b/drivers/gpu/drm/msm/msm_drv.h
@@ -91,6 +91,8 @@ enum msm_mdp_plane_property {
PLANE_PROP_ZPOS = PLANE_PROP_BLOBCOUNT,
PLANE_PROP_ALPHA,
PLANE_PROP_COLOR_FILL,
+ PLANE_PROP_H_DECIMATE,
+ PLANE_PROP_V_DECIMATE,
PLANE_PROP_INPUT_FENCE,
/* enum/bitmask properties */
diff --git a/drivers/gpu/drm/msm/sde/sde_hw_catalog_8996.c b/drivers/gpu/drm/msm/sde/sde_hw_catalog_8996.c
index 437f02718174..d32c280fb073 100644
--- a/drivers/gpu/drm/msm/sde/sde_hw_catalog_8996.c
+++ b/drivers/gpu/drm/msm/sde/sde_hw_catalog_8996.c
@@ -322,8 +322,8 @@ static inline int set_cfg_1xx_init(struct sde_mdss_cfg *cfg)
static const struct sde_sspp_sub_blks cursor = {
.maxlinewidth = 128,
.maxdwnscale = 1, .maxupscale = 1,
- .maxhdeciexp = DECIMATION_17X_MAX_H,
- .maxvdeciexp = DECIMATION_17X_MAX_V,
+ .maxhdeciexp = 0,
+ .maxvdeciexp = 0,
.src_blk = {.id = SDE_SSPP_SRC, .base = 0x00, .len = 0x150,},
.scaler_blk = {.id = 0, .base = 0x00, .len = 0x0,},
.csc_blk = {.id = 0, .base = 0x00, .len = 0x0,},
diff --git a/drivers/gpu/drm/msm/sde/sde_plane.c b/drivers/gpu/drm/msm/sde/sde_plane.c
index 661695eaf72d..6e3268608565 100644
--- a/drivers/gpu/drm/msm/sde/sde_plane.c
+++ b/drivers/gpu/drm/msm/sde/sde_plane.c
@@ -817,14 +817,10 @@ static void _sde_plane_setup_scaler(struct sde_plane *psde,
}
}
- /* decimation */
- if (sc_u1 && (sc_u1->enable & SDE_DRM_SCALER_DECIMATE)) {
- psde->pipe_cfg.horz_decimation = sc_u1->horz_decimate;
- psde->pipe_cfg.vert_decimation = sc_u1->vert_decimate;
- } else {
- psde->pipe_cfg.horz_decimation = 0;
- psde->pipe_cfg.vert_decimation = 0;
- }
+ psde->pipe_cfg.horz_decimation =
+ sde_plane_get_property(pstate, PLANE_PROP_H_DECIMATE);
+ psde->pipe_cfg.vert_decimation =
+ sde_plane_get_property(pstate, PLANE_PROP_V_DECIMATE);
/* don't chroma subsample if decimating */
chroma_subsmpl_h = psde->pipe_cfg.horz_decimation ? 1 :
@@ -1043,6 +1039,10 @@ static int _sde_plane_mode_set(struct drm_plane *plane,
while ((idx = msm_property_pop_dirty(&psde->property_info)) >= 0) {
switch (idx) {
case PLANE_PROP_SCALER:
+ case PLANE_PROP_H_DECIMATE:
+ case PLANE_PROP_V_DECIMATE:
+ case PLANE_PROP_SRC_CONFIG:
+ case PLANE_PROP_ZPOS:
pstate->dirty |= SDE_PLANE_DIRTY_RECTS;
break;
case PLANE_PROP_CSC_V1:
@@ -1055,10 +1055,6 @@ static int _sde_plane_mode_set(struct drm_plane *plane,
case PLANE_PROP_ROTATION:
pstate->dirty |= SDE_PLANE_DIRTY_FORMAT;
break;
- case PLANE_PROP_SRC_CONFIG:
- case PLANE_PROP_ZPOS:
- pstate->dirty |= SDE_PLANE_DIRTY_RECTS;
- break;
case PLANE_PROP_INFO:
case PLANE_PROP_ALPHA:
case PLANE_PROP_INPUT_FENCE:
@@ -1290,42 +1286,13 @@ static void _sde_plane_atomic_check_mode_changed(struct sde_plane *psde,
}
}
-static bool __get_scale_data(struct sde_plane *psde,
- struct sde_plane_state *pstate, struct sde_drm_scaler *sc_u,
- size_t *sc_u_size)
-{
- bool valid_flag = false;
-
- sc_u = msm_property_get_blob(&psde->property_info,
- pstate->property_blobs,
- sc_u_size,
- PLANE_PROP_SCALER);
- if (sc_u) {
- switch (sc_u->version) {
- case SDE_DRM_SCALER_V1:
- if (!_sde_plane_verify_blob(sc_u, *sc_u_size,
- &sc_u->v1, sizeof(struct sde_drm_scaler_v1)))
- valid_flag = true;
- break;
- default:
- SDE_DEBUG("unrecognized scaler blob v%lld\n",
- sc_u->version);
- break;
- }
- }
-
- return valid_flag;
-}
-
static int sde_plane_atomic_check(struct drm_plane *plane,
struct drm_plane_state *state)
{
- int ret = 0, valid_scale_data;
+ int ret = 0;
struct sde_plane *psde;
struct sde_plane_state *pstate;
const struct sde_format *fmt;
- size_t sc_u_size = 0;
- struct sde_drm_scaler *sc_u = NULL;
struct sde_rect src, dst;
uint32_t deci_w, deci_h, src_deci_w, src_deci_h;
uint32_t max_upscale, max_downscale, min_src_size, max_linewidth;
@@ -1346,9 +1313,8 @@ static int sde_plane_atomic_check(struct drm_plane *plane,
goto exit;
}
- valid_scale_data = __get_scale_data(psde, pstate, sc_u, &sc_u_size);
- deci_w = valid_scale_data && sc_u ? sc_u->v1.horz_decimate : 0;
- deci_h = valid_scale_data && sc_u ? sc_u->v1.vert_decimate : 0;
+ deci_w = sde_plane_get_property(pstate, PLANE_PROP_H_DECIMATE);
+ deci_h = sde_plane_get_property(pstate, PLANE_PROP_V_DECIMATE);
/* src values are in Q16 fixed point, convert to integer */
POPULATE_RECT(&src, state->src_x, state->src_y, state->src_w,
@@ -1536,6 +1502,18 @@ static void _sde_plane_install_properties(struct drm_plane *plane,
msm_property_install_range(&psde->property_info, "input_fence",
0x0, 0, INR_OPEN_MAX, 0, PLANE_PROP_INPUT_FENCE);
+ if (psde->pipe_sblk->maxhdeciexp) {
+ msm_property_install_range(&psde->property_info, "h_decimate",
+ 0x0, 0, psde->pipe_sblk->maxhdeciexp, 0,
+ PLANE_PROP_H_DECIMATE);
+ }
+
+ if (psde->pipe_sblk->maxvdeciexp) {
+ msm_property_install_range(&psde->property_info, "v_decimate",
+ 0x0, 0, psde->pipe_sblk->maxvdeciexp, 0,
+ PLANE_PROP_V_DECIMATE);
+ }
+
if (psde->features & BIT(SDE_SSPP_CSC)) {
msm_property_install_volatile_range(&psde->property_info,
"csc_v1", 0x0, 0, ~0, 0, PLANE_PROP_CSC_V1);