[v9,04/15] drm/i915/icl: Add get config functionality for DSI

Submitted by Jani Nikula on Nov. 1, 2018, 3:33 p.m.

Details

Message ID bc9a2cb11c0e29372ddca799d707da3625f4050e.1541086315.git.jani.nikula@intel.com
State New
Headers show
Series "drm/i915/icl: dsi enabling" ( rev: 4 ) in Intel GFX

Not browsing as part of any series.

Commit Message

Jani Nikula Nov. 1, 2018, 3:33 p.m.
From: Madhav Chauhan <madhav.chauhan@intel.com>

This patch implements the functionality for getting PIPE
configuration to which DSI encoder is connected. Used during
the atomic modeset.

Signed-off-by: Madhav Chauhan <madhav.chauhan@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/icl_dsi.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/i915/icl_dsi.c b/drivers/gpu/drm/i915/icl_dsi.c
index 806b8c323b53..b47e837f4493 100644
--- a/drivers/gpu/drm/i915/icl_dsi.c
+++ b/drivers/gpu/drm/i915/icl_dsi.c
@@ -1055,6 +1055,19 @@  static void gen11_dsi_disable(struct intel_encoder *encoder,
 	gen11_dsi_disable_io_power(encoder);
 }
 
+static void gen11_dsi_get_config(struct intel_encoder *encoder,
+				 struct intel_crtc_state *pipe_config)
+{
+	struct intel_dsi *intel_dsi = container_of(encoder, struct intel_dsi,
+						   base);
+	u32 pixel_clk;
+
+	//FIXME: Calculate pixel clock using PLL functions once implemented.
+	pixel_clk = intel_dsi->pclk;
+	pipe_config->base.adjusted_mode.crtc_clock = pixel_clk;
+	pipe_config->port_clock = pixel_clk;
+}
+
 static void gen11_dsi_encoder_destroy(struct drm_encoder *encoder)
 {
 	intel_encoder_destroy(encoder);
@@ -1167,6 +1180,7 @@  void icl_dsi_init(struct drm_i915_private *dev_priv)
 	encoder->pre_enable = gen11_dsi_pre_enable;
 	encoder->disable = gen11_dsi_disable;
 	encoder->port = port;
+	encoder->get_config = gen11_dsi_get_config;
 	encoder->type = INTEL_OUTPUT_DSI;
 	encoder->cloneable = 0;
 	encoder->crtc_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C);

Comments

> -----Original Message-----
> From: Nikula, Jani
> Sent: Thursday, November 1, 2018 9:04 PM
> To: intel-gfx@lists.freedesktop.org
> Cc: Chauhan, Madhav <madhav.chauhan@intel.com>;
> ville.syrjala@linux.intel.com; Kulkarni, Vandita <vandita.kulkarni@intel.com>;
> Lisovskiy, Stanislav <stanislav.lisovskiy@intel.com>; Nikula, Jani
> <jani.nikula@intel.com>
> Subject: [PATCH v9 04/15] drm/i915/icl: Add get config functionality for DSI
> 
> From: Madhav Chauhan <madhav.chauhan@intel.com>
> 
> This patch implements the functionality for getting PIPE configuration to which
> DSI encoder is connected. Used during the atomic modeset.
> 
> Signed-off-by: Madhav Chauhan <madhav.chauhan@intel.com>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>  drivers/gpu/drm/i915/icl_dsi.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/icl_dsi.c b/drivers/gpu/drm/i915/icl_dsi.c index
> 806b8c323b53..b47e837f4493 100644
> --- a/drivers/gpu/drm/i915/icl_dsi.c
> +++ b/drivers/gpu/drm/i915/icl_dsi.c
> @@ -1055,6 +1055,19 @@ static void gen11_dsi_disable(struct intel_encoder
> *encoder,
>  	gen11_dsi_disable_io_power(encoder);
>  }
> 
> +static void gen11_dsi_get_config(struct intel_encoder *encoder,
> +				 struct intel_crtc_state *pipe_config) {
> +	struct intel_dsi *intel_dsi = container_of(encoder, struct intel_dsi,
> +						   base);
> +	u32 pixel_clk;
> +
> +	//FIXME: Calculate pixel clock using PLL functions once implemented.
> +	pixel_clk = intel_dsi->pclk;
> +	pipe_config->base.adjusted_mode.crtc_clock = pixel_clk;
> +	pipe_config->port_clock = pixel_clk;
Is this Ok for now, or should I continue on the lines that Ville suggested?

Thanks,
Vandita
> +}
> +
>  static void gen11_dsi_encoder_destroy(struct drm_encoder *encoder)  {
>  	intel_encoder_destroy(encoder);
> @@ -1167,6 +1180,7 @@ void icl_dsi_init(struct drm_i915_private *dev_priv)
>  	encoder->pre_enable = gen11_dsi_pre_enable;
>  	encoder->disable = gen11_dsi_disable;
>  	encoder->port = port;
> +	encoder->get_config = gen11_dsi_get_config;
>  	encoder->type = INTEL_OUTPUT_DSI;
>  	encoder->cloneable = 0;
>  	encoder->crtc_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C);
> --
> 2.11.0
On Fri, 02 Nov 2018, "Kulkarni, Vandita" <vandita.kulkarni@intel.com> wrote:
>> -----Original Message-----
>> From: Nikula, Jani
>> Sent: Thursday, November 1, 2018 9:04 PM
>> To: intel-gfx@lists.freedesktop.org
>> Cc: Chauhan, Madhav <madhav.chauhan@intel.com>;
>> ville.syrjala@linux.intel.com; Kulkarni, Vandita <vandita.kulkarni@intel.com>;
>> Lisovskiy, Stanislav <stanislav.lisovskiy@intel.com>; Nikula, Jani
>> <jani.nikula@intel.com>
>> Subject: [PATCH v9 04/15] drm/i915/icl: Add get config functionality for DSI
>> 
>> From: Madhav Chauhan <madhav.chauhan@intel.com>
>> 
>> This patch implements the functionality for getting PIPE configuration to which
>> DSI encoder is connected. Used during the atomic modeset.
>> 
>> Signed-off-by: Madhav Chauhan <madhav.chauhan@intel.com>
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>> ---
>>  drivers/gpu/drm/i915/icl_dsi.c | 14 ++++++++++++++
>>  1 file changed, 14 insertions(+)
>> 
>> diff --git a/drivers/gpu/drm/i915/icl_dsi.c b/drivers/gpu/drm/i915/icl_dsi.c index
>> 806b8c323b53..b47e837f4493 100644
>> --- a/drivers/gpu/drm/i915/icl_dsi.c
>> +++ b/drivers/gpu/drm/i915/icl_dsi.c
>> @@ -1055,6 +1055,19 @@ static void gen11_dsi_disable(struct intel_encoder
>> *encoder,
>>  	gen11_dsi_disable_io_power(encoder);
>>  }
>> 
>> +static void gen11_dsi_get_config(struct intel_encoder *encoder,
>> +				 struct intel_crtc_state *pipe_config) {
>> +	struct intel_dsi *intel_dsi = container_of(encoder, struct intel_dsi,
>> +						   base);
>> +	u32 pixel_clk;
>> +
>> +	//FIXME: Calculate pixel clock using PLL functions once implemented.
>> +	pixel_clk = intel_dsi->pclk;
>> +	pipe_config->base.adjusted_mode.crtc_clock = pixel_clk;
>> +	pipe_config->port_clock = pixel_clk;
> Is this Ok for now, or should I continue on the lines that Ville suggested?

This is pretty much a hack, we need your changes here.

BR,
Jani.

>
> Thanks,
> Vandita
>> +}
>> +
>>  static void gen11_dsi_encoder_destroy(struct drm_encoder *encoder)  {
>>  	intel_encoder_destroy(encoder);
>> @@ -1167,6 +1180,7 @@ void icl_dsi_init(struct drm_i915_private *dev_priv)
>>  	encoder->pre_enable = gen11_dsi_pre_enable;
>>  	encoder->disable = gen11_dsi_disable;
>>  	encoder->port = port;
>> +	encoder->get_config = gen11_dsi_get_config;
>>  	encoder->type = INTEL_OUTPUT_DSI;
>>  	encoder->cloneable = 0;
>>  	encoder->crtc_mask = BIT(PIPE_A) | BIT(PIPE_B) | BIT(PIPE_C);
>> --
>> 2.11.0
>