All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: "Kulkarni\, Vandita" <vandita.kulkarni@intel.com>,
	"intel-gfx\@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>
Subject: Re: [Intel-gfx] [v4.1 16/16] drm/i915/dsi: add support for DSC
Date: Wed, 11 Dec 2019 08:40:09 +0200	[thread overview]
Message-ID: <87a77zl60m.fsf@intel.com> (raw)
In-Reply-To: <57510F3E2013164E925CD03ED7512A3B809DE840@BGSMSX108.gar.corp.intel.com>

On Wed, 11 Dec 2019, "Kulkarni, Vandita" <vandita.kulkarni@intel.com> wrote:
>> -----Original Message-----
>> From: Jani Nikula <jani.nikula@intel.com>
>> Sent: Tuesday, December 10, 2019 4:21 PM
>> To: intel-gfx@lists.freedesktop.org
>> Cc: Kulkarni, Vandita <vandita.kulkarni@intel.com>;
>> ville.syrjala@linux.intel.com; Nikula, Jani <jani.nikula@intel.com>
>> Subject: [v4.1 16/16] drm/i915/dsi: add support for DSC
>> 
>> Enable DSC for DSI, if specified in VBT.
>> 
>> This still lacks DSC aware get config implementation, and therefore state
>> checker will fail. Also mode valid is not there yet.
>> 
>> v5:
>> - add dsc get config call
>> 
>> v4:
>> - convert_rgb = true (Vandita)
>> - ignore max cdclock check (Vandita)
>> - rename pipe_config to crtc_state
>> 
>> v3:
>> - take compressed bpp into account
>> 
>> v2:
>> - Nuke conn_state->max_requested_bpc, it's not used on DSI
>> 
>> Bspec: 49263
>> Cc: Vandita Kulkarni <vandita.kulkarni@intel.com>
>> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>
> Looks good to me.
> Reviewed-by: Vandita Kulkarni <vandita.kulkarni@intel.com>

Thanks for the reviews, pushed the series to dinq.

BR,
Jani.

>
> Thanks,
> Vandita
>> ---
>>  drivers/gpu/drm/i915/display/icl_dsi.c | 69 ++++++++++++++++++++++++--
>>  1 file changed, 66 insertions(+), 3 deletions(-)
>> 
>> diff --git a/drivers/gpu/drm/i915/display/icl_dsi.c
>> b/drivers/gpu/drm/i915/display/icl_dsi.c
>> index b1d775d834d4..03aa92d317a2 100644
>> --- a/drivers/gpu/drm/i915/display/icl_dsi.c
>> +++ b/drivers/gpu/drm/i915/display/icl_dsi.c
>> @@ -34,6 +34,7 @@
>>  #include "intel_ddi.h"
>>  #include "intel_dsi.h"
>>  #include "intel_panel.h"
>> +#include "intel_vdsc.h"
>> 
>>  static inline int header_credits_available(struct drm_i915_private *dev_priv,
>>  					   enum transcoder dsi_trans)
>> @@ -1087,6 +1088,8 @@ static void gen11_dsi_pre_enable(struct
>> intel_encoder *encoder,
>>  	/* step5: program and powerup panel */
>>  	gen11_dsi_powerup_panel(encoder);
>> 
>> +	intel_dsc_enable(encoder, pipe_config);
>> +
>>  	/* step6c: configure transcoder timings */
>>  	gen11_dsi_set_transcoder_timings(encoder, pipe_config);
>> 
>> @@ -1248,6 +1251,13 @@ static void gen11_dsi_disable(struct
>> intel_encoder *encoder,
>>  	gen11_dsi_disable_io_power(encoder);
>>  }
>> 
>> +static enum drm_mode_status gen11_dsi_mode_valid(struct
>> drm_connector *connector,
>> +						 struct drm_display_mode
>> *mode)
>> +{
>> +	/* FIXME: DSC? */
>> +	return intel_dsi_mode_valid(connector, mode); }
>> +
>>  static void gen11_dsi_get_timings(struct intel_encoder *encoder,
>>  				  struct intel_crtc_state *pipe_config)  { @@ -
>> 1294,6 +1304,8 @@ static void gen11_dsi_get_config(struct intel_encoder
>> *encoder,
>>  	struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc);
>>  	struct intel_dsi *intel_dsi = enc_to_intel_dsi(&encoder->base);
>> 
>> +	intel_dsc_get_config(encoder, pipe_config);
>> +
>>  	/* FIXME: adapt icl_ddi_clock_get() for DSI and use that? */
>>  	pipe_config->port_clock =
>>  		cnl_calc_wrpll_link(dev_priv, &pipe_config->dpll_hw_state);
>> @@ -1307,6 +1319,48 @@ static void gen11_dsi_get_config(struct
>> intel_encoder *encoder,
>>  	pipe_config->pipe_bpp = bdw_get_pipemisc_bpp(crtc);  }
>> 
>> +static int gen11_dsi_dsc_compute_config(struct intel_encoder *encoder,
>> +					struct intel_crtc_state *crtc_state) {
>> +	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
>> +	struct drm_dsc_config *vdsc_cfg = &crtc_state->dsc.config;
>> +	int dsc_max_bpc = INTEL_GEN(dev_priv) >= 12 ? 12 : 10;
>> +	bool use_dsc;
>> +	int ret;
>> +
>> +	use_dsc = intel_bios_get_dsc_params(encoder, crtc_state,
>> dsc_max_bpc);
>> +	if (!use_dsc)
>> +		return 0;
>> +
>> +	if (crtc_state->pipe_bpp < 8 * 3)
>> +		return -EINVAL;
>> +
>> +	/* FIXME: split only when necessary */
>> +	if (crtc_state->dsc.slice_count > 1)
>> +		crtc_state->dsc.dsc_split = true;
>> +
>> +	vdsc_cfg->convert_rgb = true;
>> +
>> +	ret = intel_dsc_compute_params(encoder, crtc_state);
>> +	if (ret)
>> +		return ret;
>> +
>> +	/* DSI specific sanity checks on the common code */
>> +	WARN_ON(vdsc_cfg->vbr_enable);
>> +	WARN_ON(vdsc_cfg->simple_422);
>> +	WARN_ON(vdsc_cfg->pic_width % vdsc_cfg->slice_width);
>> +	WARN_ON(vdsc_cfg->slice_height < 8);
>> +	WARN_ON(vdsc_cfg->pic_height % vdsc_cfg->slice_height);
>> +
>> +	ret = drm_dsc_compute_rc_parameters(vdsc_cfg);
>> +	if (ret)
>> +		return ret;
>> +
>> +	crtc_state->dsc.compression_enable = true;
>> +
>> +	return 0;
>> +}
>> +
>>  static int gen11_dsi_compute_config(struct intel_encoder *encoder,
>>  				    struct intel_crtc_state *pipe_config,
>>  				    struct drm_connector_state *conn_state)
>> @@ -1338,6 +1392,10 @@ static int gen11_dsi_compute_config(struct
>> intel_encoder *encoder,
>>  		pipe_config->pipe_bpp = 18;
>> 
>>  	pipe_config->clock_set = true;
>> +
>> +	if (gen11_dsi_dsc_compute_config(encoder, pipe_config))
>> +		DRM_DEBUG_KMS("Attempting to use DSC failed\n");
>> +
>>  	pipe_config->port_clock = afe_clk(encoder, pipe_config) / 5;
>> 
>>  	return 0;
>> @@ -1346,8 +1404,13 @@ static int gen11_dsi_compute_config(struct
>> intel_encoder *encoder,  static void gen11_dsi_get_power_domains(struct
>> intel_encoder *encoder,
>>  					struct intel_crtc_state *crtc_state)  {
>> -	get_dsi_io_power_domains(to_i915(encoder->base.dev),
>> -				 enc_to_intel_dsi(&encoder->base));
>> +	struct drm_i915_private *i915 = to_i915(encoder->base.dev);
>> +
>> +	get_dsi_io_power_domains(i915, enc_to_intel_dsi(&encoder-
>> >base));
>> +
>> +	if (crtc_state->dsc.compression_enable)
>> +		intel_display_power_get(i915,
>> +
>> 	intel_dsc_power_domain(crtc_state));
>>  }
>> 
>>  static bool gen11_dsi_get_hw_state(struct intel_encoder *encoder, @@ -
>> 1417,7 +1480,7 @@ static const struct drm_connector_funcs
>> gen11_dsi_connector_funcs = {
>> 
>>  static const struct drm_connector_helper_funcs
>> gen11_dsi_connector_helper_funcs = {
>>  	.get_modes = intel_dsi_get_modes,
>> -	.mode_valid = intel_dsi_mode_valid,
>> +	.mode_valid = gen11_dsi_mode_valid,
>>  	.atomic_check = intel_digital_connector_atomic_check,
>>  };
>> 
>> --
>> 2.20.1
>

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

  reply	other threads:[~2019-12-11  6:40 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-10 10:50 [Intel-gfx] [v4.1 00/16] drm/i915/dsi: enable DSC Jani Nikula
2019-12-10 10:50 ` [Intel-gfx] [v4.1 01/16] drm/i915/bios: pass devdata to parse_ddi_port Jani Nikula
2019-12-10 10:50 ` [Intel-gfx] [v4.1 02/16] drm/i915/bios: parse compression parameters block Jani Nikula
2019-12-10 10:50 ` [Intel-gfx] [v4.1 03/16] drm/i915/bios: add support for querying DSC details for encoder Jani Nikula
2019-12-10 10:50 ` [Intel-gfx] [v4.1 04/16] drm/i915/dsc: move DP specific compute params to intel_dp.c Jani Nikula
2019-12-10 10:50 ` [Intel-gfx] [v4.1 05/16] drm/i915/dsc: move slice height calculation to encoder Jani Nikula
2019-12-10 10:50 ` [Intel-gfx] [v4.1 06/16] drm/i915/dsc: add support for computing and writing PPS for DSI encoders Jani Nikula
2019-12-10 10:50 ` [Intel-gfx] [v4.1 07/16] drm/i915/dsc: make DSC source support helper generic Jani Nikula
2019-12-10 23:04   ` Manasi Navare
2019-12-10 10:50 ` [Intel-gfx] [v4.1 08/16] drm/i915/dsc: add basic hardware state readout support Jani Nikula
2019-12-10 23:13   ` Manasi Navare
2019-12-11  6:39     ` Jani Nikula
2019-12-10 10:50 ` [Intel-gfx] [v4.1 09/16] drm/i915/dsi: set pipe_bpp on ICL configure config Jani Nikula
2019-12-10 10:50 ` [Intel-gfx] [v4.1 10/16] drm/i915/dsi: abstract afe_clk calculation Jani Nikula
2019-12-10 10:50 ` [Intel-gfx] [v4.1 11/16] drm/i915/dsi: use afe_clk() instead of intel_dsi_bitrate() Jani Nikula
2019-12-10 10:50 ` [Intel-gfx] [v4.1 12/16] drm/i915/dsi: take compression into account in afe_clk() Jani Nikula
2019-12-10 10:50 ` [Intel-gfx] [v4.1 13/16] drm/i915/dsi: use compressed pixel format with DSC Jani Nikula
2019-12-10 10:50 ` [Intel-gfx] [v4.1 14/16] drm/i915/dsi: account for DSC in horizontal timings Jani Nikula
2019-12-10 10:50 ` [Intel-gfx] [v4.1 15/16] drm/i915/dsi: Fix state mismatch warns for horizontal timings with DSC Jani Nikula
2019-12-10 10:51 ` [Intel-gfx] [v4.1 16/16] drm/i915/dsi: add support for DSC Jani Nikula
2019-12-11  5:51   ` Kulkarni, Vandita
2019-12-11  6:40     ` Jani Nikula [this message]
2019-12-10 18:20 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/dsi: enable DSC (rev7) Patchwork
2019-12-10 18:55 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2019-12-11  1:24 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork

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=87a77zl60m.fsf@intel.com \
    --to=jani.nikula@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=vandita.kulkarni@intel.com \
    /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.