All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH v2 3/7] drm/i915: Fix fbdev sprite disable code
Date: Mon, 3 Jun 2013 15:44:32 +0300	[thread overview]
Message-ID: <20130603124432.GB5004@intel.com> (raw)
In-Reply-To: <20130603120000.GM15743@phenom.ffwll.local>

On Mon, Jun 03, 2013 at 02:00:00PM +0200, Daniel Vetter wrote:
> On Fri, May 31, 2013 at 08:07:03PM +0300, ville.syrjala@linux.intel.com wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > plane->enabled is never set, so this code didn't do anything.
> > 
> > Fix the code for sprites by calling the new drm_plane_force_disable()
> > function. That means the plane will remain off until someone explicitly
> > turns it back on.
> > 
> > And do the same for cursors and the old video overlays, since we only
> > want to see the primary plane for fbdev.
> > 
> > v2: Disable sprites/cursors until explicitly re-enabled
> > 
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_display.c | 16 ++++++++++++++++
> >  drivers/gpu/drm/i915/intel_drv.h     |  1 +
> >  drivers/gpu/drm/i915/intel_fb.c      |  9 ++-------
> >  3 files changed, 19 insertions(+), 7 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index 944b6d5..1d1a3fd 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -9842,3 +9842,19 @@ intel_display_print_error_state(struct drm_i915_error_state_buf *m,
> >  	}
> >  }
> >  #endif
> > +
> > +void intel_disable_cursors_and_sprites(struct drm_device *dev)
> > +{
> > +	struct drm_crtc *crtc;
> > +	struct drm_plane *plane;
> > +
> > +	list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
> > +		intel_crtc_dpms_overlay(to_intel_crtc(crtc), false);
> > +		intel_crtc_cursor_set(crtc, NULL, 0, 0, 0);
> > +	}
> 
> I still think we should just move this into drm_fb_helper_restore_fbdev_mode:
> - Cursors can be killed with crtc->funcs->cursor_set(crtc, NULL, 0, 0, 0);
>   Or at least we should be able to do so, I've done a quick audit of all
>   drivers and none really cares about file_priv if the handle is 0. Of
>   course we should put that into a drm_cursor_force_disable helper to
>   prepare for a better world (atomic modeset and all ...).
> 
>   vmwgfx needs to be fixed up slightly since it derefences file_priv
>   outside of a handle != 0 check, but that one can be trivially fixed for
>   both cursor_set callbacks by moving the driver_private dereference into
>   the if block.
> 
> - Legacy overlay stuff has been broken like that forever, and at least on
>   i8xx those are used much more often. Imo whoever's offended by gen2
>   being a bit broken can write a drm plane wrapper for the overlay stuff
>   (or better, move the code to drm planes and convert the ioctl to be a
>   shim around the real drm plane interfaces). I don't think we should add
>   hacks for that.

OK I give up. I did a quick check of the private plane stuff, and it
turns out they're not on plane_list, so I think just walking the list
and disabling everything there should be OK. Since you're happy w/
leaving the video overlay out in the cold for now, I'll shovel it all
into drm_fb_helper...


-- 
Ville Syrjälä
Intel OTC

  reply	other threads:[~2013-06-03 12:44 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-31 17:07 [PATCH 0/7] drm/i915: fbdev mode restoration improvements v2 ville.syrjala
2013-05-31 17:07 ` [PATCH v2 1/7] drm: Add fb_helper->restore_fbdev_mode hook ville.syrjala
2013-06-03  9:50   ` Chris Wilson
2013-05-31 17:07 ` [PATCH 2/7] drm: Add drm_plane_force_disable() ville.syrjala
2013-05-31 17:07 ` [PATCH v2 3/7] drm/i915: Fix fbdev sprite disable code ville.syrjala
2013-06-03  9:53   ` Chris Wilson
2013-06-03 12:00   ` Daniel Vetter
2013-06-03 12:44     ` Ville Syrjälä [this message]
2013-05-31 17:07 ` [PATCH v2 4/7] drm/i915: Use a custom restore_fbdev_mode hook ville.syrjala
2013-06-03 10:08   ` Chris Wilson
2013-05-31 17:07 ` [PATCH 5/7] drm/i915: Use container_of() in the fbdev code ville.syrjala
2013-06-03 10:08   ` Chris Wilson
2013-06-03 12:01     ` Daniel Vetter
2013-05-31 17:07 ` [PATCH 6/7] drm/i915: s/drm_i915_private_t/struct drm_i915_private/ ville.syrjala
2013-06-03 10:09   ` Chris Wilson
2013-06-03 12:01     ` [Intel-gfx] " Daniel Vetter
2013-05-31 17:07 ` [PATCH v2 7/7] drm: Remove some unused stuff from drm_plane ville.syrjala

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130603124432.GB5004@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.