[Intel-gfx] [PATCH] drm/atomic: allow setting a blob to NULL using id = 0

Lionel Landwerlin lionel.g.landwerlin at intel.com
Fri Dec 18 07:17:19 PST 2015


Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
---
 drivers/gpu/drm/drm_atomic.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index 65f007a..b8c90a4 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -403,12 +403,14 @@ EXPORT_SYMBOL(drm_atomic_set_mode_prop_for_crtc);
 static int drm_atomic_crtc_set_blob(struct drm_device *dev,
 	struct drm_property_blob **state_blob, uint32_t blob_id)
 {
-	struct drm_property_blob *blob;
+	struct drm_property_blob *blob = NULL;
 
-	blob = drm_property_lookup_blob(dev, blob_id);
-	if (!blob) {
-		DRM_DEBUG_KMS("Invalid Blob ID\n");
-		return -EINVAL;
+	if (blob_id != 0) {
+		blob = drm_property_lookup_blob(dev, blob_id);
+		if (!blob) {
+			DRM_DEBUG_KMS("Invalid Blob ID\n");
+			return -EINVAL;
+		}
 	}
 
 	if (*state_blob)
-- 
2.6.3



More information about the Intel-gfx mailing list