Skip to contentSkip to conversation

drm/i915: sprite init failure on pre-SNB is not a failure

PATCH In review Jesse Barnes 3 participants 10 messages Jan 12, 2012 – Jan 14, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: sprite init failure on pre-SNB is not a failure

We can call the plane init function unconditionally, but don't need to complain if it fails, since that will only happen if we're out of memory (and other things will fail) or if we're on the wrong platform (which is ok).

And remove the DRM_ERRORs from the sprite code itself to avoid dmesg spam.

drivers/gpu/drm/i915/intel_display.c +3 -6
index 29743de..e3bfa50 100644
@@ -9027,12 +9027,9 @@ void intel_modeset_init(struct drm_device *dev)
 
 	for (i = 0; i < dev_priv->num_pipe; i++) {
 		intel_crtc_init(dev, i);
-		if (HAS_PCH_SPLIT(dev)) {
-			ret = intel_plane_init(dev, i);
-			if (ret)
-				DRM_ERROR("plane %d init failed: %d\n",
-					  i, ret);
-		}
+		ret = intel_plane_init(dev, i);
+		if (ret)
+			DRM_DEBUG_KMS("plane %d init failed: %d\n", i, ret);
 	}
 
 	/* Just disable it once at startup */
drivers/gpu/drm/i915/intel_sprite.c +2 -6
index b26e7c4..32909e3 100644
@@ -466,10 +466,8 @@ intel_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
 	mutex_lock(&dev->struct_mutex);
 
 	ret = intel_pin_and_fence_fb_obj(dev, obj, NULL);
-	if (ret) {
-		DRM_ERROR("failed to pin object\n");
+	if (ret)
 		goto out_unlock;
-	}
 
 	intel_plane->obj = obj;
 
@@ -632,10 +630,8 @@ intel_plane_init(struct drm_device *dev, enum pipe pipe)
 	unsigned long possible_crtcs;
 	int ret;
 
-	if (!(IS_GEN6(dev) || IS_GEN7(dev))) {
-		DRM_ERROR("new plane code only for SNB+\n");
+	if (!(IS_GEN6(dev) || IS_GEN7(dev)))
 		return -ENODEV;
-	}
 
 	intel_plane = kzalloc(sizeof(struct intel_plane), GFP_KERNEL);
 	if (!intel_plane)

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#1 lore raw
Quoted 47 lines · Jesse Barnes

We can call the plane init function unconditionally, but don't need to complain if it fails, since that will only happen if we're out of memory (and other things will fail) or if we're on the wrong platform (which is ok).

And remove the DRM_ERRORs from the sprite code itself to avoid dmesg spam.

drivers/gpu/drm/i915/intel_display.c +3 -6
index 29743de..e3bfa50 100644
@@ -9027,12 +9027,9 @@ void intel_modeset_init(struct drm_device *dev)
 
        for (i = 0; i < dev_priv->num_pipe; i++) {
                intel_crtc_init(dev, i);
-               if (HAS_PCH_SPLIT(dev)) {
-                       ret = intel_plane_init(dev, i);
-                       if (ret)
-                               DRM_ERROR("plane %d init failed: %d\n",
-                                         i, ret);
-               }
+               ret = intel_plane_init(dev, i);
+               if (ret)
+                       DRM_DEBUG_KMS("plane %d init failed: %d\n", i, ret);
        }
 
        /* Just disable it once at startup */
drivers/gpu/drm/i915/intel_sprite.c +1 -3
index b26e7c4..32909e3 100644
@@ -466,10 +466,8 @@ intel_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
        mutex_lock(&dev->struct_mutex);
 
        ret = intel_pin_and_fence_fb_obj(dev, obj, NULL);
-       if (ret) {
-               DRM_ERROR("failed to pin object\n");
+       if (ret)
                goto out_unlock;
-       }
 
        intel_plane->obj = obj;
 

drivers/gpu/drm/i915/intel_sprite.c intel_plane_init(struct drm_device *dev, enum pipe pipe) · line 638

Quoted 8 lines
drivers/gpu/drm/i915/intel_sprite.c +1 -3
@@ -632,10 +630,8 @@ intel_plane_init(struct drm_device *dev, enum pipe pipe)
        unsigned long possible_crtcs;
        int ret;
 
-       if (!(IS_GEN6(dev) || IS_GEN7(dev))) {
-               DRM_ERROR("new plane code only for SNB+\n");
+       if (!(IS_GEN6(dev) || IS_GEN7(dev)))
                return -ENODEV;
-       }

Why not return 0; to avoid the "plane init" spam at kms debug level? After all, nothing failed, there's just no plane there to init ... -Daniel

Signature · 2 lines
Daniel Vetter
[email protected] - +41 (0) 79 364 57 48 - http://blog.ffwll.ch
#2 lore raw
Quoted 51 lines · On Thu, 12 Jan 2012 17:54:50 +0100 Daniel Vetter <[email protected]> wrote:
Quoted 50 lines · Jesse Barnes

We can call the plane init function unconditionally, but don't need to complain if it fails, since that will only happen if we're out of memory (and other things will fail) or if we're on the wrong platform (which is ok).

And remove the DRM_ERRORs from the sprite code itself to avoid dmesg spam.

drivers/gpu/drm/i915/intel_display.c +3 -6
index 29743de..e3bfa50 100644
@@ -9027,12 +9027,9 @@ void intel_modeset_init(struct drm_device *dev)
 
        for (i = 0; i < dev_priv->num_pipe; i++) {
                intel_crtc_init(dev, i);
-               if (HAS_PCH_SPLIT(dev)) {
-                       ret = intel_plane_init(dev, i);
-                       if (ret)
-                               DRM_ERROR("plane %d init failed: %d\n",
-                                         i, ret);
-               }
+               ret = intel_plane_init(dev, i);
+               if (ret)
+                       DRM_DEBUG_KMS("plane %d init failed: %d\n", i, ret);
        }
 
        /* Just disable it once at startup */
drivers/gpu/drm/i915/intel_sprite.c +1 -3
index b26e7c4..32909e3 100644
@@ -466,10 +466,8 @@ intel_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
        mutex_lock(&dev->struct_mutex);
 
        ret = intel_pin_and_fence_fb_obj(dev, obj, NULL);
-       if (ret) {
-               DRM_ERROR("failed to pin object\n");
+       if (ret)
                goto out_unlock;
-       }
 
        intel_plane->obj = obj;
 
@@ -632,10 +630,8 @@ intel_plane_init(struct drm_device *dev, enum pipe pipe)
        unsigned long possible_crtcs;
        int ret;
 
Quoted 8 lines

drivers/gpu/drm/i915/intel_sprite.c intel_plane_init(struct drm_device *dev, enum pipe pipe) · line 638

Quoted 5 lines
drivers/gpu/drm/i915/intel_sprite.c +1 -3
-       if (!(IS_GEN6(dev) || IS_GEN7(dev))) {
-               DRM_ERROR("new plane code only for SNB+\n");
+       if (!(IS_GEN6(dev) || IS_GEN7(dev)))
                return -ENODEV;
-       }

Why not return 0; to avoid the "plane init" spam at kms debug level? After all, nothing failed, there's just no plane there to init ...

ENODEV actually does tell you why the init failed, in case you want to look at the debug logs...

Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#4 lore raw
Quoted 6 lines · Keith Packard
Quoted 2 lines · Jesse Barnes

ENODEV actually does tell you why the init failed, in case you want to look at the debug logs...

Daniel -- are you OK with merging this as-is? It seems fine to me.

That was just a bit of random bikeshedding and we won't see it anyway as opposed to the overly load DRM_ERROR, i.e. I'm fine as-is. -Daniel

Signature · 3 lines
Daniel Vetter
Mail: [email protected]
Mobile: +41 (0)79 365 57 48
#6 lore raw
In reply to Jesse Barnes
Quoted 4 lines · Jesse Barnes

We can call the plane init function unconditionally, but don't need to complain if it fails, since that will only happen if we're out of memory (and other things will fail) or if we're on the wrong platform (which is ok).

Can you please fix your mailer to stop sending patches in quotable printed form? git-am doesn't seem to like it at all...

Signature · 1 line
[email protected]

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#7 lore raw
Quoted 8 lines · On Fri, 13 Jan 2012 15:50:14 -0800 Keith Packard <[email protected]> wrote:
Quoted 4 lines · Jesse Barnes

We can call the plane init function unconditionally, but don't need to complain if it fails, since that will only happen if we're out of memory (and other things will fail) or if we're on the wrong platform (which is ok).

Can you please fix your mailer to stop sending patches in quotable printed form? git-am doesn't seem to like it at all...

Hm wtf... /me tries. Yeah how did that happen. /me fixes claws config.

Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
#8 lore raw
In reply to Keith Packard
Quoted 8 lines · On Fri, 13 Jan 2012 15:50:14 -0800 Keith Packard <[email protected]> wrote:
Quoted 4 lines · Jesse Barnes

We can call the plane init function unconditionally, but don't need to complain if it fails, since that will only happen if we're out of memory (and other things will fail) or if we're on the wrong platform (which is ok).

Can you please fix your mailer to stop sending patches in quotable printed form? git-am doesn't seem to like it at all...

Looks like signing the message the way I did caused it to be packaged differently. Then I also had word wrap fail on the inserted file when I sent it to myself as plaintext. Lame. I'll be more careful in future.

Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
#9 lore raw
Quoted 4 lines · Jesse Barnes

Looks like signing the message the way I did caused it to be packaged differently. Then I also had word wrap fail on the inserted file when I sent it to myself as plaintext. Lame. I'll be more careful in future.

I managed to pull it apart with 'munpack' and apply it by hand, 'cause someone told me to be tolerant and helpful when accepting patches.

Signature · 1 line
[email protected]

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx