From: sw0312.kim@samsung•com (Seung-Woo Kim)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH 2/4] drm/exynos/mixer: use MXR_GRP_SXY_SY
Date: Thu, 08 May 2014 13:33:04 +0900 [thread overview]
Message-ID: <536B0900.10204@samsung.com> (raw)
In-Reply-To: <CAGS+omAbuzRpNDvB6eTw67Dcv3WMdWF3yz+bU5p3j5JRourOyw@mail.gmail.com>
Hello Daniel,
On 2014? 05? 07? 23:14, Daniel Kurtz wrote:
> On Wed, May 7, 2014 at 1:14 PM, Seung-Woo Kim <sw0312.kim@samsung•com> wrote:
>> Hi Daniel,
>>
>> On 2014? 05? 05? 00:26, Daniel Kurtz wrote:
>>> Mixer hardware supports offsetting dma from start of source buffer using
>>> the MXR_GRP_SXY register.
>>>
>>> Signed-off-by: Daniel Kurtz <djkurtz@chromium•org>
>>> ---
>>> drivers/gpu/drm/exynos/exynos_mixer.c | 8 +++-----
>>> 1 file changed, 3 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
>>> index 475eb49..40cf39b 100644
>>> --- a/drivers/gpu/drm/exynos/exynos_mixer.c
>>> +++ b/drivers/gpu/drm/exynos/exynos_mixer.c
>>> @@ -529,13 +529,11 @@ static void mixer_graph_buffer(struct mixer_context *ctx, int win)
>>>
>>> dst_x_offset = win_data->crtc_x;
>>> dst_y_offset = win_data->crtc_y;
>>> + src_x_offset = win_data->fb_x;
>>> + src_y_offset = win_data->fb_y;
>>>
>>> /* converting dma address base and source offset */
>>> - dma_addr = win_data->dma_addr
>>> - + (win_data->fb_x * win_data->bpp >> 3)
>>> - + (win_data->fb_y * win_data->fb_width * win_data->bpp >> 3);
>>> - src_x_offset = 0;
>>> - src_y_offset = 0;
>>> + dma_addr = win_data->dma_addr;
>>
>> Basically, you are right and source offset register can be used. But
>> because of limitation of resolution for mixer up to 1920x1080, I
>> considered modified soruce dma address to set one frame buffer, which is
>> bigger than 1920x1080, on to both fimd and hdmi.
>
> Hi Seung-Woo,
>
> I do not see why the maximum MIXER resolution matters for choosing
> between offsetting BASE or using SXY.
>
> Let's say you have one big 1920x1908 framebuffer, with a span of 1920,
> starting at dma_addr (there is no extra padding at the end of the
> line).
> Let's say you wanted the mixer to scan out 1920x1080 pixels starting
> from (0, 800) in the framebuffer, and start drawing them at (0,0) on
> the screen.
>
> What we currently do is:
> BASE = dma_addr + (800 * 1080 * 4)
> SPAN = 1920
> SXY = SX(0) | SY(0)
> WH = W(1920) | H(1080)
> DXY = DX(0) | DY(0)
>
> I am proposing we do:
> BASE = dma_addr
> SPAN = 1920
> SXY = SX(0) | SY(800)
> WH = W(1920) | H(1080)
> DXY = DX(0) | DY(0)
>
> In both cases, the mixer resolution is 1920x1080.
In my test to show each half of big one framebuffer (3840 x 1080) to
FIMD from 0 to 1079 and MIXER from 1080 to 3839 with exynos4210 and
exynos4412, it was failed to show proper hdmi display. Also it is same
for framebuffer (1920 x 2160). AFAIK, it is mainly because mixer dma has
limitation of dma memory size.
In this case, I set register as like:
BASE = dma_addr /* 3840 x 1080 x 4 */
SPAN = 3840
SXY = SX(1920) | SY(0)
WH = W(1920) | H(1080)
DXY = DX(0) | DY(0)
or:
BASE = dma_addr /* 1920 x 2160 x 4 */
SPAN = 1920
SXY = SX(0) | SY(1080)
WH = W(1920) | H(1080)
DXY = DX(0) | DY(0)
but these two setting did not show hdmi display as I expected. So I used
modified dma address.
>
> My motivation for wanting to program an un-modified dma_addr into BASE
> is so we can then just check BASE_S to determine from which buffer the
> mixer is actively being scanned out without worrying about the source
> offset, since the source offset can change for a given framebuffer
> (for example, when doing panning, or if an overlay is used for a HW
> cursor).
Actually, this patch is exactly same with my first implementation, so I
completely understand your motivation. Anyway, I was focus on extended
displays with one buffer, so I wrote modified dma base address.
Thanks and Regards,
- Seung-Woo Kim
>
> Best Regards,
> -Daniel
>
>>
>> Regards,
>> - Seung-Woo Kim
>>
>>>
>>> if (win_data->scan_flags & DRM_MODE_FLAG_INTERLACE)
>>> ctx->interlace = true;
>>>
>>
>> --
>> Seung-Woo Kim
>> Samsung Software R&D Center
>> --
>>
>
--
Seung-Woo Kim
Samsung Software R&D Center
--
next prev parent reply other threads:[~2014-05-08 4:33 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-04 15:26 [PATCH 0/4] drm/exynos/mixer: small cleanups Daniel Kurtz
2014-05-04 15:26 ` [PATCH 1/4] drm/exynos/mixer: move format definitions to regs-mixer Daniel Kurtz
2014-05-04 15:26 ` [PATCH 2/4] drm/exynos/mixer: use MXR_GRP_SXY_SY Daniel Kurtz
2014-05-07 5:14 ` Seung-Woo Kim
2014-05-07 14:14 ` Daniel Kurtz
2014-05-08 4:33 ` Seung-Woo Kim [this message]
2014-05-08 9:21 ` Daniel Kurtz
2014-05-08 11:38 ` Inki Dae
2014-05-04 15:26 ` [PATCH 3/4] drm/exynos/mixer: planes are not disabled by setting dma_addr to zero Daniel Kurtz
2014-05-04 15:26 ` [PATCH 4/4] drm/exynos/mixer: add support for NV21 Daniel Kurtz
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=536B0900.10204@samsung.com \
--to=sw0312.kim@samsung$(echo .)com \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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