From: Daniel Vetter <daniel@ffwll.ch>
To: Eric Anholt <eric@anholt.net>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm: Consider drivers setting DRIVER_ATOMIC as atomic.
Date: Fri, 22 Jun 2018 10:29:54 +0200 [thread overview]
Message-ID: <20180622082954.GF2958@phenom.ffwll.local> (raw)
In-Reply-To: <20180621195428.17447-1-eric@anholt.net>
On Thu, Jun 21, 2018 at 12:54:28PM -0700, Eric Anholt wrote:
> Drivers such as vc4 don't initialize mode_config.funcs until later in
> initialization, but we know they're atomic since they've got the flag
> set. This avoids oopsing on dereferencing funcs in the new atomic
> methods sanity checks.
>
> I moved the atomic check function down below the core flag check, to
> avoid needing a prototype.
>
> Signed-off-by: Eric Anholt <eric@anholt.net>
> Fixes: ba1f665f161c ("drm: Add checks for atomic_[duplicate/destroy]_state with atomic drivers")
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
btw, dim fixes also generates Cc: tags for you (author/reviewer/maintainer
of the commit your fixing), besides just the Fixes: line.
-Daniel
> ---
> include/drm/drmP.h | 23 ++++++++++++-----------
> 1 file changed, 12 insertions(+), 11 deletions(-)
>
> diff --git a/include/drm/drmP.h b/include/drm/drmP.h
> index f5099c12c6a6..c5dfbdb7271d 100644
> --- a/include/drm/drmP.h
> +++ b/include/drm/drmP.h
> @@ -97,6 +97,16 @@ struct pci_controller;
>
> #define DRM_IF_VERSION(maj, min) (maj << 16 | min)
>
> +#define DRM_SWITCH_POWER_ON 0
> +#define DRM_SWITCH_POWER_OFF 1
> +#define DRM_SWITCH_POWER_CHANGING 2
> +#define DRM_SWITCH_POWER_DYNAMIC_OFF 3
> +
> +static inline bool drm_core_check_feature(struct drm_device *dev, int feature)
> +{
> + return dev->driver->driver_features & feature;
> +}
> +
> /**
> * drm_drv_uses_atomic_modeset - check if the driver implements
> * atomic_commit()
> @@ -107,17 +117,8 @@ struct pci_controller;
> */
> static inline bool drm_drv_uses_atomic_modeset(struct drm_device *dev)
> {
> - return dev->mode_config.funcs->atomic_commit != NULL;
> -}
> -
> -#define DRM_SWITCH_POWER_ON 0
> -#define DRM_SWITCH_POWER_OFF 1
> -#define DRM_SWITCH_POWER_CHANGING 2
> -#define DRM_SWITCH_POWER_DYNAMIC_OFF 3
> -
> -static inline bool drm_core_check_feature(struct drm_device *dev, int feature)
> -{
> - return dev->driver->driver_features & feature;
> + return drm_core_check_feature(dev, DRIVER_ATOMIC) ||
> + dev->mode_config.funcs->atomic_commit != NULL;
> }
>
> /* returns true if currently okay to sleep */
> --
> 2.18.0.rc2
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
prev parent reply other threads:[~2018-06-22 8:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-21 19:54 Eric Anholt
2018-06-22 8:29 ` Daniel Vetter [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=20180622082954.GF2958@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=eric@anholt.net \
--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