summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorDhaval Patel <pdhaval@quicinc.com>2016-10-10 10:20:17 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2016-10-10 10:20:17 -0700
commit563b1bceb855d3c51461091d0b038365caf579be (patch)
tree02dd4acbd97a5f96c3332af34c19a920662bc46c /drivers/gpu
parentde1c38caa7d9bc36687741d8d61bec528bbb2712 (diff)
parent0043536acfd2dd8890eb58004866e0cf14e73d81 (diff)
Merge "drm/msm/sde: break out plane decimation to separate properties" into dev/msm-4.4-drm_kms
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);