diff options
author | Rob Clark <rob@ti.com> | 2012-05-17 02:23:27 -0600 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2012-05-22 10:54:30 +0100 |
commit | 4d93914ae3db4a897ead4b1e33eca7cdfff4c6f7 (patch) | |
tree | 8e7c7b6ce6012f717e0c32929f5d632c930be745 /drivers/gpu/drm/drm_crtc.c | |
parent | 49e2754578b9f99bde18ad318d888a462d271479 (diff) |
drm: add plane properties
The omapdrm driver uses this for setting per-overlay rotation. It
is likely also useful for setting YUV->RGB colorspace conversion
matrix, etc.
Signed-off-by: Rob Clark <rob@ti.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/drm_crtc.c')
-rw-r--r-- | drivers/gpu/drm/drm_crtc.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index e3135c7ee87..92cea9d77ec 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -608,6 +608,7 @@ int drm_plane_init(struct drm_device *dev, struct drm_plane *plane, if (ret) goto out; + plane->base.properties = &plane->properties; plane->dev = dev; plane->funcs = funcs; plane->format_types = kmalloc(sizeof(uint32_t) * format_count, @@ -3199,6 +3200,21 @@ static int drm_mode_crtc_set_obj_prop(struct drm_mode_object *obj, return ret; } +static int drm_mode_plane_set_obj_prop(struct drm_mode_object *obj, + struct drm_property *property, + uint64_t value) +{ + int ret = -EINVAL; + struct drm_plane *plane = obj_to_plane(obj); + + if (plane->funcs->set_property) + ret = plane->funcs->set_property(plane, property, value); + if (!ret) + drm_object_property_set_value(obj, property, value); + + return ret; +} + int drm_mode_obj_get_properties_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv) { @@ -3300,6 +3316,9 @@ int drm_mode_obj_set_property_ioctl(struct drm_device *dev, void *data, case DRM_MODE_OBJECT_CRTC: ret = drm_mode_crtc_set_obj_prop(arg_obj, property, arg->value); break; + case DRM_MODE_OBJECT_PLANE: + ret = drm_mode_plane_set_obj_prop(arg_obj, property, arg->value); + break; } out: |