diff mbox

[v3] drm: mali-dp: Set encoder possible_clones

Message ID 1531734973-8804-1-git-send-email-alexandru-cosmin.gheorghe@arm.com (mailing list archive)
State New, archived
Headers show

Commit Message

Alexandru-Cosmin Gheorghe July 16, 2018, 9:56 a.m. UTC
Set possible_clones field to report that the writeback connector and
the one driving the display could be enabled at the same time.

Signed-off-by: Alexandru Gheorghe <alexandru-cosmin.gheorghe@arm.com>

Changes since v2:
  - Use proper style for multi-line comments.
---
 drivers/gpu/drm/arm/malidp_drv.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Liviu Dudau July 16, 2018, 11:15 a.m. UTC | #1
On Mon, Jul 16, 2018 at 10:56:13AM +0100, Alexandru Gheorghe wrote:
> Set possible_clones field to report that the writeback connector and
> the one driving the display could be enabled at the same time.
> 
> Signed-off-by: Alexandru Gheorghe <alexandru-cosmin.gheorghe@arm.com>

Acked-by: Liviu Dudau <liviu.dudau@arm.com>

> 
> Changes since v2:
>   - Use proper style for multi-line comments.
> ---
>  drivers/gpu/drm/arm/malidp_drv.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c
> index 5b72605..4169a72 100644
> --- a/drivers/gpu/drm/arm/malidp_drv.c
> +++ b/drivers/gpu/drm/arm/malidp_drv.c
> @@ -616,6 +616,7 @@ static int malidp_bind(struct device *dev)
>  	struct malidp_hw_device *hwdev;
>  	struct platform_device *pdev = to_platform_device(dev);
>  	struct of_device_id const *dev_id;
> +	struct drm_encoder *encoder;
>  	/* number of lines for the R, G and B output */
>  	u8 output_width[MAX_OUTPUT_CHANNELS];
>  	int ret = 0, i;
> @@ -737,6 +738,16 @@ static int malidp_bind(struct device *dev)
>  		goto bind_fail;
>  	}
>  
> +	/*
> +	 * We expect to have a maximum of two encoders one for the actual
> +	 * display and a virtual one for the writeback connector
> +	 */
> +	WARN_ON(drm->mode_config.num_encoder > 2);
> +	list_for_each_entry(encoder, &drm->mode_config.encoder_list, head) {
> +		encoder->possible_clones =
> +				(1 << drm->mode_config.num_encoder) -  1;
> +	}
> +
>  	ret = malidp_irq_init(pdev);
>  	if (ret < 0)
>  		goto irq_init_fail;
> -- 
> 2.7.4
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c
index 5b72605..4169a72 100644
--- a/drivers/gpu/drm/arm/malidp_drv.c
+++ b/drivers/gpu/drm/arm/malidp_drv.c
@@ -616,6 +616,7 @@  static int malidp_bind(struct device *dev)
 	struct malidp_hw_device *hwdev;
 	struct platform_device *pdev = to_platform_device(dev);
 	struct of_device_id const *dev_id;
+	struct drm_encoder *encoder;
 	/* number of lines for the R, G and B output */
 	u8 output_width[MAX_OUTPUT_CHANNELS];
 	int ret = 0, i;
@@ -737,6 +738,16 @@  static int malidp_bind(struct device *dev)
 		goto bind_fail;
 	}
 
+	/*
+	 * We expect to have a maximum of two encoders one for the actual
+	 * display and a virtual one for the writeback connector
+	 */
+	WARN_ON(drm->mode_config.num_encoder > 2);
+	list_for_each_entry(encoder, &drm->mode_config.encoder_list, head) {
+		encoder->possible_clones =
+				(1 << drm->mode_config.num_encoder) -  1;
+	}
+
 	ret = malidp_irq_init(pdev);
 	if (ret < 0)
 		goto irq_init_fail;