mirror of https://gitee.com/openkylin/linux.git
staging: drm/omap: only advertise rotation prop if supported
For hardware that does not have DMM/TILER, there is no rotation, so no point in getting userspace's hopes up. Signed-off-by: Rob Clark <rob@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
750af5e568
commit
c2a6a5528f
|
@ -659,19 +659,22 @@ static void dev_lastclose(struct drm_device *dev)
|
||||||
|
|
||||||
DBG("lastclose: dev=%p", dev);
|
DBG("lastclose: dev=%p", dev);
|
||||||
|
|
||||||
/* need to restore default rotation state.. not sure if there is
|
if (priv->rotation_prop) {
|
||||||
* a cleaner way to restore properties to default state? Maybe
|
/* need to restore default rotation state.. not sure
|
||||||
* a flag that properties should automatically be restored to
|
* if there is a cleaner way to restore properties to
|
||||||
* default state on lastclose?
|
* default state? Maybe a flag that properties should
|
||||||
*/
|
* automatically be restored to default state on
|
||||||
for (i = 0; i < priv->num_crtcs; i++) {
|
* lastclose?
|
||||||
drm_object_property_set_value(&priv->crtcs[i]->base,
|
*/
|
||||||
priv->rotation_prop, 0);
|
for (i = 0; i < priv->num_crtcs; i++) {
|
||||||
}
|
drm_object_property_set_value(&priv->crtcs[i]->base,
|
||||||
|
priv->rotation_prop, 0);
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < priv->num_planes; i++) {
|
for (i = 0; i < priv->num_planes; i++) {
|
||||||
drm_object_property_set_value(&priv->planes[i]->base,
|
drm_object_property_set_value(&priv->planes[i]->base,
|
||||||
priv->rotation_prop, 0);
|
priv->rotation_prop, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = drm_fb_helper_restore_fbdev_mode(priv->fbdev);
|
ret = drm_fb_helper_restore_fbdev_mode(priv->fbdev);
|
||||||
|
|
|
@ -416,23 +416,25 @@ void omap_plane_install_properties(struct drm_plane *plane,
|
||||||
struct omap_drm_private *priv = dev->dev_private;
|
struct omap_drm_private *priv = dev->dev_private;
|
||||||
struct drm_property *prop;
|
struct drm_property *prop;
|
||||||
|
|
||||||
prop = priv->rotation_prop;
|
if (priv->has_dmm) {
|
||||||
if (!prop) {
|
prop = priv->rotation_prop;
|
||||||
const struct drm_prop_enum_list props[] = {
|
if (!prop) {
|
||||||
{ DRM_ROTATE_0, "rotate-0" },
|
const struct drm_prop_enum_list props[] = {
|
||||||
{ DRM_ROTATE_90, "rotate-90" },
|
{ DRM_ROTATE_0, "rotate-0" },
|
||||||
{ DRM_ROTATE_180, "rotate-180" },
|
{ DRM_ROTATE_90, "rotate-90" },
|
||||||
{ DRM_ROTATE_270, "rotate-270" },
|
{ DRM_ROTATE_180, "rotate-180" },
|
||||||
{ DRM_REFLECT_X, "reflect-x" },
|
{ DRM_ROTATE_270, "rotate-270" },
|
||||||
{ DRM_REFLECT_Y, "reflect-y" },
|
{ DRM_REFLECT_X, "reflect-x" },
|
||||||
};
|
{ DRM_REFLECT_Y, "reflect-y" },
|
||||||
prop = drm_property_create_bitmask(dev, 0, "rotation",
|
};
|
||||||
props, ARRAY_SIZE(props));
|
prop = drm_property_create_bitmask(dev, 0, "rotation",
|
||||||
if (prop == NULL)
|
props, ARRAY_SIZE(props));
|
||||||
return;
|
if (prop == NULL)
|
||||||
priv->rotation_prop = prop;
|
return;
|
||||||
|
priv->rotation_prop = prop;
|
||||||
|
}
|
||||||
|
drm_object_attach_property(obj, prop, 0);
|
||||||
}
|
}
|
||||||
drm_object_attach_property(obj, prop, 0);
|
|
||||||
|
|
||||||
prop = priv->zorder_prop;
|
prop = priv->zorder_prop;
|
||||||
if (!prop) {
|
if (!prop) {
|
||||||
|
|
Loading…
Reference in New Issue