@@ -493,6 +493,12 @@ int drm_atomic_crtc_set_property(struct drm_crtc *crtc,
&replaced);
state->color_mgmt_changed |= replaced;
return ret;
+ } 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
@@ -535,6 +541,10 @@ drm_atomic_crtc_get_property(struct drm_crtc *crtc,
*val = (state->ctm) ? state->ctm->base.id : 0;
else if (property == config->gamma_lut_property)
*val = (state->gamma_lut) ? state->gamma_lut->base.id : 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
@@ -377,6 +377,10 @@ int drm_crtc_init_with_planes(struct drm_device *dev, struct drm_crtc *crtc,
if (drm_core_check_feature(dev, DRIVER_ATOMIC)) {
drm_object_attach_property(&crtc->base, config->prop_active, 0);
drm_object_attach_property(&crtc->base, config->prop_mode_id, 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;
@@ -943,6 +947,18 @@ 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;
}
@@ -197,6 +197,9 @@ struct drm_crtc_state {
struct drm_pending_vblank_event *event;
struct drm_atomic_state *state;
+
+ bool pipescaler_changed;
+ u32 src_w, src_h;
};
/**
@@ -1942,6 +1945,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.
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> --- drivers/gpu/drm/drm_atomic.c | 10 ++++++++++ drivers/gpu/drm/drm_crtc.c | 16 ++++++++++++++++ include/drm/drm_crtc.h | 7 +++++++ 3 files changed, 33 insertions(+)