All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bastien Nocera <hadess@hadess.net>
To: "Hans de Goede" <hdegoede@redhat.com>,
	"Daniel Vetter" <daniel.vetter@intel.com>,
	"Jani Nikula" <jani.nikula@linux.intel.com>,
	"Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: intel-gfx <intel-gfx@lists.freedesktop.org>,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 1/2] drm/fb-helper: Make fbdev inherit the crtc's rotation
Date: Sat, 06 May 2017 11:20:03 +0200	[thread overview]
Message-ID: <1494062403.22420.54.camel@hadess.net> (raw)
In-Reply-To: <77f99ccf-045f-dd9b-c937-970ce1526122@redhat.com>

On Sun, 2017-04-30 at 21:22 +0200, Hans de Goede wrote:
> Hi,
> 
> On 26-04-17 14:13, Bastien Nocera wrote:
> > On Sun, 2017-04-23 at 18:11 +0200, Hans de Goede wrote:
> > > From: Ville Syrjala <ville.syrjala@linux.intel.com>
> > > 
> > > If a connector added through drm_fb_helper_add_one_connector()
> > > has
> > > a crtc attached and that crtc has a rotation configured make the
> > > fbdev inherit the crtc's rotation.
> > > 
> > > This is useful on e.g. some tablets which have their lcd panel
> > > mounted
> > > upside down, which before this commit would result in the kernel
> > > boot
> > > messages switching from being shown the right way up in efifb to
> > > being
> > > shown upside down as soon as a native kms driver loads.
> > > 
> > > BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=94894
> > > Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
> > > [hdegoede@redhat.com: Split the drm/fb-helper bits out of Ville's
> > >   "drm/fb-helper: Inherit rotation wip" patch]
> > > Tested-by: Hans de Goede <hdegoede@redhat.com>
> > > Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> > > ---
> > >   drivers/gpu/drm/drm_fb_helper.c | 51
> > > ++++++++++++++++++++++++++++++++++++++---
> > >   include/drm/drm_fb_helper.h     |  2 ++
> > >   2 files changed, 50 insertions(+), 3 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/drm_fb_helper.c
> > > b/drivers/gpu/drm/drm_fb_helper.c
> > > index 324a688..c97e00ab 100644
> > > --- a/drivers/gpu/drm/drm_fb_helper.c
> > > +++ b/drivers/gpu/drm/drm_fb_helper.c
> > > @@ -159,6 +159,8 @@ int drm_fb_helper_add_one_connector(struct
> > > drm_fb_helper *fb_helper, struct drm_
> > >   {
> > >   	struct drm_fb_helper_connector **temp;
> > >   	struct drm_fb_helper_connector *fb_helper_connector;
> > > +	struct drm_crtc *crtc = connector->encoder ?
> > > +				connector->encoder->crtc : NULL;
> > >   
> > >   	if (!drm_fbdev_emulation)
> > >   		return 0;
> > > @@ -180,6 +182,11 @@ int drm_fb_helper_add_one_connector(struct
> > > drm_fb_helper *fb_helper, struct drm_
> > >   
> > >   	drm_connector_reference(connector);
> > >   	fb_helper_connector->connector = connector;
> > > +	if (crtc && crtc->primary->state)
> > > +		fb_helper_connector->rotation = crtc->primary-
> > > > state->rotation;
> > > 
> > > +	if (!fb_helper_connector->rotation)
> > > +		fb_helper_connector->rotation = DRM_ROTATE_0;
> > 
> > That's equivalent to:
> > if (fb_helper_connector->rotation = DRM_ROTATE_0)
> >     fb_helper_connector->rotation = DRM_ROTATE_0;
> 
> No it is not equivalent:
> 
> include/drm/drm_blend.h
> 40:#define DRM_ROTATE_0 BIT(0)
> 
> and BIT(0) is (1 << 0)

Urgh. I'd have a "DRM_ROTATE_UNSET = 0" added either to the public
header, or to this file and compare to it instead of "!rotation".
Because this really wasn't clear or obvious.

Cheers
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-05-06  9:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-23 16:11 [PATCH 1/2] drm: Make fbdev inherit the crtc's initial rotation Hans de Goede
2017-04-23 16:11 ` [PATCH 1/2] drm/fb-helper: Make fbdev inherit the crtc's rotation Hans de Goede
2017-04-26 12:13   ` Bastien Nocera
2017-04-30 19:22     ` Hans de Goede
2017-05-06  9:20       ` Bastien Nocera [this message]
2017-04-23 16:11 ` [PATCH 2/2] drm/i915: Make get_initial_plane_config also get the initial rotation config Hans de Goede
2017-04-26 12:14   ` Bastien Nocera
2017-04-24 12:48 ` [PATCH 1/2] drm: Make fbdev inherit the crtc's initial rotation Ville Syrjälä
2017-04-26 12:28   ` Bastien Nocera
2017-04-27 16:24     ` Ville Syrjälä
2017-04-27 16:39       ` Bastien Nocera
2017-04-30 19:34         ` Hans de Goede
2017-05-06  9:22           ` Bastien Nocera
2017-05-07  9:05           ` Hans de Goede

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=1494062403.22420.54.camel@hadess.net \
    --to=hadess@hadess.net \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hdegoede@redhat.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=ville.syrjala@linux.intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.