linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Sam Ravnborg <sam@ravnborg.org>
Cc: Daniel Vetter <daniel@ffwll.ch>, David Airlie <airlied@linux.ie>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <maxime.ripard@bootlin.com>,
	Sean Paul <sean@poorly.run>,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v1 2/7] drm: move DRM_SWITCH_POWER defines to drm_device.h
Date: Thu, 27 Dec 2018 13:12:35 +0100	[thread overview]
Message-ID: <20181227121234.GE9058@dvetter-linux.ger.corp.intel.com> (raw)
In-Reply-To: <20181226210353.13993-2-sam@ravnborg.org>

On Wed, Dec 26, 2018 at 10:03:48PM +0100, Sam Ravnborg wrote:
> Move DRM_SWITCH_POWER out of drmP.h to allow users
> to get rid of the drmP include.
> 
> DRM_SWITCH_POWER defines are used in combination
> with drm_device.switch_power_state.
> 
> Move the DRM_SWITCH_POWER defines to the file where
> drm_device.switch_power_state is defined.
> 
> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Maxime Ripard <maxime.ripard@bootlin.com>
> Cc: Sean Paul <sean@poorly.run>
> Cc: David Airlie <airlied@linux.ie>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> ---
>  include/drm/drmP.h       | 5 -----
>  include/drm/drm_device.h | 9 +++++++++
>  2 files changed, 9 insertions(+), 5 deletions(-)
> 
> diff --git a/include/drm/drmP.h b/include/drm/drmP.h
> index b6b8436b5123..2ba786820052 100644
> --- a/include/drm/drmP.h
> +++ b/include/drm/drmP.h
> @@ -95,11 +95,6 @@ struct dma_buf_attachment;
>  struct pci_dev;
>  struct pci_controller;
>  
> -#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
> -
>  /* returns true if currently okay to sleep */
>  static inline bool drm_can_sleep(void)
>  {
> diff --git a/include/drm/drm_device.h b/include/drm/drm_device.h
> index 42411b3ea0c8..c3da194d25f9 100644
> --- a/include/drm/drm_device.h
> +++ b/include/drm/drm_device.h
> @@ -24,6 +24,13 @@ struct inode;
>  struct pci_dev;
>  struct pci_controller;
>  
> +
> +/* Used by drm_device.switch_power_state */
> +#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

Since this isn't uapi it'd be nice to change it to an enum, which we can
then properly kernel-doc and make your references links in the resulting
html. Otherwise lgtm.

Would need an include stanza for drm_device.h in drm-internals.rst, plus a
bit of kernel-doc cleanup in here I think (which iirc is why I didn't yet
do this).
-Daniel

> +
>  /**
>   * DRM device structure. This structure represent a complete card that
>   * may contain multiple heads.
> @@ -222,6 +229,8 @@ struct drm_device {
>  	struct idr object_name_idr;
>  	struct drm_vma_offset_manager *vma_offset_manager;
>  	/*@} */
> +
> +	/* See DRM_SWITCH_POWER defines */
>  	int switch_power_state;
>  
>  	/**
> -- 
> 2.12.0
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

  reply	other threads:[~2018-12-27 12:12 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-26 21:02 [PATCH v1 0/7] drm: minimize drmP.h dependencies Sam Ravnborg
2018-12-26 21:03 ` [PATCH v1 1/7] drm: move DRM_IF_VERSION to drm_internal.h Sam Ravnborg
2018-12-27 12:09   ` Daniel Vetter
2018-12-26 21:03 ` [PATCH v1 2/7] drm: move DRM_SWITCH_POWER defines to drm_device.h Sam Ravnborg
2018-12-27 12:12   ` Daniel Vetter [this message]
2018-12-27 22:17     ` Sam Ravnborg
2018-12-26 21:03 ` [PATCH v1 3/7] drm: move drm_can_sleep() to drm_util.h Sam Ravnborg
2018-12-27 12:14   ` Daniel Vetter
2018-12-26 21:03 ` [PATCH v1 4/7] drm: remove include of drmP.h from bridge/dw_hdmi.h Sam Ravnborg
2018-12-27 10:02   ` Laurent Pinchart
2018-12-26 21:03 ` [PATCH v1 5/7] drm: remove include of drmP.h from drm_encoder_slave.h Sam Ravnborg
2018-12-26 21:03 ` [PATCH v1 6/7] drm: remove include of drmP.h from drm_modeset_helper.h Sam Ravnborg
2018-12-27 10:04   ` Laurent Pinchart
2018-12-26 21:03 ` [PATCH v1 7/7] drm: remove include of drmP.h from drm_gem_cma_helper.h Sam Ravnborg
2018-12-27 16:28   ` David Lechner
2018-12-27 22:22     ` Sam Ravnborg

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=20181227121234.GE9058@dvetter-linux.ger.corp.intel.com \
    --to=daniel@ffwll.ch \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=maxime.ripard@bootlin.com \
    --cc=sam@ravnborg.org \
    --cc=sean@poorly.run \
    /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;
as well as URLs for NNTP newsgroup(s).