linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: claudiu beznea <claudiu.beznea@tuxon.dev>
To: Manikandan Muralidharan <manikandan.m@microchip.com>,
	sam@ravnborg.org, bbrezillon@kernel.org, airlied@gmail.com,
	daniel@ffwll.ch, nicolas.ferre@microchip.com,
	alexandre.belloni@bootlin.com, lee@kernel.org,
	dri-devel@lists.freedesktop.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Cc: Hari.PrasathGE@microchip.com,
	Balamanikandan.Gunasundar@microchip.com,
	Durai.ManickamKR@microchip.com, Nayabbasha.Sayed@microchip.com,
	Dharma.B@microchip.com, Varshini.Rajendran@microchip.com,
	Balakrishnan.S@microchip.com
Subject: Re: [PATCH v4 6/8] drm: atmel-hlcdc: add DPI mode support for XLCDC
Date: Sat, 9 Sep 2023 19:25:21 +0300	[thread overview]
Message-ID: <a86388dd-4130-a3b1-cad0-a59dbf0a7eef@tuxon.dev> (raw)
In-Reply-To: <20230825125444.93222-7-manikandan.m@microchip.com>



On 8/25/23 15:54, Manikandan Muralidharan wrote:
> Add support for Display Pixel Interface (DPI) Compatible Mode
> support in atmel-hlcdc driver for XLCDC IP along with legacy
> pixel mapping.DPI mode BIT is configured in LCDC_CFG5 register.
> 
> Signed-off-by: Manikandan Muralidharan <manikandan.m@microchip.com>
> [durai.manickamkr@microchip.com: update DPI mode bit using is_xlcdc flag]
> Signed-off-by: Durai Manickam KR <durai.manickamkr@microchip.com>
> ---
>  .../gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c    | 22 ++++++++++++++++---
>  1 file changed, 19 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
> index 4b11a1de8af4..c3d0c60ba419 100644
> --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
> +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
> @@ -30,10 +30,12 @@
>   *
>   * @base: base CRTC state
>   * @output_mode: RGBXXX output mode
> + * @dpi: output DPI mode
>   */
>  struct atmel_hlcdc_crtc_state {
>  	struct drm_crtc_state base;
>  	unsigned int output_mode;
> +	bool dpi;

To avoid confusion, better use u8 to avoid shifting a boolean value in
configuration phase.

>  };
>  
>  static inline struct atmel_hlcdc_crtc_state *
> @@ -164,6 +166,8 @@ static void atmel_hlcdc_crtc_mode_set_nofb(struct drm_crtc *c)
>  
>  	state = drm_crtc_state_to_atmel_hlcdc_crtc_state(c->state);
>  	cfg = state->output_mode << 8;
> +	if (is_xlcdc)
> +		cfg |= state->dpi << 11;
>  
>  	if (!is_xlcdc && (adj->flags & DRM_MODE_FLAG_NVSYNC))
>  		cfg |= ATMEL_HLCDC_VSPOL;
> @@ -176,7 +180,9 @@ static void atmel_hlcdc_crtc_mode_set_nofb(struct drm_crtc *c)
>  			   ATMEL_HLCDC_VSPDLYS | ATMEL_HLCDC_VSPDLYE |
>  			   ATMEL_HLCDC_DISPPOL | ATMEL_HLCDC_DISPDLY |
>  			   ATMEL_HLCDC_VSPSU | ATMEL_HLCDC_VSPHO |
> -			   ATMEL_HLCDC_GUARDTIME_MASK | ATMEL_HLCDC_MODE_MASK,
> +			   ATMEL_HLCDC_GUARDTIME_MASK |
> +			   (is_xlcdc ? ATMEL_XLCDC_MODE_MASK |
> +			   ATMEL_XLCDC_DPI : ATMEL_HLCDC_MODE_MASK),
>  			   cfg);
>  
>  	clk_disable_unprepare(crtc->dc->hlcdc->sys_clk);
> @@ -366,7 +372,15 @@ static int atmel_hlcdc_crtc_select_output_mode(struct drm_crtc_state *state)
>  
>  	hstate = drm_crtc_state_to_atmel_hlcdc_crtc_state(state);
>  	hstate->output_mode = fls(output_fmts) - 1;
> -
> +	if (crtc->dc->desc->is_xlcdc) {
> +		/* check if MIPI DPI bit needs to be set */
> +		if (fls(output_fmts) > 3) {
> +			hstate->output_mode -= 4;
> +			hstate->dpi = true;
> +		} else {
> +			hstate->dpi = false;
> +		}
> +	}
>  	return 0;
>  }
>  
> @@ -470,7 +484,7 @@ static struct drm_crtc_state *
>  atmel_hlcdc_crtc_duplicate_state(struct drm_crtc *crtc)
>  {
>  	struct atmel_hlcdc_crtc_state *state, *cur;
> -
> +	struct atmel_hlcdc_crtc *c = drm_crtc_to_atmel_hlcdc_crtc(crtc);
>  	if (WARN_ON(!crtc->state))
>  		return NULL;
>  
> @@ -481,6 +495,8 @@ atmel_hlcdc_crtc_duplicate_state(struct drm_crtc *crtc)
>  
>  	cur = drm_crtc_state_to_atmel_hlcdc_crtc_state(crtc->state);
>  	state->output_mode = cur->output_mode;
> +	if (c->dc->desc->is_xlcdc)
> +		state->dpi = cur->dpi;
>  
>  	return &state->base;
>  }

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2023-09-09 16:26 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-25 12:54 [PATCH v4 0/8] Add support for XLCDC to sam9x7 SoC family Manikandan Muralidharan
2023-08-25 12:54 ` [PATCH v4 1/8] mfd: atmel-hlcdc: Add compatible for sam9x75 XLCD controller Manikandan Muralidharan
2023-08-25 12:54 ` [PATCH v4 2/8] drm: atmel-hlcdc: add flag to differentiate XLCDC and HLCDC IP Manikandan Muralidharan
2023-08-25 12:54 ` [PATCH v4 3/8] drm: atmel-hlcdc: add LCD controller layer definition for sam9x75 Manikandan Muralidharan
2023-08-25 12:54 ` [PATCH v4 4/8] drm: atmel-hlcdc: Define SAM9X7 SoC XLCDC specific registers Manikandan Muralidharan
2023-09-09 15:50   ` claudiu beznea
2023-08-25 12:54 ` [PATCH v4 5/8] drm: atmel_hlcdc: Add support for XLCDC in atmel LCD driver Manikandan Muralidharan
2023-09-09 16:20   ` claudiu beznea
2023-09-12 10:44     ` Manikandan.M
2023-09-18  4:30       ` claudiu beznea
2023-08-25 12:54 ` [PATCH v4 6/8] drm: atmel-hlcdc: add DPI mode support for XLCDC Manikandan Muralidharan
2023-09-09 16:25   ` claudiu beznea [this message]
2023-08-25 12:54 ` [PATCH v4 7/8] drm: atmel-hlcdc: add vertical and horizontal scaling " Manikandan Muralidharan
2023-09-09 16:26   ` claudiu beznea
2023-08-25 12:54 ` [PATCH v4 8/8] drm: atmel-hlcdc: add support for DSI output formats Manikandan Muralidharan
2023-09-09 16:32   ` claudiu beznea

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=a86388dd-4130-a3b1-cad0-a59dbf0a7eef@tuxon.dev \
    --to=claudiu.beznea@tuxon.dev \
    --cc=Balakrishnan.S@microchip.com \
    --cc=Balamanikandan.Gunasundar@microchip.com \
    --cc=Dharma.B@microchip.com \
    --cc=Durai.ManickamKR@microchip.com \
    --cc=Hari.PrasathGE@microchip.com \
    --cc=Nayabbasha.Sayed@microchip.com \
    --cc=Varshini.Rajendran@microchip.com \
    --cc=airlied@gmail.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=bbrezillon@kernel.org \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=lee@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manikandan.m@microchip.com \
    --cc=nicolas.ferre@microchip.com \
    --cc=sam@ravnborg.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).