diff options
author | Nabendu Maiti <nabendu.bikash.maiti@intel.com> | 2017-02-24 11:10:46 +0200 |
---|---|---|
committer | Tapani Pälli <tapani.palli@intel.com> | 2017-03-28 09:36:12 +0300 |
commit | 5098d4efe497eb9c75b4c892774b5ca1e7c54d5c (patch) | |
tree | 504db552736b54c9b65b0afd4a7049d7a6f25618 | |
parent | c3ca5620be419c7e20c39d07f6cf7d1cb7c3bfc8 (diff) |
drm/i915: Add pipe scaler pipe source drm property
Initialization of pipe source size property as intel drm property to drm level
to dynamically change pipe source size.
Signed-off-by: Nabendu Maiti <nabendu.bikash.maiti@intel.com>
-rw-r--r-- | drivers/gpu/drm/drm_atomic.c | 10 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_crtc.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_mode_config.c | 11 | ||||
-rw-r--r-- | include/drm/drm_crtc.h | 3 | ||||
-rw-r--r-- | include/drm/drm_mode_config.h | 4 |
5 files changed, 32 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c index 9b892af7811a..f0e3e96ebf7b 100644 --- a/drivers/gpu/drm/drm_atomic.c +++ b/drivers/gpu/drm/drm_atomic.c @@ -516,6 +516,12 @@ int drm_atomic_crtc_set_property(struct drm_crtc *crtc, return -EFAULT; set_out_fence_for_crtc(state->state, crtc, fence_ptr); + } else if (property == config->prop_pipe_src_w) { + state->src_w = val; + state->pipescaler_changed = true; + } else if (property == config->prop_pipe_src_h) { + state->src_h = val; + state->pipescaler_changed = true; } else if (crtc->funcs->atomic_set_property) return crtc->funcs->atomic_set_property(crtc, state, property, val); else @@ -560,6 +566,10 @@ drm_atomic_crtc_get_property(struct drm_crtc *crtc, *val = (state->gamma_lut) ? state->gamma_lut->base.id : 0; else if (property == config->prop_out_fence_ptr) *val = 0; + else if (property == config->prop_pipe_src_w) + *val = state->src_w; + else if (property == config->prop_pipe_src_h) + *val = state->src_h; else if (crtc->funcs->atomic_get_property) return crtc->funcs->atomic_get_property(crtc, state, property, val); else diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index 660b4c8715de..989691264b6a 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -336,6 +336,10 @@ int drm_crtc_init_with_planes(struct drm_device *dev, struct drm_crtc *crtc, drm_object_attach_property(&crtc->base, config->prop_mode_id, 0); drm_object_attach_property(&crtc->base, config->prop_out_fence_ptr, 0); + drm_object_attach_property(&crtc->base, + config->prop_pipe_src_w, 0); + drm_object_attach_property(&crtc->base, + config->prop_pipe_src_h, 0); } return 0; diff --git a/drivers/gpu/drm/drm_mode_config.c b/drivers/gpu/drm/drm_mode_config.c index d9862259a2a7..c9a33d456803 100644 --- a/drivers/gpu/drm/drm_mode_config.c +++ b/drivers/gpu/drm/drm_mode_config.c @@ -337,6 +337,17 @@ static int drm_mode_create_standard_properties(struct drm_device *dev) return -ENOMEM; dev->mode_config.gamma_lut_size_property = prop; + prop = drm_property_create_range(dev, DRM_MODE_PROP_ATOMIC, + "PIPE_SRC_W", 0, INT_MAX); + if (!prop) + return -ENOMEM; + dev->mode_config.prop_pipe_src_w = prop; + prop = drm_property_create_range(dev, DRM_MODE_PROP_ATOMIC, + "PIPE_SRC_H", 0, INT_MAX); + if (!prop) + return -ENOMEM; + dev->mode_config.prop_pipe_src_h = prop; + return 0; } diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index 24dcb121bad4..d26184f2f05a 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h @@ -214,6 +214,9 @@ struct drm_crtc_state { struct drm_pending_vblank_event *event; struct drm_atomic_state *state; + + bool pipescaler_changed; + u32 src_w, src_h; }; /** diff --git a/include/drm/drm_mode_config.h b/include/drm/drm_mode_config.h index 579070ff06ef..a7857dd93164 100644 --- a/include/drm/drm_mode_config.h +++ b/include/drm/drm_mode_config.h @@ -536,6 +536,10 @@ struct drm_mode_config { */ struct drm_property *prop_mode_id; + /* pipe scaler properties */ + struct drm_property *prop_pipe_src_w; + struct drm_property *prop_pipe_src_h; + /** * @dvi_i_subconnector_property: Optional DVI-I property to * differentiate between analog or digital mode. |