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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 12 Jan 2012 17:54:50 +0100
Daniel Vetter <daniel at ffwll.ch> wrote:

> On Thu, Jan 12, 2012 at 17:08, Jesse Barnes <jbarnes at virtuousgeek.org> wrote:
> > 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.
> >
> > Signed-off-by: Jesse Barnes <jbarnes at virtuousgeek.org>
> >
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index 29743de..e3bfa50 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -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 */
> > diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
> > index b26e7c4..32909e3 100644
> > --- a/drivers/gpu/drm/i915/intel_sprite.c
> > +++ b/drivers/gpu/drm/i915/intel_sprite.c
> > @@ -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;
> > - ? ? ? }
> 
> 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...

-- 
Jesse Barnes, Intel Open Source Technology Center
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20120112/8352577a/attachment.pgp>


[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux