From: Jocelyn Falempe <jfalempe@redhat.com>
To: Pekka Paalanen <ppaalanen@gmail.com>
Cc: tzimmermann@suse.de, javierm@redhat.com,
Maxime Ripard <mripard@kernel.org>,
dri-devel@lists.freedesktop.org, airlied@redhat.com
Subject: Re: [PATCH 1/1] drm/fourcc: Add documentation about software color conversion.
Date: Wed, 23 Aug 2023 11:14:56 +0200 [thread overview]
Message-ID: <0336b4cd-1557-3fff-c8df-cf21ee123e34@redhat.com> (raw)
In-Reply-To: <20230823111105.1281a980@eldfell>
On 23/08/2023 10:11, Pekka Paalanen wrote:
> On Tue, 22 Aug 2023 17:49:08 +0200
> Jocelyn Falempe <jfalempe@redhat.com> wrote:
>
>> On 22/08/2023 10:20, Pekka Paalanen wrote:
>>> On Mon, 21 Aug 2023 17:55:33 +0200
>>> Maxime Ripard <mripard@kernel.org> wrote:
>>>
>>>> Hi Pekka,
>>>>
>>>> Thanks for answering
>>>>
>>>> On Fri, Aug 18, 2023 at 04:24:15PM +0300, Pekka Paalanen wrote:
>>>>> On Thu, 10 Aug 2023 09:45:27 +0200
>>>>> Maxime Ripard <mripard@kernel.org> wrote:
>>>>>> On Mon, Aug 07, 2023 at 03:45:15PM +0200, Jocelyn Falempe wrote:
>>>>>>> After discussions on IRC, the consensus is that the DRM drivers should
>>>>>>> not do software color conversion, and only advertise the supported formats.
>>>>>>> Update the doc accordingly so that the rule and exceptions are clear for
>>>>>>> everyone.
>>>>>>>
>>>>>>> Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
>>>>>>> ---
>>>>>>> include/uapi/drm/drm_fourcc.h | 7 +++++++
>>>>>>> 1 file changed, 7 insertions(+)
>
> ...
>
>>> In the XRGB8888 to RGB888 case, the kernel doing the conversion may
>>> allow for higher resolutions, but it may also hurt framerate more than
>>> userspace doing conversion, theoretically. For lower resolution where
>>> XRGB8888 could be scanned out directly from VRAM, the conversion would
>>> be strictly hurting.
>>>
>> I think that depends on the hardware. For the Matrox, the bandwidth
>> between system RAM and VRAM is so low, that doing the conversion is much
>> faster than copying XRGB8888 to the VRAM. It also uses less CPU cycles,
>> because the copy is done with memcpy(), (DMA is broken or even slower on
>> most mgag200 hardware).
>> To get numbers, on my test machine, copying the 5MB framebuffer XRGB8888
>> to VRAM takes 125ms. Copying 3.75MB RGB888 framebuffer takes 95ms. The
>> conversion has no measurable impact, as it is done on the fly during the
>> memcpy, when the CPU is waiting for the bus to accept more data.
>> Doing the conversion in user-space would actually be slower, even with
>> SSE, because they won't use the "wasted" cpu cycle. But anyway the
>> conversion can take a few micro-seconds on the CPU, which is still
>> negligible compared to the memory transfer.
>
> I stand corrected!
>
> Always exceptions. :-)
>
> I suppose you have dumb alloc returning sysmem, and PREFER_SHADOW set
> to false to go with that? Sounds good for XRGB8888. I guess there is
> not enough VRAM to alloc dumb buffers from there anyway?
Yes VRAM is between 4MB to 16MB, so the driver only expose dumb buffers
in system RAM, and PREFER_SHADOW is set to false.
>
>> Before sending the v2, Simon Ser proposed to move the paragraph to
>> https://elixir.bootlin.com/linux/latest/source/drivers/gpu/drm/drm_plane.c#L132
>> instead of fourcc.h.
>> I'm wondering what other thinks about this.
>
> I like moving it out of drm_fourcc.h. drm_fourcc.h is about format
> definitions which are used by things like EGL, Wayland, and whatnot
> which are not KMS specific.
Ok thanks, I will move it to drm_plane then.
>
>
> Thanks,
> pq
Best regards,
--
Jocelyn
prev parent reply other threads:[~2023-08-23 9:15 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-07 13:45 [PATCH 0/1] drm/fourcc: Add documentation about software color conversion Jocelyn Falempe
2023-08-07 13:45 ` [PATCH 1/1] " Jocelyn Falempe
2023-08-09 16:29 ` Simon Ser
2023-08-10 9:23 ` Jocelyn Falempe
2023-08-10 7:45 ` Maxime Ripard
2023-08-10 10:22 ` Jocelyn Falempe
2023-08-11 16:12 ` Javier Martinez Canillas
2023-08-18 13:24 ` Pekka Paalanen
2023-08-21 15:55 ` Maxime Ripard
2023-08-22 8:20 ` Pekka Paalanen
2023-08-22 15:49 ` Jocelyn Falempe
2023-08-23 8:11 ` Pekka Paalanen
2023-08-23 9:14 ` Jocelyn Falempe [this message]
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=0336b4cd-1557-3fff-c8df-cf21ee123e34@redhat.com \
--to=jfalempe@redhat.com \
--cc=airlied@redhat.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=javierm@redhat.com \
--cc=mripard@kernel.org \
--cc=ppaalanen@gmail.com \
--cc=tzimmermann@suse.de \
/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