dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: "Noralf Trønnes" <noralf@tronnes.org>
Cc: daniel.vetter@ffwll.ch, emil.l.velikov@gmail.com,
	josef@lusticky.cz, dri-devel@lists.freedesktop.org,
	thierry.reding@gmail.com, laurent.pinchart@ideasonboard.com
Subject: Re: [PATCH 1/4] drm/mipi-dbi: Support command mode panel drivers
Date: Mon, 12 Aug 2019 20:49:31 +0200	[thread overview]
Message-ID: <20190812184931.GB6607@ravnborg.org> (raw)
In-Reply-To: <5bf97f4e-e6d0-0f2d-5e6a-f6d20617bc93@tronnes.org>

Hi Noralf.

> > - drm_panel has proper support for modes.
> >   This is today duplicated in mipi_dbi.
> >   Could we make it so that when a panel is used then the panel
> >   has the mode info - as we then use the panel more in the way we do
> >   in other cases?
> >   As it is now the mode is specified in mipi_dbi_dev_init()
> >   The drm_connector would then, if a panel is used, ask the panel for
> >   the mode.
> >   I did not really think to the end of this, but it seems wrong that
> >   we introduce drm_panel and then keep modes in mipi_dbi.
> > 
> 
> I considered that, but it would would just generate duplicate code for
> the connector. It would make sense to refactor this when/if all mipi dbi
> drivers are turned into panel drivers.

The objective should be that all mipi dbi drivers could be refactored.
And so it makes sense to do it right from the beginning.
It will be some duplicated code until all are migrated.
But as the number of mipi dbi drivers are low it is doable if a few
people throw some time after it.
I volunteer to assist.

In drm_mipi_dbi.c we could just add:

static int mipi_dbi_connector_get_modes(struct drm_connector *connector)
{
	...
        if (dbidev->panel)
                return drm_panel_get_modes(dbidev->panel);


Then if there is a panel we would use the mode specified by the panel.
To make this work we would need a drm_panel_attach() in
drm_mipi_dbi_panel_register() to give the panel access to the connector.
I have patches that makes connector an argument to drm_panel_get_modes()
but they need a bit more baking, so you cannot benefit from them yet.

Maybe this is the same argument as backlight?
We can introduce this when the drm_panel core is better prepared.

> >> +int drm_mipi_dbi_panel_register(struct drm_panel *panel, struct mipi_dbi_dev *dbidev,
> >> +				struct drm_driver *driver, const struct drm_display_mode *mode,
> >> +				u32 rotation)
> > Can we make this use enum drm_panel_orientation - so we can use
> > of_drm_get_panel_orientation() in the callers?
> > of_drm_get_panel_orientation() is not merged yet, but we could do so if
> > this patch-set needs it.
> > 
> > I know that this would require mipi_dbi_dev_init() and all users to be
> > updated. But it is a simpler interface so worth it.
> > 
> 
> That would break rotation on userspace that doesn't know about the panel
> orientation property which is a recent addition. These panels are mostly
> used in the embedded world not desktop. It also would break fbdev 90/270
> rotation (see drm_client_rotation()).

I think it is possible to move most of drm over to one way to spicify
rotation.
But let's wait with that battle until another day.
It should not hinder this series.

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

  reply	other threads:[~2019-08-12 18:49 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-01 13:52 [PATCH 0/4] drm/mipi-dbi: Support panel drivers Noralf Trønnes
2019-08-01 13:52 ` [PATCH 1/4] drm/mipi-dbi: Support command mode " Noralf Trønnes
2019-08-11 14:16   ` Sam Ravnborg
2019-08-12 12:05     ` Noralf Trønnes
2019-08-12 18:49       ` Sam Ravnborg [this message]
2019-08-13 16:24         ` Noralf Trønnes
2019-08-01 13:52 ` [PATCH 2/4] drm/tiny/ili9341: Move driver to drm/panel Noralf Trønnes
2019-08-01 19:43   ` David Lechner
2019-08-02 14:19     ` Noralf Trønnes
2019-08-11 15:24   ` Sam Ravnborg
2019-08-12 12:11     ` Noralf Trønnes
2019-08-01 13:52 ` [PATCH 3/4] drm/tiny/mi0283qt: Move driver to panel-ilitek-ili9341 Noralf Trønnes
2019-08-01 19:13   ` David Lechner
2019-08-01 13:52 ` [PATCH 4/4] drm/panel/ili9341: Support DPI panels Noralf Trønnes
2019-08-01 19:10   ` [4/4] " David Lechner
2019-08-02 14:14     ` Noralf Trønnes
2019-08-11 16:41   ` [PATCH 4/4] " Sam Ravnborg
2019-08-12 12:13     ` Noralf Trønnes
2019-08-12 15:35       ` Laurent Pinchart
2019-08-12 18:20         ` Sam Ravnborg
2019-08-11 17:02   ` Sam Ravnborg
2019-08-12 12:18     ` Noralf Trønnes

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=20190812184931.GB6607@ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=emil.l.velikov@gmail.com \
    --cc=josef@lusticky.cz \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=noralf@tronnes.org \
    --cc=thierry.reding@gmail.com \
    /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