From: Thierry Reding <treding@nvidia.com>
To: Thomas Zimmermann <tzimmermann@suse.de>
Cc: javierm@redhat.com, maarten.lankhorst@linux.intel.com,
mripard@kernel.org, airlied@gmail.com, simona@ffwll.ch,
rayyan@ansari.sh, dri-devel@lists.freedesktop.org,
sashiko-reviews@lists.linux.dev
Subject: Re: [PATCH v2 6/6] drm/sysfb: simpledrm: Read panel orientation from DT node
Date: Tue, 23 Jun 2026 15:43:45 +0200 [thread overview]
Message-ID: <ajqNeuYBiSAHHLZn@orome> (raw)
In-Reply-To: <808d917d-28c4-4a84-a647-d5dc9123bd32@suse.de>
[-- Attachment #1: Type: text/plain, Size: 2475 bytes --]
On Tue, Jun 23, 2026 at 11:04:22AM +0200, Thomas Zimmermann wrote:
> Hi
>
> Am 22.06.26 um 18:17 schrieb Thierry Reding:
> > On Mon, Jun 22, 2026 at 03:19:40PM +0200, Thomas Zimmermann wrote:
> > > A DeviceTree panel node can specify the panel's rotation in steps
> > > of 90 degrees. Set the DRM connector orientation from the field.
> > > Do nothing if the field is missing or invalid.
> > >
> > > Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> > > ---
> > > drivers/gpu/drm/sysfb/simpledrm.c | 32 +++++++++++++++++++++++++++++--
> > > 1 file changed, 30 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/sysfb/simpledrm.c b/drivers/gpu/drm/sysfb/simpledrm.c
> > > index a04f0c852ea4..b585d17ca817 100644
> > > --- a/drivers/gpu/drm/sysfb/simpledrm.c
> > > +++ b/drivers/gpu/drm/sysfb/simpledrm.c
> > > @@ -221,6 +221,33 @@ simplefb_get_panel_height_mm_of(struct drm_device *dev, struct device_node *of_p
> > > return __simplefb_get_panel_size_mm_of(dev, of_panel_node, "height-mm");
> > > }
> > > +static enum drm_panel_orientation
> > > +simplefb_get_panel_orientation_of(struct drm_device *dev, struct device_node *of_panel_node)
> > > +{
> > > + int ret;
> > > + u32 rotation;
> > > +
> > > + ret = of_property_read_u32(of_panel_node, "rotation", &rotation);
> > > + if (ret) {
> > > + drm_dbg(dev, "simplefb: cannot parse panel rotation: error %d\n", ret);
> > Why is this debug level? Maybe we don't want an error if the property is
> > absent, but if it really can't be parsed, why not print out a proper
> > error?
> >
> > > + return DRM_MODE_PANEL_ORIENTATION_UNKNOWN;
> > > + }
> > > +
> > > + switch (rotation) {
> > > + case 0:
> > > + return DRM_MODE_PANEL_ORIENTATION_NORMAL;
> > > + case 90:
> > > + return DRM_MODE_PANEL_ORIENTATION_RIGHT_UP;
> > > + case 180:
> > > + return DRM_MODE_PANEL_ORIENTATION_BOTTOM_UP;
> > > + case 270:
> > > + return DRM_MODE_PANEL_ORIENTATION_LEFT_UP;
> > > + default:
> > > + drm_dbg(dev, "simplefb: cannot parse panel rotation: value %u\n", rotation);
> > Same here. Seems like we should be verbose when this contains an invalid
> > value. DT checkers should catch these already, so if the invalid value
> > makes it here, maybe we should sound the alarm.
>
> Ok. The review bot told me about of_drm_get_panel_orientation(). I intent to
> reimplement this patch on top of that helper.
Makes sense, yeah.
Thierry
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2026-06-23 13:44 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-22 13:19 [PATCH v2 0/6] drm/sysfb: simpledrm: Various improvements Thomas Zimmermann
2026-06-22 13:19 ` [PATCH v2 1/6] drm/sysfb: simpledrm: Improve framebuffer-size validation Thomas Zimmermann
2026-06-22 13:39 ` sashiko-bot
2026-06-22 15:36 ` Thierry Reding
2026-06-22 13:19 ` [PATCH v2 2/6] drm/sysfb: simpledrm: Improve panel-size validation Thomas Zimmermann
2026-06-22 16:05 ` Thierry Reding
2026-06-23 8:51 ` Thomas Zimmermann
2026-06-22 13:19 ` [PATCH v2 3/6] drm/sysfb: simpledrm: Inline simplefb_get_validated_int() Thomas Zimmermann
2026-06-22 16:06 ` Thierry Reding
2026-06-22 13:19 ` [PATCH v2 4/6] drm/sysfb: simpledrm: Improve stride validation Thomas Zimmermann
2026-06-22 16:10 ` Thierry Reding
2026-06-23 8:56 ` Thomas Zimmermann
2026-06-22 13:19 ` [PATCH v2 5/6] drm/sysfb: simpledrm: Validate mmap size against framebuffer size Thomas Zimmermann
2026-06-22 13:33 ` sashiko-bot
2026-06-22 13:47 ` Thomas Zimmermann
2026-06-22 16:13 ` Thierry Reding
2026-06-23 9:02 ` Thomas Zimmermann
2026-06-23 13:40 ` Thierry Reding
2026-06-22 13:19 ` [PATCH v2 6/6] drm/sysfb: simpledrm: Read panel orientation from DT node Thomas Zimmermann
2026-06-22 13:34 ` sashiko-bot
2026-06-22 16:17 ` Thierry Reding
2026-06-23 9:04 ` Thomas Zimmermann
2026-06-23 13:43 ` Thierry Reding [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=ajqNeuYBiSAHHLZn@orome \
--to=treding@nvidia.com \
--cc=airlied@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=javierm@redhat.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=rayyan@ansari.sh \
--cc=sashiko-reviews@lists.linux.dev \
--cc=simona@ffwll.ch \
--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