From: Daniel Vetter <daniel@ffwll.ch>
To: Daniel Palmer <daniel@0x0f.com>, Hans de Goede <j.w.r.degoede@gmail.com>
Cc: dri-devel@lists.freedesktop.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [RFC] How to add hardware rotation, scaling etc to a DRM/KMS driver
Date: Wed, 19 Jan 2022 17:30:18 +0100 [thread overview]
Message-ID: <Yeg8mi0S2ACy9q8O@phenom.ffwll.local> (raw)
In-Reply-To: <CAFr9PXnig9YfnwSzMg5UPm3UtAsEAQT_xVheBbLppiU45mc_QQ@mail.gmail.com>
On Wed, Jan 19, 2022 at 05:55:22PM +0900, Daniel Palmer wrote:
> Hi all,
>
> I've copied and pasted my way to mostly working DRM/KMS driver for a
> low cost ARM SoC (Sigmastar SSD202D). The hardware is 2D only.
>
> One of the devices that uses this SoC has the screen upside down so it
> needs the screen rotated.
> The hardware doesn't have bits that change the scan out direction from
> what I can tell (so it can't mirror/flip while feeding it to the
> screen) but it does have a 2D blitter style block that can take a
> framebuffer and flip/mirror/scale/convert the colour space into
> another buffer.
>
> My idea was to create a buffer for the rotated image when allocating
> the framebuffer and trigger the hardware to do the conversion each
> vblank or something.
>
> While reading the discussion about maintaining fbdev I realised maybe
> I should ask instead of wasting too much time on something that's
> wrong.
>
> I got the feeling that maybe I should just provide an interface to the
> blitter from userspace and userspace should be doing the rotation. I'd
> like to do it in the kernel so stuff like SDL1 apps just work but
> maybe that isn't possible?
panel orientation property is for that stuff:
https://dri.freedesktop.org/docs/drm/gpu/drm-kms.html#standard-connector-properties
You need to scroll down to the "panel orientation:" property. And here's
how to quirk this for at least some cases (for dt panels it should be in
the dt):
https://dri.freedesktop.org/docs/drm/gpu/drm-kms-helpers.html?highlight=drm_get_panel_orientation_quirk#c.drm_get_panel_orientation_quirk"
fbcon will head this and rotate in sw, as should any competent compositor
in userspace (but some might not, it depends).
Also ping Hans de Geode if you have any questions, he's done this.
-Daniel
>
> Cheers,
>
> Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
next prev parent reply other threads:[~2022-01-19 16:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-19 8:55 Daniel Palmer
2022-01-19 16:30 ` Daniel Vetter [this message]
2022-01-20 11:15 ` Daniel Palmer
2022-01-20 11:24 ` Hans de Goede
2022-01-20 11:44 ` Daniel Palmer
2022-01-20 11:40 ` Daniel Vetter
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=Yeg8mi0S2ACy9q8O@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=daniel@0x0f.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=j.w.r.degoede@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/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
Powered by JetHome