Re: [PATCH 09/10] drm/exynos/hdmi: quirk for support mode timings conversion

2017-09-12 Thread Andrzej Hajda
On 12.09.2017 14:50, Tobias Jakobi wrote:
> Hello Andrzej,
>
>
> Andrzej Hajda wrote:
>> MIXER in SoCs prior to Exynos5420 supports only 4 video modes:
>> 720x480, 720x576, 1280x720, 1920x1080. Support for other modes
>> can be enabled by manipulating timings of HDMI. To do it
>> adjusted_mode should contain actual mode set on crtc.
>> With this patch it is possible to enable 1024x768 and 1280x1024
>> modes in MIXER.
> Reviewed-by: Tobias Jakobi 
>
> And some question below.
>
>
>> Suggested-by: Daniel Drake 
>> Signed-off-by: Andrzej Hajda 
>> ---
>>  drivers/gpu/drm/exynos/exynos_hdmi.c | 15 +--
>>  1 file changed, 13 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c 
>> b/drivers/gpu/drm/exynos/exynos_hdmi.c
>> index 7225b65..4b081f6 100644
>> --- a/drivers/gpu/drm/exynos/exynos_hdmi.c
>> +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
>> @@ -1239,6 +1239,17 @@ static void hdmi_v13_mode_apply(struct hdmi_context 
>> *hdata)
>>  static void hdmi_v14_mode_apply(struct hdmi_context *hdata)
>>  {
>>  struct drm_display_mode *m = >encoder.crtc->state->mode;
>> +struct drm_display_mode *am = 
>> >encoder.crtc->state->adjusted_mode;
>> +int hquirk = 0;
>> +
>> +/*
>> + * In case video mode coming from CRTC differs from requested one HDMI
>> + * sometimes is able to almost properly perform conversion - only
>> + * first line is distorted.
>> + */
>> +if ((m->vdisplay != am->vdisplay) &&
>> +(m->hdisplay == 1280 || m->hdisplay == 1024))
>> +hquirk = 258;
> Can it even happen, that m->hdisplay is neither 1280 nor 1024 but "m->vdisplay
> != am->vdisplay" still holds?

1680x1050-60 for example, it works without quirks.

Regards
Andrzej

>
>
>
>>  hdmi_reg_writev(hdata, HDMI_H_BLANK_0, 2, m->htotal - m->hdisplay);
>>  hdmi_reg_writev(hdata, HDMI_V_LINE_0, 2, m->vtotal);
>> @@ -1332,8 +1343,8 @@ static void hdmi_v14_mode_apply(struct hdmi_context 
>> *hdata)
>>  hdmi_reg_writev(hdata, HDMI_V_SYNC_LINE_AFT_PXL_6_0, 2, 0x);
>>  
>>  hdmi_reg_writev(hdata, HDMI_TG_H_FSZ_L, 2, m->htotal);
>> -hdmi_reg_writev(hdata, HDMI_TG_HACT_ST_L, 2, m->htotal - m->hdisplay);
>> -hdmi_reg_writev(hdata, HDMI_TG_HACT_SZ_L, 2, m->hdisplay);
>> +hdmi_reg_writev(hdata, HDMI_TG_HACT_ST_L, 2, m->htotal - m->hdisplay - 
>> hquirk);
>> +hdmi_reg_writev(hdata, HDMI_TG_HACT_SZ_L, 2, m->hdisplay + hquirk);
>>  hdmi_reg_writev(hdata, HDMI_TG_V_FSZ_L, 2, m->vtotal);
>>  if (hdata->drv_data == _hdmi_driver_data)
>>  hdmi_reg_writeb(hdata, HDMI_TG_DECON_EN, 1);
>>
>
>
>

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH 09/10] drm/exynos/hdmi: quirk for support mode timings conversion

2017-09-12 Thread Tobias Jakobi
Hello Andrzej,


Andrzej Hajda wrote:
> MIXER in SoCs prior to Exynos5420 supports only 4 video modes:
> 720x480, 720x576, 1280x720, 1920x1080. Support for other modes
> can be enabled by manipulating timings of HDMI. To do it
> adjusted_mode should contain actual mode set on crtc.
> With this patch it is possible to enable 1024x768 and 1280x1024
> modes in MIXER.

Reviewed-by: Tobias Jakobi 

And some question below.


> Suggested-by: Daniel Drake 
> Signed-off-by: Andrzej Hajda 
> ---
>  drivers/gpu/drm/exynos/exynos_hdmi.c | 15 +--
>  1 file changed, 13 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c 
> b/drivers/gpu/drm/exynos/exynos_hdmi.c
> index 7225b65..4b081f6 100644
> --- a/drivers/gpu/drm/exynos/exynos_hdmi.c
> +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
> @@ -1239,6 +1239,17 @@ static void hdmi_v13_mode_apply(struct hdmi_context 
> *hdata)
>  static void hdmi_v14_mode_apply(struct hdmi_context *hdata)
>  {
>   struct drm_display_mode *m = >encoder.crtc->state->mode;
> + struct drm_display_mode *am = 
> >encoder.crtc->state->adjusted_mode;
> + int hquirk = 0;
> +
> + /*
> +  * In case video mode coming from CRTC differs from requested one HDMI
> +  * sometimes is able to almost properly perform conversion - only
> +  * first line is distorted.
> +  */
> + if ((m->vdisplay != am->vdisplay) &&
> + (m->hdisplay == 1280 || m->hdisplay == 1024))
> + hquirk = 258;
Can it even happen, that m->hdisplay is neither 1280 nor 1024 but "m->vdisplay
!= am->vdisplay" still holds?



>   hdmi_reg_writev(hdata, HDMI_H_BLANK_0, 2, m->htotal - m->hdisplay);
>   hdmi_reg_writev(hdata, HDMI_V_LINE_0, 2, m->vtotal);
> @@ -1332,8 +1343,8 @@ static void hdmi_v14_mode_apply(struct hdmi_context 
> *hdata)
>   hdmi_reg_writev(hdata, HDMI_V_SYNC_LINE_AFT_PXL_6_0, 2, 0x);
>  
>   hdmi_reg_writev(hdata, HDMI_TG_H_FSZ_L, 2, m->htotal);
> - hdmi_reg_writev(hdata, HDMI_TG_HACT_ST_L, 2, m->htotal - m->hdisplay);
> - hdmi_reg_writev(hdata, HDMI_TG_HACT_SZ_L, 2, m->hdisplay);
> + hdmi_reg_writev(hdata, HDMI_TG_HACT_ST_L, 2, m->htotal - m->hdisplay - 
> hquirk);
> + hdmi_reg_writev(hdata, HDMI_TG_HACT_SZ_L, 2, m->hdisplay + hquirk);
>   hdmi_reg_writev(hdata, HDMI_TG_V_FSZ_L, 2, m->vtotal);
>   if (hdata->drv_data == _hdmi_driver_data)
>   hdmi_reg_writeb(hdata, HDMI_TG_DECON_EN, 1);
> 

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 09/10] drm/exynos/hdmi: quirk for support mode timings conversion

2017-09-06 Thread Andrzej Hajda
MIXER in SoCs prior to Exynos5420 supports only 4 video modes:
720x480, 720x576, 1280x720, 1920x1080. Support for other modes
can be enabled by manipulating timings of HDMI. To do it
adjusted_mode should contain actual mode set on crtc.
With this patch it is possible to enable 1024x768 and 1280x1024
modes in MIXER.

Suggested-by: Daniel Drake 
Signed-off-by: Andrzej Hajda 
---
 drivers/gpu/drm/exynos/exynos_hdmi.c | 15 +--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c 
b/drivers/gpu/drm/exynos/exynos_hdmi.c
index 7225b65..4b081f6 100644
--- a/drivers/gpu/drm/exynos/exynos_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
@@ -1239,6 +1239,17 @@ static void hdmi_v13_mode_apply(struct hdmi_context 
*hdata)
 static void hdmi_v14_mode_apply(struct hdmi_context *hdata)
 {
struct drm_display_mode *m = >encoder.crtc->state->mode;
+   struct drm_display_mode *am = 
>encoder.crtc->state->adjusted_mode;
+   int hquirk = 0;
+
+   /*
+* In case video mode coming from CRTC differs from requested one HDMI
+* sometimes is able to almost properly perform conversion - only
+* first line is distorted.
+*/
+   if ((m->vdisplay != am->vdisplay) &&
+   (m->hdisplay == 1280 || m->hdisplay == 1024))
+   hquirk = 258;
 
hdmi_reg_writev(hdata, HDMI_H_BLANK_0, 2, m->htotal - m->hdisplay);
hdmi_reg_writev(hdata, HDMI_V_LINE_0, 2, m->vtotal);
@@ -1332,8 +1343,8 @@ static void hdmi_v14_mode_apply(struct hdmi_context 
*hdata)
hdmi_reg_writev(hdata, HDMI_V_SYNC_LINE_AFT_PXL_6_0, 2, 0x);
 
hdmi_reg_writev(hdata, HDMI_TG_H_FSZ_L, 2, m->htotal);
-   hdmi_reg_writev(hdata, HDMI_TG_HACT_ST_L, 2, m->htotal - m->hdisplay);
-   hdmi_reg_writev(hdata, HDMI_TG_HACT_SZ_L, 2, m->hdisplay);
+   hdmi_reg_writev(hdata, HDMI_TG_HACT_ST_L, 2, m->htotal - m->hdisplay - 
hquirk);
+   hdmi_reg_writev(hdata, HDMI_TG_HACT_SZ_L, 2, m->hdisplay + hquirk);
hdmi_reg_writev(hdata, HDMI_TG_V_FSZ_L, 2, m->vtotal);
if (hdata->drv_data == _hdmi_driver_data)
hdmi_reg_writeb(hdata, HDMI_TG_DECON_EN, 1);
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel