Re: [Intel-gfx] [PATCH v2 13/17] drm/i915: Stop using mode->private_flags

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

 



On Tue, 07 Apr 2020, Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx> wrote:
> On Tue, Apr 07, 2020 at 09:38:47AM +0200, Daniel Vetter wrote:
>> On Fri, Apr 03, 2020 at 11:40:04PM +0300, Ville Syrjala wrote:
>> > From: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>
>> > 
>> > Replace the use of mode->private_flags with a truly private bitmaks
>> > in our own crtc state. We also need a copy in the crtc itself so the
>> > vblank code can get at it. We already have scanline_offset in there
>> > for a similar reason, as well as the vblank->hwmode which is assigned
>> > via drm_calc_timestamping_constants(). Fortunately we now have a
>> > nice place for doing the crtc_state->crtc copy in
>> > intel_crtc_update_active_timings() which gets called both for
>> > modesets and init/resume readout.
>> > 
>> > The one slightly iffy spot is the INHERITED flag which we want to
>> > preserve until userspace/fb_helper does the first proper commit after
>> > actually calling .detecti() on the connectors. Otherwise we don't have
>> > the full sink capabilities (audio,infoframes,etc.) when .compute_config()
>> > gets called and thus we will fail to enable those features when the
>> > first userspace commit happens. The only internal commit we do prior to
>> > that should be from intel_initial_commit() and there we can simply
>> > preserve the INHERITED flag from the readout.
>> > 
>> > CC: Sam Ravnborg <sam@xxxxxxxxxxxx>
>> > Cc: Daniel Vetter <daniel.vetter@xxxxxxxx>
>> > Cc: Emil Velikov <emil.l.velikov@xxxxxxxxx>
>> > Signed-off-by: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>
>> > ---
>> >  drivers/gpu/drm/i915/display/icl_dsi.c        | 13 ++++------
>> >  drivers/gpu/drm/i915/display/intel_atomic.c   |  1 +
>> >  drivers/gpu/drm/i915/display/intel_display.c  | 24 +++++++++++++------
>> >  .../drm/i915/display/intel_display_types.h    |  9 ++++++-
>> >  drivers/gpu/drm/i915/display/intel_tv.c       |  4 ++--
>> >  drivers/gpu/drm/i915/display/vlv_dsi.c        |  6 ++---
>> >  drivers/gpu/drm/i915/i915_irq.c               |  4 ++--
>> >  7 files changed, 37 insertions(+), 24 deletions(-)
>> > 
>> > diff --git a/drivers/gpu/drm/i915/display/icl_dsi.c b/drivers/gpu/drm/i915/display/icl_dsi.c
>> > index 99a25c0bb08f..4d6788ef2e5e 100644
>> > --- a/drivers/gpu/drm/i915/display/icl_dsi.c
>> > +++ b/drivers/gpu/drm/i915/display/icl_dsi.c
>> > @@ -1469,8 +1469,7 @@ static void gen11_dsi_get_config(struct intel_encoder *encoder,
>> >  	pipe_config->pipe_bpp = bdw_get_pipemisc_bpp(crtc);
>> >  
>> >  	if (gen11_dsi_is_periodic_cmd_mode(intel_dsi))
>> > -		pipe_config->hw.adjusted_mode.private_flags |=
>> > -					I915_MODE_FLAG_DSI_PERIODIC_CMD_MODE;
>> > +		pipe_config->mode_flags |= I915_MODE_FLAG_DSI_PERIODIC_CMD_MODE;
>> >  }
>> >  
>> >  static int gen11_dsi_dsc_compute_config(struct intel_encoder *encoder,
>> > @@ -1555,10 +1554,6 @@ static int gen11_dsi_compute_config(struct intel_encoder *encoder,
>> >  
>> >  	pipe_config->port_clock = afe_clk(encoder, pipe_config) / 5;
>> >  
>> > -	/* We would not operate in periodic command mode */
>> > -	pipe_config->hw.adjusted_mode.private_flags &=
>> > -					~I915_MODE_FLAG_DSI_PERIODIC_CMD_MODE;
>> > -
>> 
>> Since you delete this here, but not above (and then you could also detel
>> gen11_dsi_is_periodic_cmd_mode I think): It's dead code, maybe prep patch
>> to just garbage collect I915_MODE_FLAG_DSI_PERIODIC_CMD_MODE?
>
> I think this flag is still WIP. It was added very recently so I'm
> assuming there is some plan for it (not that I like adding half
> baked dead stuff like this). So we may want to wait a bit to see
> where it's going. The reason I deleted this specific statement is
> that we zero the crtc state before .compute_config() so this one
> would remain dead code even if the flag starts to get used for
> something.

It's part of a series that's halfway merged.

BR,
Jani.


>
>> 
>> I think the proper replacement is the mode flag stuff below, this is just
>> interim stuff that fell through the review.
>> 
>> With that prep patch to get rid of these 2 hunks above:
>> 
>> Reviewed-by: Daniel Vetter <daniel.vetter@xxxxxxxx>
>> 
>> Also surplus Acked-by: Daniel Vetter <daniel.vetter@xxxxxxxx> on the patch
>> to delete I915_MODE_FLAG_DSI_PERIODIC_CMD_MODE in case I miss the new
>> version.
>> 

-- 
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux