diff mbox

[13/20] drm/i915: use current scaler state during readout_hw_state.

Message ID 1427943589-6254-14-git-send-email-chandra.konduru@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Chandra Konduru April 2, 2015, 2:59 a.m. UTC
During readout_hw_state, rebuild crtc scaler_state from hw state:
 - crtc scaler id
 - scaler users
 - scaling ratios

Signed-off-by: Chandra Konduru <chandra.konduru@intel.com>
---
 drivers/gpu/drm/i915/intel_display.c |    5 +++++
 1 file changed, 5 insertions(+)

Comments

Matt Roper April 2, 2015, 11:04 p.m. UTC | #1
On Wed, Apr 01, 2015 at 07:59:42PM -0700, Chandra Konduru wrote:
> During readout_hw_state, rebuild crtc scaler_state from hw state:
>  - crtc scaler id
>  - scaler users

This patch doesn't look like it actually does what you're advertising
here.  If your firmware or bootloader or whatever has programmed the
display in a way that some scalers are in use, I think your state
variables are still going to show all scalers as free after you're done
here, right?

>  - scaling ratios

I think this is the only thing that will actually match the hardware
state, but we've already noted that those state fields can probably just
go away since we can trivially calculate the proper values in the places
we're currently using them.


Matt

> 
> Signed-off-by: Chandra Konduru <chandra.konduru@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_display.c |    5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index aae4a22..834ea46 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -8756,6 +8756,11 @@ static bool haswell_get_pipe_config(struct intel_crtc *crtc,
>  
>  	intel_get_pipe_timings(crtc, pipe_config);
>  
> +	if (INTEL_INFO(dev)->gen >= 9) {
> +		skl_init_scalers(dev, crtc->pipe, pipe_config);
> +		skl_update_scaling_ratio(dev, pipe_config);
> +	}
> +
>  	pfit_domain = POWER_DOMAIN_PIPE_PANEL_FITTER(crtc->pipe);
>  	if (intel_display_power_is_enabled(dev_priv, pfit_domain)) {
>  		if (IS_SKYLAKE(dev))
> -- 
> 1.7.9.5
>
Chandra Konduru April 6, 2015, 4:52 a.m. UTC | #2
> -----Original Message-----
> From: Roper, Matthew D
> Sent: Thursday, April 02, 2015 4:05 PM
> To: Konduru, Chandra
> Cc: intel-gfx@lists.freedesktop.org; Vetter, Daniel; Conselvan De Oliveira, Ander
> Subject: Re: [PATCH 13/20] drm/i915: use current scaler state during
> readout_hw_state.
> 
> On Wed, Apr 01, 2015 at 07:59:42PM -0700, Chandra Konduru wrote:
> > During readout_hw_state, rebuild crtc scaler_state from hw state:
> >  - crtc scaler id
> >  - scaler users
> 
> This patch doesn't look like it actually does what you're advertising here.  If your
> firmware or bootloader or whatever has programmed the display in a way that
> some scalers are in use, I think your state variables are still going to show all
> scalers as free after you're done here, right?

No, the readout changes were made in other patch (17). 
Due to revisions it left out like this. Will squash this into 17.

> 
> >  - scaling ratios
> 
> I think this is the only thing that will actually match the hardware state, but
> we've already noted that those state fields can probably just go away since we
> can trivially calculate the proper values in the places we're currently using them.
> 
> 
> Matt
> 
> >
> > Signed-off-by: Chandra Konduru <chandra.konduru@intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_display.c |    5 +++++
> >  1 file changed, 5 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_display.c
> > b/drivers/gpu/drm/i915/intel_display.c
> > index aae4a22..834ea46 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -8756,6 +8756,11 @@ static bool haswell_get_pipe_config(struct
> > intel_crtc *crtc,
> >
> >  	intel_get_pipe_timings(crtc, pipe_config);
> >
> > +	if (INTEL_INFO(dev)->gen >= 9) {
> > +		skl_init_scalers(dev, crtc->pipe, pipe_config);
> > +		skl_update_scaling_ratio(dev, pipe_config);
> > +	}
> > +
> >  	pfit_domain = POWER_DOMAIN_PIPE_PANEL_FITTER(crtc->pipe);
> >  	if (intel_display_power_is_enabled(dev_priv, pfit_domain)) {
> >  		if (IS_SKYLAKE(dev))
> > --
> > 1.7.9.5
> >
> 
> --
> Matt Roper
> Graphics Software Engineer
> IoTG Platform Enabling & Development
> Intel Corporation
> (916) 356-2795
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index aae4a22..834ea46 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -8756,6 +8756,11 @@  static bool haswell_get_pipe_config(struct intel_crtc *crtc,
 
 	intel_get_pipe_timings(crtc, pipe_config);
 
+	if (INTEL_INFO(dev)->gen >= 9) {
+		skl_init_scalers(dev, crtc->pipe, pipe_config);
+		skl_update_scaling_ratio(dev, pipe_config);
+	}
+
 	pfit_domain = POWER_DOMAIN_PIPE_PANEL_FITTER(crtc->pipe);
 	if (intel_display_power_is_enabled(dev_priv, pfit_domain)) {
 		if (IS_SKYLAKE(dev))