Re: [PATCH 4/8] drm/exynos: mixer: remove src offset from mixer_graph_buffer()

2017-08-11 Thread Tobias Jakobi
Inki Dae wrote:
> 
> 
> 2017년 08월 09일 20:48에 Tobias Jakobi 이(가) 쓴 글:
>> We always translate the dma address such that the offsets of
>> the source image are zero. Hence we can remove manipulation of
>> the MXR_GRAPHIC_SXY(win) register.
>>
>> We leave the register defines (in regs_mixer.h) in place, since
>> they document the hardware.
>>
>> Signed-off-by: Tobias Jakobi 
>> ---
>>  drivers/gpu/drm/exynos/exynos_mixer.c | 11 ++-
>>  1 file changed, 2 insertions(+), 9 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c 
>> b/drivers/gpu/drm/exynos/exynos_mixer.c
>> index 8d68de85bada..28fbe79befff 100644
>> --- a/drivers/gpu/drm/exynos/exynos_mixer.c
>> +++ b/drivers/gpu/drm/exynos/exynos_mixer.c
>> @@ -584,7 +584,7 @@ static void mixer_graph_buffer(struct mixer_context *ctx,
>>  unsigned long flags;
>>  unsigned int win =lane->index;
>>  unsigned int x_ratio =, y_ratio = 0;
>> -unsigned int src_x_offset, src_y_offset, dst_x_offset, dst_y_offset;
>> +unsigned int dst_x_offset, dst_y_offset;
>>  dma_addr_t dma_addr;
>>  unsigned int fmt;
>>  u32 val;
>> @@ -618,12 +618,10 @@ static void mixer_graph_buffer(struct mixer_context 
>> *ctx,
>>  dst_x_offset =tate->crtc.x;
>>  dst_y_offset =tate->crtc.y;
>>  
>> -/* converting dma address base and source offset */
>> +/* translate dma address base s.t. the source image offset is zero */
>>  dma_addr =xynos_drm_fb_dma_addr(fb, 0)
>>  + (state->src.x * fb->format->cpp[0])
>>  + (state->src.y * fb->pitches[0]);
>> -src_x_offset =;
>> -src_y_offset =;
>>  
>>  if (mode->flags & DRM_MODE_FLAG_INTERLACE)
>>  __set_bit(MXR_BIT_INTERLACE, >flags);
>> @@ -654,11 +652,6 @@ static void mixer_graph_buffer(struct mixer_context 
>> *ctx,
>>  val |=XR_GRP_WH_V_SCALE(y_ratio);
>>  mixer_reg_write(res, MXR_GRAPHIC_WH(win), val);
>>  
>> -/* setup offsets in source image */
>> -val  =XR_GRP_SXY_SX(src_x_offset);
>> -val |=XR_GRP_SXY_SY(src_y_offset);
>> -mixer_reg_write(res, MXR_GRAPHIC_SXY(win), val);
> 
> The offset of source buffer can be set at bootloader so previous value can be 
> keeped. I think MXR_GRAPHIC_SXY register should be cleared at mixer_win_reset 
> function if you want to remove above lines.
> 
Good idea, will do so.

- Tobias


>> -
>>  /* setup offsets in display image */
>>  val  =XR_GRP_DXY_DX(dst_x_offset);
>>  val |=XR_GRP_DXY_DY(dst_y_offset);
>>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" 
> in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

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


Re: [PATCH 4/8] drm/exynos: mixer: remove src offset from mixer_graph_buffer()

2017-08-11 Thread Inki Dae


2017년 08월 09일 20:48에 Tobias Jakobi 이(가) 쓴 글:
> We always translate the dma address such that the offsets of
> the source image are zero. Hence we can remove manipulation of
> the MXR_GRAPHIC_SXY(win) register.
> 
> We leave the register defines (in regs_mixer.h) in place, since
> they document the hardware.
> 
> Signed-off-by: Tobias Jakobi 
> ---
>  drivers/gpu/drm/exynos/exynos_mixer.c | 11 ++-
>  1 file changed, 2 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c 
> b/drivers/gpu/drm/exynos/exynos_mixer.c
> index 8d68de85bada..28fbe79befff 100644
> --- a/drivers/gpu/drm/exynos/exynos_mixer.c
> +++ b/drivers/gpu/drm/exynos/exynos_mixer.c
> @@ -584,7 +584,7 @@ static void mixer_graph_buffer(struct mixer_context *ctx,
>   unsigned long flags;
>   unsigned int win = plane->index;
>   unsigned int x_ratio = 0, y_ratio = 0;
> - unsigned int src_x_offset, src_y_offset, dst_x_offset, dst_y_offset;
> + unsigned int dst_x_offset, dst_y_offset;
>   dma_addr_t dma_addr;
>   unsigned int fmt;
>   u32 val;
> @@ -618,12 +618,10 @@ static void mixer_graph_buffer(struct mixer_context 
> *ctx,
>   dst_x_offset = state->crtc.x;
>   dst_y_offset = state->crtc.y;
>  
> - /* converting dma address base and source offset */
> + /* translate dma address base s.t. the source image offset is zero */
>   dma_addr = exynos_drm_fb_dma_addr(fb, 0)
>   + (state->src.x * fb->format->cpp[0])
>   + (state->src.y * fb->pitches[0]);
> - src_x_offset = 0;
> - src_y_offset = 0;
>  
>   if (mode->flags & DRM_MODE_FLAG_INTERLACE)
>   __set_bit(MXR_BIT_INTERLACE, >flags);
> @@ -654,11 +652,6 @@ static void mixer_graph_buffer(struct mixer_context *ctx,
>   val |= MXR_GRP_WH_V_SCALE(y_ratio);
>   mixer_reg_write(res, MXR_GRAPHIC_WH(win), val);
>  
> - /* setup offsets in source image */
> - val  = MXR_GRP_SXY_SX(src_x_offset);
> - val |= MXR_GRP_SXY_SY(src_y_offset);
> - mixer_reg_write(res, MXR_GRAPHIC_SXY(win), val);

The offset of source buffer can be set at bootloader so previous value can be 
keeped. I think MXR_GRAPHIC_SXY register should be cleared at mixer_win_reset 
function if you want to remove above lines.

> -
>   /* setup offsets in display image */
>   val  = MXR_GRP_DXY_DX(dst_x_offset);
>   val |= MXR_GRP_DXY_DY(dst_y_offset);
> 
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH 4/8] drm/exynos: mixer: remove src offset from mixer_graph_buffer()

2017-08-09 Thread Tobias Jakobi
We always translate the dma address such that the offsets of
the source image are zero. Hence we can remove manipulation of
the MXR_GRAPHIC_SXY(win) register.

We leave the register defines (in regs_mixer.h) in place, since
they document the hardware.

Signed-off-by: Tobias Jakobi 
---
 drivers/gpu/drm/exynos/exynos_mixer.c | 11 ++-
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c 
b/drivers/gpu/drm/exynos/exynos_mixer.c
index 8d68de85bada..28fbe79befff 100644
--- a/drivers/gpu/drm/exynos/exynos_mixer.c
+++ b/drivers/gpu/drm/exynos/exynos_mixer.c
@@ -584,7 +584,7 @@ static void mixer_graph_buffer(struct mixer_context *ctx,
unsigned long flags;
unsigned int win = plane->index;
unsigned int x_ratio = 0, y_ratio = 0;
-   unsigned int src_x_offset, src_y_offset, dst_x_offset, dst_y_offset;
+   unsigned int dst_x_offset, dst_y_offset;
dma_addr_t dma_addr;
unsigned int fmt;
u32 val;
@@ -618,12 +618,10 @@ static void mixer_graph_buffer(struct mixer_context *ctx,
dst_x_offset = state->crtc.x;
dst_y_offset = state->crtc.y;
 
-   /* converting dma address base and source offset */
+   /* translate dma address base s.t. the source image offset is zero */
dma_addr = exynos_drm_fb_dma_addr(fb, 0)
+ (state->src.x * fb->format->cpp[0])
+ (state->src.y * fb->pitches[0]);
-   src_x_offset = 0;
-   src_y_offset = 0;
 
if (mode->flags & DRM_MODE_FLAG_INTERLACE)
__set_bit(MXR_BIT_INTERLACE, >flags);
@@ -654,11 +652,6 @@ static void mixer_graph_buffer(struct mixer_context *ctx,
val |= MXR_GRP_WH_V_SCALE(y_ratio);
mixer_reg_write(res, MXR_GRAPHIC_WH(win), val);
 
-   /* setup offsets in source image */
-   val  = MXR_GRP_SXY_SX(src_x_offset);
-   val |= MXR_GRP_SXY_SY(src_y_offset);
-   mixer_reg_write(res, MXR_GRAPHIC_SXY(win), val);
-
/* setup offsets in display image */
val  = MXR_GRP_DXY_DX(dst_x_offset);
val |= MXR_GRP_DXY_DY(dst_y_offset);
-- 
2.13.0

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