From: Daniel Vetter <daniel@ffwll.ch>
To: "Noralf Trønnes" <noralf@tronnes.org>
Cc: daniel.vetter@ffwll.ch, intel-gfx@lists.freedesktop.org,
dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2 08/12] drm/fb-helper: Move out commit code
Date: Thu, 18 Apr 2019 10:30:16 +0200 [thread overview]
Message-ID: <20190418083016.GS13337@phenom.ffwll.local> (raw)
In-Reply-To: <0a898190-cff7-9422-eb45-24723113e9fb@tronnes.org>
On Wed, Apr 17, 2019 at 07:56:20PM +0200, Noralf Trønnes wrote:
>
>
> Den 16.04.2019 10.38, skrev Daniel Vetter:
> > On Sun, Apr 07, 2019 at 06:52:39PM +0200, Noralf Trønnes wrote:
> >> Move the modeset commit code to drm_client_modeset.
> >> No changes except exporting API.
> >>
> >> v2: Move to drm_client_modeset.c instead of drm_client.c
> >>
> >> Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
> >> ---
> >> drivers/gpu/drm/drm_client_modeset.c | 287 +++++++++++++++++++++++++++
>
> <snip>
>
> >> -/**
> >> - * drm_client_panel_rotation() - Check panel orientation
> >> - * @modeset: DRM modeset
> >> - * @rotation: Returned rotation value
> >> - *
> >> - * This function checks if the primary plane in @modeset can hw rotate to match
> >> - * the panel orientation on its connector.
> >> - *
> >> - * Note: Currently only 0 and 180 degrees are supported.
> >> - *
> >> - * Return:
> >> - * True if the plane can do the rotation, false otherwise.
> >> - */
> >> -bool drm_client_panel_rotation(struct drm_mode_set *modeset, unsigned int *rotation)
> >
> > Why not static? Doesn't seem to be used by anything outside of
> > drm_client_modeset.c.
> >
>
> It is used in drm_fb_helper.c:drm_setup_crtcs_fb() to set up any
> rotation and do fbcon sw rotation if necessary. Clients that support
> rotation need to call it.
>
> >> -{
> >> - struct drm_connector *connector = modeset->connectors[0];
> >> - struct drm_plane *plane = modeset->crtc->primary;
> >> - u64 valid_mask = 0;
> >> - unsigned int i;
> >> -
> >> - if (!modeset->num_connectors)
> >> - return false;
> >> -
> >> - switch (connector->display_info.panel_orientation) {
> >> - case DRM_MODE_PANEL_ORIENTATION_BOTTOM_UP:
> >> - *rotation = DRM_MODE_ROTATE_180;
> >> - break;
> >> - case DRM_MODE_PANEL_ORIENTATION_LEFT_UP:
> >> - *rotation = DRM_MODE_ROTATE_90;
> >> - break;
> >> - case DRM_MODE_PANEL_ORIENTATION_RIGHT_UP:
> >> - *rotation = DRM_MODE_ROTATE_270;
> >> - break;
> >> - default:
> >> - *rotation = DRM_MODE_ROTATE_0;
> >> - }
> >> -
> >> - /*
> >> - * TODO: support 90 / 270 degree hardware rotation,
> >> - * depending on the hardware this may require the framebuffer
> >> - * to be in a specific tiling format.
> >> - */
> >> - if (*rotation != DRM_MODE_ROTATE_180 || !plane->rotation_property)
> >> - return false;
> >> -
> >> - for (i = 0; i < plane->rotation_property->num_values; i++)
> >> - valid_mask |= (1ULL << plane->rotation_property->values[i]);
> >> -
> >> - if (!(*rotation & valid_mask))
> >> - return false;
> >> -
> >> - return true;
> >> -}
> >> -
>
> <snip>
>
> >> diff --git a/include/drm/drm_client.h b/include/drm/drm_client.h
> >> index 858c8be70870..64b725b318f2 100644
> >> --- a/include/drm/drm_client.h
> >> +++ b/include/drm/drm_client.h
> >> @@ -154,6 +154,10 @@ int drm_client_modeset_create(struct drm_client_dev *client);
> >> void drm_client_modeset_free(struct drm_client_dev *client);
> >> void drm_client_modeset_release(struct drm_client_dev *client);
> >> struct drm_mode_set *drm_client_find_modeset(struct drm_client_dev *client, struct drm_crtc *crtc);
> >> +bool drm_client_panel_rotation(struct drm_mode_set *modeset, unsigned int *rotation);
> >> +int drm_client_modeset_commit_force(struct drm_client_dev *client);
> >
> > I think latest here the _force postfix stopped making sense. It's just a
> > commit. Also I'm wondering whether we shouldn't pull the
> > master_acquire_internal into these helpers here, there's not really a
> > use-case I can think of where we should not check for other masters.
> >
>
> drm_master_internal_acquire() is used in various places in drm_fb_helper
> for functions that doesn't make sense to move to drm_client, like:
> - drm_fb_helper_setcmap
> - drm_fb_helper_ioctl
> - drm_fb_helper_pan_display
See discussion on the earlier patches, I completely backtracked on this
after better understanding why we need _force.
And exporting/using master_acquire_internal by drm_clients makes total
sense to me.
-Daniel
>
> Noralf.
>
> > Only two kernel modeset requests want to ignore master status:
> > - debug enter/leave, which is utterly broken by design (and outright
> > disable for any atomic driver)
> > - panic handling, for which we now have a really nice plan, plus first
> > sketches of an implementation.
> >
> > Cheers, Daniel
> >
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2019-04-18 8:30 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-07 16:52 [PATCH v2 00/12] drm/fb-helper: Move modesetting code to drm_client Noralf Trønnes
2019-04-07 16:52 ` [PATCH v2 01/12] drm/atomic: Move __drm_atomic_helper_disable_plane/set_config() Noralf Trønnes
2019-04-16 9:12 ` Maxime Ripard
2019-04-07 16:52 ` [PATCH v2 02/12] drm/fb-helper: Avoid race with DRM userspace Noralf Trønnes
2019-04-16 7:59 ` Daniel Vetter
2019-04-16 18:46 ` Noralf Trønnes
2019-04-17 13:24 ` Daniel Vetter
2019-04-17 13:26 ` Daniel Vetter
2019-04-17 14:48 ` Noralf Trønnes
2019-04-16 9:26 ` Maxime Ripard
2019-04-07 16:52 ` [PATCH v2 03/12] drm/i915/fbdev: Move intel_fb_initial_config() to fbdev helper Noralf Trønnes
2019-04-11 14:25 ` Noralf Trønnes
2019-04-23 14:17 ` Thomas Zimmermann
2019-04-23 14:58 ` Noralf Trønnes
2019-04-07 16:52 ` [PATCH v2 04/12] drm/fb-helper: No need to cache rotation and sw_rotations Noralf Trønnes
2019-04-16 9:28 ` Maxime Ripard
2019-04-07 16:52 ` [PATCH v2 05/12] drm/fb-helper: Remove drm_fb_helper_crtc->{x, y, desired_mode} Noralf Trønnes
2019-04-16 9:29 ` Maxime Ripard
2019-04-07 16:52 ` [PATCH v2 06/12] drm/fb-helper: Remove drm_fb_helper_crtc Noralf Trønnes
2019-04-16 8:34 ` Daniel Vetter
2019-04-07 16:52 ` [PATCH v2 07/12] drm/fb-helper: Prepare to move out commit code Noralf Trønnes
2019-04-07 16:52 ` [PATCH v2 08/12] drm/fb-helper: Move " Noralf Trønnes
2019-04-16 8:38 ` Daniel Vetter
2019-04-17 17:56 ` Noralf Trønnes
2019-04-18 8:30 ` Daniel Vetter [this message]
2019-04-07 16:52 ` [PATCH v2 09/12] drm/fb-helper: Remove drm_fb_helper_connector Noralf Trønnes
2019-04-16 9:42 ` Maxime Ripard
2019-04-16 14:57 ` Noralf Trønnes
2019-04-17 16:48 ` Maxime Ripard
2019-04-07 16:52 ` [PATCH v2 10/12] drm/fb-helper: Prepare to move out modeset config code Noralf Trønnes
2019-04-16 9:43 ` Maxime Ripard
2019-04-07 16:52 ` [PATCH v2 11/12] drm/fb-helper: Move " Noralf Trønnes
2019-04-16 9:43 ` Maxime Ripard
2019-04-07 16:52 ` [PATCH v2 12/12] drm/client: Hack: Add bootsplash example Noralf Trønnes
2019-04-07 17:02 ` ✗ Fi.CI.CHECKPATCH: warning for drm/fb-helper: Move modesetting code to drm_client (rev2) Patchwork
2019-04-07 17:10 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-04-07 17:21 ` ✓ Fi.CI.BAT: success " Patchwork
2019-04-07 18:29 ` ✓ Fi.CI.IGT: " Patchwork
2019-04-16 8:41 ` [PATCH v2 00/12] drm/fb-helper: Move modesetting code to drm_client Daniel Vetter
2019-04-16 8:46 ` Daniel Vetter
2019-04-17 18:06 ` 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=20190418083016.GS13337@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=daniel.vetter@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=noralf@tronnes.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 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.