[Intel-gfx] [PATCH 48/58] drm/i915: use staged outuput config in tv->mode_fixup
Daniel Vetter
daniel at ffwll.ch
Thu Sep 6 09:30:01 CEST 2012
On Wed, Sep 05, 2012 at 11:02:15AM -0700, Jesse Barnes wrote:
> On Sun, 19 Aug 2012 21:13:05 +0200
> Daniel Vetter <daniel.vetter at ffwll.ch> wrote:
>
> > The "is this encoder cloned" check will be reused by the lvds encoder,
> > hence exract it.
> >
> > v2: Be a bit more careful about that we need to check the new, staged
> > ouput configuration in the check_non_cloned helper ...
> >
> > Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
> > ---
> > drivers/gpu/drm/i915/intel_display.c | 22 ++++++++++++++++++++++
> > drivers/gpu/drm/i915/intel_drv.h | 1 +
> > drivers/gpu/drm/i915/intel_tv.c | 7 ++-----
> > 3 files changed, 25 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index c7bd573..c59569e 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -6563,6 +6563,28 @@ static struct drm_crtc_helper_funcs intel_helper_funcs = {
> > .disable = intel_crtc_disable,
> > };
> >
> > +bool intel_encoder_check_non_cloned(struct intel_encoder *encoder)
> > +{
> > + struct intel_encoder *other_encoder;
> > + struct drm_crtc *crtc = &encoder->new_crtc->base;
> > +
> > + if (WARN_ON(!crtc))
> > + return true;
> > +
> > + list_for_each_entry(other_encoder,
> > + &crtc->dev->mode_config.encoder_list,
> > + base.head) {
> > +
> > + if (&other_encoder->new_crtc->base != crtc ||
> > + encoder == other_encoder)
> > + continue;
> > + else
> > + return false;
> > + }
> > +
> > + return true;
> > +}
>
> encoder_is_cloned() would make the callers more readable and avoid the
> double negative...
Ok, got a bit bored and applied this bikeshed here, too. Won't bother with
resending though.
-Daniel
--
Daniel Vetter
Mail: daniel at ffwll.ch
Mobile: +41 (0)79 365 57 48
More information about the Intel-gfx
mailing list