* [PATCH] drm/stm: Remove usage of drm_display_mode_to_videomode()
@ 2021-05-28 8:05 Yannick Fertre
2021-05-28 14:01 ` yannick Fertre
0 siblings, 1 reply; 7+ messages in thread
From: Yannick Fertre @ 2021-05-28 8:05 UTC (permalink / raw)
To: Yannick Fertre, Philippe Cornu, Antonio Borneo, David Airlie,
Daniel Vetter, Maxime Coquelin, Alexandre Torgue, dri-devel,
linux-stm32, linux-arm-kernel, linux-kernel
There is not much value in the extra conversion step, the calculations
required for the LTDC IP are different than what is used in the
drm_display_mode_to_videomode(), so just do the right ones in the LTDC
driver right away.
Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Yannick Fertre <yannick.fertre@foss.st.com>
---
drivers/gpu/drm/stm/ltdc.c | 32 +++++++++++++++++---------------
1 file changed, 17 insertions(+), 15 deletions(-)
diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c
index e99771b947b6..d113b9be12c0 100644
--- a/drivers/gpu/drm/stm/ltdc.c
+++ b/drivers/gpu/drm/stm/ltdc.c
@@ -570,31 +570,33 @@ static void ltdc_crtc_mode_set_nofb(struct drm_crtc *crtc)
}
}
- drm_display_mode_to_videomode(mode, &vm);
-
DRM_DEBUG_DRIVER("CRTC:%d mode:%s\n", crtc->base.id, mode->name);
- DRM_DEBUG_DRIVER("Video mode: %dx%d", vm.hactive, vm.vactive);
+ DRM_DEBUG_DRIVER("Video mode: %dx%d", mode->hdisplay, mode->vdisplay);
DRM_DEBUG_DRIVER(" hfp %d hbp %d hsl %d vfp %d vbp %d vsl %d\n",
- vm.hfront_porch, vm.hback_porch, vm.hsync_len,
- vm.vfront_porch, vm.vback_porch, vm.vsync_len);
+ mode->hsync_start - mode->hdisplay,
+ mode->htotal - mode->hsync_end,
+ mode->hsync_end - mode->hsync_start,
+ mode->vsync_start - mode->vdisplay,
+ mode->vtotal - mode->vsync_end,
+ mode->vsync_end - mode->vsync_start);
/* Convert video timings to ltdc timings */
- hsync = vm.hsync_len - 1;
- vsync = vm.vsync_len - 1;
- accum_hbp = hsync + vm.hback_porch;
- accum_vbp = vsync + vm.vback_porch;
- accum_act_w = accum_hbp + vm.hactive;
- accum_act_h = accum_vbp + vm.vactive;
- total_width = accum_act_w + vm.hfront_porch;
- total_height = accum_act_h + vm.vfront_porch;
+ hsync = mode->hsync_end - mode->hsync_start - 1;
+ vsync = mode->vsync_end - mode->vsync_start - 1;
+ accum_hbp = mode->htotal - mode->hsync_start - 1;
+ accum_vbp = mode->vtotal - mode->vsync_start - 1;
+ accum_act_w = accum_hbp + mode->hdisplay;
+ accum_act_h = accum_vbp + mode->vdisplay;
+ total_width = mode->htotal - 1;
+ total_height = mode->vtotal - 1;
/* Configures the HS, VS, DE and PC polarities. Default Active Low */
val = 0;
- if (vm.flags & DISPLAY_FLAGS_HSYNC_HIGH)
+ if (mode->flags & DRM_MODE_FLAG_PHSYNC)
val |= GCR_HSPOL;
- if (vm.flags & DISPLAY_FLAGS_VSYNC_HIGH)
+ if (mode->flags & DRM_MODE_FLAG_PVSYNC)
val |= GCR_VSPOL;
if (bus_flags & DRM_BUS_FLAG_DE_LOW)
--
2.17.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] drm/stm: Remove usage of drm_display_mode_to_videomode()
2021-05-28 8:05 [PATCH] drm/stm: Remove usage of drm_display_mode_to_videomode() Yannick Fertre
@ 2021-05-28 14:01 ` yannick Fertre
2021-06-01 10:19 ` Philippe CORNU
0 siblings, 1 reply; 7+ messages in thread
From: yannick Fertre @ 2021-05-28 14:01 UTC (permalink / raw)
To: Philippe Cornu, Antonio Borneo, David Airlie, Daniel Vetter,
Maxime Coquelin, Alexandre Torgue, dri-devel, linux-stm32,
linux-arm-kernel, linux-kernel, Marek Vasut
Hi Philippe,
I have already reviewed this patch on January 7, 2020.
(https://lore.kernel.org/dri-devel/0ab4ee45-4437-3b02-cf63-0e3b1b53920f@st.com/)
Could you please review it and merge it?
Best regards
Yannick
On 5/28/21 10:05 AM, Yannick Fertre wrote:
> There is not much value in the extra conversion step, the calculations
> required for the LTDC IP are different than what is used in the
> drm_display_mode_to_videomode(), so just do the right ones in the LTDC
> driver right away.
>
> Signed-off-by: Marek Vasut <marex@denx.de>
> Signed-off-by: Yannick Fertre <yannick.fertre@foss.st.com>
> ---
> drivers/gpu/drm/stm/ltdc.c | 32 +++++++++++++++++---------------
> 1 file changed, 17 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c
> index e99771b947b6..d113b9be12c0 100644
> --- a/drivers/gpu/drm/stm/ltdc.c
> +++ b/drivers/gpu/drm/stm/ltdc.c
> @@ -570,31 +570,33 @@ static void ltdc_crtc_mode_set_nofb(struct drm_crtc *crtc)
> }
> }
>
> - drm_display_mode_to_videomode(mode, &vm);
> -
> DRM_DEBUG_DRIVER("CRTC:%d mode:%s\n", crtc->base.id, mode->name);
> - DRM_DEBUG_DRIVER("Video mode: %dx%d", vm.hactive, vm.vactive);
> + DRM_DEBUG_DRIVER("Video mode: %dx%d", mode->hdisplay, mode->vdisplay);
> DRM_DEBUG_DRIVER(" hfp %d hbp %d hsl %d vfp %d vbp %d vsl %d\n",
> - vm.hfront_porch, vm.hback_porch, vm.hsync_len,
> - vm.vfront_porch, vm.vback_porch, vm.vsync_len);
> + mode->hsync_start - mode->hdisplay,
> + mode->htotal - mode->hsync_end,
> + mode->hsync_end - mode->hsync_start,
> + mode->vsync_start - mode->vdisplay,
> + mode->vtotal - mode->vsync_end,
> + mode->vsync_end - mode->vsync_start);
>
> /* Convert video timings to ltdc timings */
> - hsync = vm.hsync_len - 1;
> - vsync = vm.vsync_len - 1;
> - accum_hbp = hsync + vm.hback_porch;
> - accum_vbp = vsync + vm.vback_porch;
> - accum_act_w = accum_hbp + vm.hactive;
> - accum_act_h = accum_vbp + vm.vactive;
> - total_width = accum_act_w + vm.hfront_porch;
> - total_height = accum_act_h + vm.vfront_porch;
> + hsync = mode->hsync_end - mode->hsync_start - 1;
> + vsync = mode->vsync_end - mode->vsync_start - 1;
> + accum_hbp = mode->htotal - mode->hsync_start - 1;
> + accum_vbp = mode->vtotal - mode->vsync_start - 1;
> + accum_act_w = accum_hbp + mode->hdisplay;
> + accum_act_h = accum_vbp + mode->vdisplay;
> + total_width = mode->htotal - 1;
> + total_height = mode->vtotal - 1;
>
> /* Configures the HS, VS, DE and PC polarities. Default Active Low */
> val = 0;
>
> - if (vm.flags & DISPLAY_FLAGS_HSYNC_HIGH)
> + if (mode->flags & DRM_MODE_FLAG_PHSYNC)
> val |= GCR_HSPOL;
>
> - if (vm.flags & DISPLAY_FLAGS_VSYNC_HIGH)
> + if (mode->flags & DRM_MODE_FLAG_PVSYNC)
> val |= GCR_VSPOL;
>
> if (bus_flags & DRM_BUS_FLAG_DE_LOW)
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] drm/stm: Remove usage of drm_display_mode_to_videomode()
2021-05-28 14:01 ` yannick Fertre
@ 2021-06-01 10:19 ` Philippe CORNU
0 siblings, 0 replies; 7+ messages in thread
From: Philippe CORNU @ 2021-06-01 10:19 UTC (permalink / raw)
To: yannick Fertre, Antonio Borneo, David Airlie, Daniel Vetter,
Maxime Coquelin, Alexandre Torgue, dri-devel, linux-stm32,
linux-arm-kernel, linux-kernel, Marek Vasut
Hi Marek,
Many thanks for your patch and sorry for the delay regarding this "last
Christmas" patch (Dec. 24, 2020), lost in my inbox :(
Could you please resend it (as I did not succeed to apply it directly)?
patchwork reference
https://patchwork.freedesktop.org/patch/409968/?series=85222
Many thanks,
Philippe :-)
On 5/28/21 4:01 PM, yannick Fertre wrote:
>
> Hi Philippe,
> I have already reviewed this patch on January 7, 2020.
> (https://lore.kernel.org/dri-devel/0ab4ee45-4437-3b02-cf63-0e3b1b53920f@st.com/)
>
> Could you please review it and merge it?
>
> Best regards
>
> Yannick
>
> On 5/28/21 10:05 AM, Yannick Fertre wrote:
>> There is not much value in the extra conversion step, the calculations
>> required for the LTDC IP are different than what is used in the
>> drm_display_mode_to_videomode(), so just do the right ones in the LTDC
>> driver right away.
>>
>> Signed-off-by: Marek Vasut <marex@denx.de>
>> Signed-off-by: Yannick Fertre <yannick.fertre@foss.st.com>
>> ---
>> drivers/gpu/drm/stm/ltdc.c | 32 +++++++++++++++++---------------
>> 1 file changed, 17 insertions(+), 15 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c
>> index e99771b947b6..d113b9be12c0 100644
>> --- a/drivers/gpu/drm/stm/ltdc.c
>> +++ b/drivers/gpu/drm/stm/ltdc.c
>> @@ -570,31 +570,33 @@ static void ltdc_crtc_mode_set_nofb(struct
>> drm_crtc *crtc)
>> }
>> }
>> - drm_display_mode_to_videomode(mode, &vm);
>> -
>> DRM_DEBUG_DRIVER("CRTC:%d mode:%s\n", crtc->base.id, mode->name);
>> - DRM_DEBUG_DRIVER("Video mode: %dx%d", vm.hactive, vm.vactive);
>> + DRM_DEBUG_DRIVER("Video mode: %dx%d", mode->hdisplay,
>> mode->vdisplay);
>> DRM_DEBUG_DRIVER(" hfp %d hbp %d hsl %d vfp %d vbp %d vsl %d\n",
>> - vm.hfront_porch, vm.hback_porch, vm.hsync_len,
>> - vm.vfront_porch, vm.vback_porch, vm.vsync_len);
>> + mode->hsync_start - mode->hdisplay,
>> + mode->htotal - mode->hsync_end,
>> + mode->hsync_end - mode->hsync_start,
>> + mode->vsync_start - mode->vdisplay,
>> + mode->vtotal - mode->vsync_end,
>> + mode->vsync_end - mode->vsync_start);
>> /* Convert video timings to ltdc timings */
>> - hsync = vm.hsync_len - 1;
>> - vsync = vm.vsync_len - 1;
>> - accum_hbp = hsync + vm.hback_porch;
>> - accum_vbp = vsync + vm.vback_porch;
>> - accum_act_w = accum_hbp + vm.hactive;
>> - accum_act_h = accum_vbp + vm.vactive;
>> - total_width = accum_act_w + vm.hfront_porch;
>> - total_height = accum_act_h + vm.vfront_porch;
>> + hsync = mode->hsync_end - mode->hsync_start - 1;
>> + vsync = mode->vsync_end - mode->vsync_start - 1;
>> + accum_hbp = mode->htotal - mode->hsync_start - 1;
>> + accum_vbp = mode->vtotal - mode->vsync_start - 1;
>> + accum_act_w = accum_hbp + mode->hdisplay;
>> + accum_act_h = accum_vbp + mode->vdisplay;
>> + total_width = mode->htotal - 1;
>> + total_height = mode->vtotal - 1;
>> /* Configures the HS, VS, DE and PC polarities. Default Active
>> Low */
>> val = 0;
>> - if (vm.flags & DISPLAY_FLAGS_HSYNC_HIGH)
>> + if (mode->flags & DRM_MODE_FLAG_PHSYNC)
>> val |= GCR_HSPOL;
>> - if (vm.flags & DISPLAY_FLAGS_VSYNC_HIGH)
>> + if (mode->flags & DRM_MODE_FLAG_PVSYNC)
>> val |= GCR_VSPOL;
>> if (bus_flags & DRM_BUS_FLAG_DE_LOW)
>>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] drm/stm: Remove usage of drm_display_mode_to_videomode()
2021-06-07 17:24 Marek Vasut
@ 2021-06-08 16:56 ` Philippe CORNU
0 siblings, 0 replies; 7+ messages in thread
From: Philippe CORNU @ 2021-06-08 16:56 UTC (permalink / raw)
To: Marek Vasut, dri-devel
Cc: Alexandre Torgue, Antonio Borneo, Benjamin Gaignard,
Maxime Coquelin, Sam Ravnborg, Vincent Abriou, Yannick Fertre,
linux-arm-kernel, linux-stm32
Hi Marek,
Applied on drm-misc-next.
Note: I added Yannick Tested-by from the last (identical) December
version https://patchwork.freedesktop.org/patch/409968
Many thanks for your patch,
Philippe :-)
On 6/7/21 7:24 PM, Marek Vasut wrote:
> There is not much value in the extra conversion step, the calculations
> required for the LTDC IP are different than what is used in the
> drm_display_mode_to_videomode(), so just do the right ones in the LTDC
> driver right away.
>
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>
> Cc: Antonio Borneo <antonio.borneo@foss.st.com>
> Cc: Benjamin Gaignard <benjamin.gaignard@foss.st.com>
> Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
> Cc: Philippe Cornu <philippe.cornu@foss.st.com>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> Cc: Vincent Abriou <vincent.abriou@foss.st.com>
> Cc: Yannick Fertre <yannick.fertre@foss.st.com>
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-stm32@st-md-mailman.stormreply.com
> To: dri-devel@lists.freedesktop.org
> ---
> drivers/gpu/drm/stm/ltdc.c | 33 +++++++++++++++++----------------
> 1 file changed, 17 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c
> index e99771b947b6..08b71248044d 100644
> --- a/drivers/gpu/drm/stm/ltdc.c
> +++ b/drivers/gpu/drm/stm/ltdc.c
> @@ -531,7 +531,6 @@ static void ltdc_crtc_mode_set_nofb(struct drm_crtc *crtc)
> struct drm_encoder *encoder = NULL;
> struct drm_bridge *bridge = NULL;
> struct drm_display_mode *mode = &crtc->state->adjusted_mode;
> - struct videomode vm;
> u32 hsync, vsync, accum_hbp, accum_vbp, accum_act_w, accum_act_h;
> u32 total_width, total_height;
> u32 bus_flags = 0;
> @@ -570,31 +569,33 @@ static void ltdc_crtc_mode_set_nofb(struct drm_crtc *crtc)
> }
> }
>
> - drm_display_mode_to_videomode(mode, &vm);
> -
> DRM_DEBUG_DRIVER("CRTC:%d mode:%s\n", crtc->base.id, mode->name);
> - DRM_DEBUG_DRIVER("Video mode: %dx%d", vm.hactive, vm.vactive);
> + DRM_DEBUG_DRIVER("Video mode: %dx%d", mode->hdisplay, mode->vdisplay);
> DRM_DEBUG_DRIVER(" hfp %d hbp %d hsl %d vfp %d vbp %d vsl %d\n",
> - vm.hfront_porch, vm.hback_porch, vm.hsync_len,
> - vm.vfront_porch, vm.vback_porch, vm.vsync_len);
> + mode->hsync_start - mode->hdisplay,
> + mode->htotal - mode->hsync_end,
> + mode->hsync_end - mode->hsync_start,
> + mode->vsync_start - mode->vdisplay,
> + mode->vtotal - mode->vsync_end,
> + mode->vsync_end - mode->vsync_start);
>
> /* Convert video timings to ltdc timings */
> - hsync = vm.hsync_len - 1;
> - vsync = vm.vsync_len - 1;
> - accum_hbp = hsync + vm.hback_porch;
> - accum_vbp = vsync + vm.vback_porch;
> - accum_act_w = accum_hbp + vm.hactive;
> - accum_act_h = accum_vbp + vm.vactive;
> - total_width = accum_act_w + vm.hfront_porch;
> - total_height = accum_act_h + vm.vfront_porch;
> + hsync = mode->hsync_end - mode->hsync_start - 1;
> + vsync = mode->vsync_end - mode->vsync_start - 1;
> + accum_hbp = mode->htotal - mode->hsync_start - 1;
> + accum_vbp = mode->vtotal - mode->vsync_start - 1;
> + accum_act_w = accum_hbp + mode->hdisplay;
> + accum_act_h = accum_vbp + mode->vdisplay;
> + total_width = mode->htotal - 1;
> + total_height = mode->vtotal - 1;
>
> /* Configures the HS, VS, DE and PC polarities. Default Active Low */
> val = 0;
>
> - if (vm.flags & DISPLAY_FLAGS_HSYNC_HIGH)
> + if (mode->flags & DRM_MODE_FLAG_PHSYNC)
> val |= GCR_HSPOL;
>
> - if (vm.flags & DISPLAY_FLAGS_VSYNC_HIGH)
> + if (mode->flags & DRM_MODE_FLAG_PVSYNC)
> val |= GCR_VSPOL;
>
> if (bus_flags & DRM_BUS_FLAG_DE_LOW)
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] drm/stm: Remove usage of drm_display_mode_to_videomode()
@ 2021-06-07 17:24 Marek Vasut
2021-06-08 16:56 ` Philippe CORNU
0 siblings, 1 reply; 7+ messages in thread
From: Marek Vasut @ 2021-06-07 17:24 UTC (permalink / raw)
To: dri-devel
Cc: Marek Vasut, Alexandre Torgue, Antonio Borneo, Benjamin Gaignard,
Maxime Coquelin, Philippe Cornu, Sam Ravnborg, Vincent Abriou,
Yannick Fertre, linux-arm-kernel, linux-stm32
There is not much value in the extra conversion step, the calculations
required for the LTDC IP are different than what is used in the
drm_display_mode_to_videomode(), so just do the right ones in the LTDC
driver right away.
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>
Cc: Antonio Borneo <antonio.borneo@foss.st.com>
Cc: Benjamin Gaignard <benjamin.gaignard@foss.st.com>
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: Philippe Cornu <philippe.cornu@foss.st.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Vincent Abriou <vincent.abriou@foss.st.com>
Cc: Yannick Fertre <yannick.fertre@foss.st.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-stm32@st-md-mailman.stormreply.com
To: dri-devel@lists.freedesktop.org
---
drivers/gpu/drm/stm/ltdc.c | 33 +++++++++++++++++----------------
1 file changed, 17 insertions(+), 16 deletions(-)
diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c
index e99771b947b6..08b71248044d 100644
--- a/drivers/gpu/drm/stm/ltdc.c
+++ b/drivers/gpu/drm/stm/ltdc.c
@@ -531,7 +531,6 @@ static void ltdc_crtc_mode_set_nofb(struct drm_crtc *crtc)
struct drm_encoder *encoder = NULL;
struct drm_bridge *bridge = NULL;
struct drm_display_mode *mode = &crtc->state->adjusted_mode;
- struct videomode vm;
u32 hsync, vsync, accum_hbp, accum_vbp, accum_act_w, accum_act_h;
u32 total_width, total_height;
u32 bus_flags = 0;
@@ -570,31 +569,33 @@ static void ltdc_crtc_mode_set_nofb(struct drm_crtc *crtc)
}
}
- drm_display_mode_to_videomode(mode, &vm);
-
DRM_DEBUG_DRIVER("CRTC:%d mode:%s\n", crtc->base.id, mode->name);
- DRM_DEBUG_DRIVER("Video mode: %dx%d", vm.hactive, vm.vactive);
+ DRM_DEBUG_DRIVER("Video mode: %dx%d", mode->hdisplay, mode->vdisplay);
DRM_DEBUG_DRIVER(" hfp %d hbp %d hsl %d vfp %d vbp %d vsl %d\n",
- vm.hfront_porch, vm.hback_porch, vm.hsync_len,
- vm.vfront_porch, vm.vback_porch, vm.vsync_len);
+ mode->hsync_start - mode->hdisplay,
+ mode->htotal - mode->hsync_end,
+ mode->hsync_end - mode->hsync_start,
+ mode->vsync_start - mode->vdisplay,
+ mode->vtotal - mode->vsync_end,
+ mode->vsync_end - mode->vsync_start);
/* Convert video timings to ltdc timings */
- hsync = vm.hsync_len - 1;
- vsync = vm.vsync_len - 1;
- accum_hbp = hsync + vm.hback_porch;
- accum_vbp = vsync + vm.vback_porch;
- accum_act_w = accum_hbp + vm.hactive;
- accum_act_h = accum_vbp + vm.vactive;
- total_width = accum_act_w + vm.hfront_porch;
- total_height = accum_act_h + vm.vfront_porch;
+ hsync = mode->hsync_end - mode->hsync_start - 1;
+ vsync = mode->vsync_end - mode->vsync_start - 1;
+ accum_hbp = mode->htotal - mode->hsync_start - 1;
+ accum_vbp = mode->vtotal - mode->vsync_start - 1;
+ accum_act_w = accum_hbp + mode->hdisplay;
+ accum_act_h = accum_vbp + mode->vdisplay;
+ total_width = mode->htotal - 1;
+ total_height = mode->vtotal - 1;
/* Configures the HS, VS, DE and PC polarities. Default Active Low */
val = 0;
- if (vm.flags & DISPLAY_FLAGS_HSYNC_HIGH)
+ if (mode->flags & DRM_MODE_FLAG_PHSYNC)
val |= GCR_HSPOL;
- if (vm.flags & DISPLAY_FLAGS_VSYNC_HIGH)
+ if (mode->flags & DRM_MODE_FLAG_PVSYNC)
val |= GCR_VSPOL;
if (bus_flags & DRM_BUS_FLAG_DE_LOW)
--
2.30.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] drm/stm: Remove usage of drm_display_mode_to_videomode()
2020-12-24 6:20 Marek Vasut
@ 2021-01-07 8:27 ` Yannick FERTRE
0 siblings, 0 replies; 7+ messages in thread
From: Yannick FERTRE @ 2021-01-07 8:27 UTC (permalink / raw)
To: Marek Vasut, dri-devel
Cc: Alexandre TORGUE, Antonio BORNEO, Vincent ABRIOU, Philippe CORNU,
Maxime Coquelin, Sam Ravnborg, linux-stm32, linux-arm-kernel,
Benjamin Gaignard
Hi Marek,
thanks for the patch. It works fine on stm32mp1 eval board with bridge
DSI & DPI panel.
Tested-by: Yannick Fertré <yannick.fertre@st.com>
Best regards
On 12/24/20 7:20 AM, Marek Vasut wrote:
> There is not much value in the extra conversion step, the calculations
> required for the LTDC IP are different than what is used in the
> drm_display_mode_to_videomode(), so just do the right ones in the LTDC
> driver right away.
>
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Alexandre Torgue <alexandre.torgue@st.com>
> Cc: Antonio Borneo <antonio.borneo@st.com>
> Cc: Benjamin Gaignard <benjamin.gaignard@st.com>
> Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
> Cc: Philippe Cornu <philippe.cornu@st.com>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> Cc: Vincent Abriou <vincent.abriou@st.com>
> Cc: Yannick Fertre <yannick.fertre@st.com>
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-stm32@st-md-mailman.stormreply.com
> To: dri-devel@lists.freedesktop.org
> ---
> drivers/gpu/drm/stm/ltdc.c | 33 +++++++++++++++++----------------
> 1 file changed, 17 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c
> index 22c7e9fa5ab7..e8fc8fc50d94 100644
> --- a/drivers/gpu/drm/stm/ltdc.c
> +++ b/drivers/gpu/drm/stm/ltdc.c
> @@ -545,7 +545,6 @@ static void ltdc_crtc_mode_set_nofb(struct drm_crtc *crtc)
> struct ltdc_device *ldev = crtc_to_ltdc(crtc);
> struct drm_device *ddev = crtc->dev;
> struct drm_display_mode *mode = &crtc->state->adjusted_mode;
> - struct videomode vm;
> u32 bus_flags = 0;
> u32 hsync, vsync, accum_hbp, accum_vbp, accum_act_w, accum_act_h;
> u32 total_width, total_height;
> @@ -565,31 +564,33 @@ static void ltdc_crtc_mode_set_nofb(struct drm_crtc *crtc)
> }
> }
>
> - drm_display_mode_to_videomode(mode, &vm);
> -
> DRM_DEBUG_DRIVER("CRTC:%d mode:%s\n", crtc->base.id, mode->name);
> - DRM_DEBUG_DRIVER("Video mode: %dx%d", vm.hactive, vm.vactive);
> + DRM_DEBUG_DRIVER("Video mode: %dx%d", mode->hdisplay, mode->vdisplay);
> DRM_DEBUG_DRIVER(" hfp %d hbp %d hsl %d vfp %d vbp %d vsl %d\n",
> - vm.hfront_porch, vm.hback_porch, vm.hsync_len,
> - vm.vfront_porch, vm.vback_porch, vm.vsync_len);
> + mode->hsync_start - mode->hdisplay,
> + mode->htotal - mode->hsync_end,
> + mode->hsync_end - mode->hsync_start,
> + mode->vsync_start - mode->vdisplay,
> + mode->vtotal - mode->vsync_end,
> + mode->vsync_end - mode->vsync_start);
>
> /* Convert video timings to ltdc timings */
> - hsync = vm.hsync_len - 1;
> - vsync = vm.vsync_len - 1;
> - accum_hbp = hsync + vm.hback_porch;
> - accum_vbp = vsync + vm.vback_porch;
> - accum_act_w = accum_hbp + vm.hactive;
> - accum_act_h = accum_vbp + vm.vactive;
> - total_width = accum_act_w + vm.hfront_porch;
> - total_height = accum_act_h + vm.vfront_porch;
> + hsync = mode->hsync_end - mode->hsync_start - 1;
> + vsync = mode->vsync_end - mode->vsync_start - 1;
> + accum_hbp = mode->htotal - mode->hsync_start - 1;
> + accum_vbp = mode->vtotal - mode->vsync_start - 1;
> + accum_act_w = accum_hbp + mode->hdisplay;
> + accum_act_h = accum_vbp + mode->vdisplay;
> + total_width = mode->htotal - 1;
> + total_height = mode->vtotal - 1;
>
> /* Configures the HS, VS, DE and PC polarities. Default Active Low */
> val = 0;
>
> - if (vm.flags & DISPLAY_FLAGS_HSYNC_HIGH)
> + if (mode->flags & DRM_MODE_FLAG_PHSYNC)
> val |= GCR_HSPOL;
>
> - if (vm.flags & DISPLAY_FLAGS_VSYNC_HIGH)
> + if (mode->flags & DRM_MODE_FLAG_PVSYNC)
> val |= GCR_VSPOL;
>
> if (bus_flags & DRM_BUS_FLAG_DE_LOW)
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] drm/stm: Remove usage of drm_display_mode_to_videomode()
@ 2020-12-24 6:20 Marek Vasut
2021-01-07 8:27 ` Yannick FERTRE
0 siblings, 1 reply; 7+ messages in thread
From: Marek Vasut @ 2020-12-24 6:20 UTC (permalink / raw)
To: dri-devel
Cc: Marek Vasut, Alexandre Torgue, Antonio Borneo, Vincent Abriou,
Philippe Cornu, Yannick Fertre, Maxime Coquelin, Sam Ravnborg,
linux-stm32, linux-arm-kernel, Benjamin Gaignard
There is not much value in the extra conversion step, the calculations
required for the LTDC IP are different than what is used in the
drm_display_mode_to_videomode(), so just do the right ones in the LTDC
driver right away.
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Alexandre Torgue <alexandre.torgue@st.com>
Cc: Antonio Borneo <antonio.borneo@st.com>
Cc: Benjamin Gaignard <benjamin.gaignard@st.com>
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: Philippe Cornu <philippe.cornu@st.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Vincent Abriou <vincent.abriou@st.com>
Cc: Yannick Fertre <yannick.fertre@st.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-stm32@st-md-mailman.stormreply.com
To: dri-devel@lists.freedesktop.org
---
drivers/gpu/drm/stm/ltdc.c | 33 +++++++++++++++++----------------
1 file changed, 17 insertions(+), 16 deletions(-)
diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c
index 22c7e9fa5ab7..e8fc8fc50d94 100644
--- a/drivers/gpu/drm/stm/ltdc.c
+++ b/drivers/gpu/drm/stm/ltdc.c
@@ -545,7 +545,6 @@ static void ltdc_crtc_mode_set_nofb(struct drm_crtc *crtc)
struct ltdc_device *ldev = crtc_to_ltdc(crtc);
struct drm_device *ddev = crtc->dev;
struct drm_display_mode *mode = &crtc->state->adjusted_mode;
- struct videomode vm;
u32 bus_flags = 0;
u32 hsync, vsync, accum_hbp, accum_vbp, accum_act_w, accum_act_h;
u32 total_width, total_height;
@@ -565,31 +564,33 @@ static void ltdc_crtc_mode_set_nofb(struct drm_crtc *crtc)
}
}
- drm_display_mode_to_videomode(mode, &vm);
-
DRM_DEBUG_DRIVER("CRTC:%d mode:%s\n", crtc->base.id, mode->name);
- DRM_DEBUG_DRIVER("Video mode: %dx%d", vm.hactive, vm.vactive);
+ DRM_DEBUG_DRIVER("Video mode: %dx%d", mode->hdisplay, mode->vdisplay);
DRM_DEBUG_DRIVER(" hfp %d hbp %d hsl %d vfp %d vbp %d vsl %d\n",
- vm.hfront_porch, vm.hback_porch, vm.hsync_len,
- vm.vfront_porch, vm.vback_porch, vm.vsync_len);
+ mode->hsync_start - mode->hdisplay,
+ mode->htotal - mode->hsync_end,
+ mode->hsync_end - mode->hsync_start,
+ mode->vsync_start - mode->vdisplay,
+ mode->vtotal - mode->vsync_end,
+ mode->vsync_end - mode->vsync_start);
/* Convert video timings to ltdc timings */
- hsync = vm.hsync_len - 1;
- vsync = vm.vsync_len - 1;
- accum_hbp = hsync + vm.hback_porch;
- accum_vbp = vsync + vm.vback_porch;
- accum_act_w = accum_hbp + vm.hactive;
- accum_act_h = accum_vbp + vm.vactive;
- total_width = accum_act_w + vm.hfront_porch;
- total_height = accum_act_h + vm.vfront_porch;
+ hsync = mode->hsync_end - mode->hsync_start - 1;
+ vsync = mode->vsync_end - mode->vsync_start - 1;
+ accum_hbp = mode->htotal - mode->hsync_start - 1;
+ accum_vbp = mode->vtotal - mode->vsync_start - 1;
+ accum_act_w = accum_hbp + mode->hdisplay;
+ accum_act_h = accum_vbp + mode->vdisplay;
+ total_width = mode->htotal - 1;
+ total_height = mode->vtotal - 1;
/* Configures the HS, VS, DE and PC polarities. Default Active Low */
val = 0;
- if (vm.flags & DISPLAY_FLAGS_HSYNC_HIGH)
+ if (mode->flags & DRM_MODE_FLAG_PHSYNC)
val |= GCR_HSPOL;
- if (vm.flags & DISPLAY_FLAGS_VSYNC_HIGH)
+ if (mode->flags & DRM_MODE_FLAG_PVSYNC)
val |= GCR_VSPOL;
if (bus_flags & DRM_BUS_FLAG_DE_LOW)
--
2.29.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2021-06-08 16:58 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-28 8:05 [PATCH] drm/stm: Remove usage of drm_display_mode_to_videomode() Yannick Fertre
2021-05-28 14:01 ` yannick Fertre
2021-06-01 10:19 ` Philippe CORNU
-- strict thread matches above, loose matches on Subject: below --
2021-06-07 17:24 Marek Vasut
2021-06-08 16:56 ` Philippe CORNU
2020-12-24 6:20 Marek Vasut
2021-01-07 8:27 ` Yannick FERTRE
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).