]> exis.tech > repos - linux.git/blobdiff - drivers/gpu/drm/drm_ioctl.c
Merge tag 'hwmon-for-v7.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/groec...
[linux.git] / drivers / gpu / drm / drm_ioctl.c
index e2df4becce629a0d7766bed94da0a5183f728e74..9039a39c43243ab59c9abcc43aeafd3a60b93178 100644 (file)
@@ -373,13 +373,25 @@ drm_setclientcap(struct drm_device *dev, void *data, struct drm_file *file_priv)
                        return -EINVAL;
                file_priv->supports_virtualized_cursor_plane = req->value;
                break;
-       case DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE:
+       case DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE: {
+               struct drm_plane *plane;
+               bool has_plane_with_color_pipeline = false;
+
                if (!file_priv->atomic)
                        return -EINVAL;
                if (req->value > 1)
                        return -EINVAL;
+               drm_for_each_plane(plane, dev) {
+                       if (plane->color_pipeline_property) {
+                               has_plane_with_color_pipeline = true;
+                               break;
+                       }
+               }
+               if (!has_plane_with_color_pipeline)
+                       return -EOPNOTSUPP;
                file_priv->plane_color_pipeline = req->value;
                break;
+       }
        default:
                return -EINVAL;
        }