All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel.vetter@ffwll.ch>
To: DRI Development <dri-devel@lists.freedesktop.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
	Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
	Daniel Vetter <daniel.vetter@intel.com>
Subject: [PATCH 14/15] drm: s/drm_crtc_get_hv_timings/drm_mode_get_hv_timings/
Date: Wed, 25 Jan 2017 07:26:56 +0100	[thread overview]
Message-ID: <20170125062657.19270-15-daniel.vetter@ffwll.ch> (raw)
In-Reply-To: <20170125062657.19270-1-daniel.vetter@ffwll.ch>

The function operates on modes, not CRTCs. Also move it into
drm_modes.[hc]. Spotted while reviewing CRTC docs.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/drm_atomic_helper.c  |  2 +-
 drivers/gpu/drm/drm_crtc.c           | 23 +----------------------
 drivers/gpu/drm/drm_modes.c          | 21 +++++++++++++++++++++
 drivers/gpu/drm/i915/intel_display.c |  4 ++--
 include/drm/drm_crtc.h               |  2 --
 include/drm/drm_modes.h              |  2 ++
 6 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index 5e512dd3a2c4..9633d12c4ed1 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -2369,7 +2369,7 @@ int __drm_atomic_helper_set_config(struct drm_mode_set *set,
 	if (ret != 0)
 		return ret;
 
-	drm_crtc_get_hv_timing(set->mode, &hdisplay, &vdisplay);
+	drm_mode_get_hv_timing(set->mode, &hdisplay, &vdisplay);
 
 	drm_atomic_set_fb_for_plane(primary_state, set->fb);
 	primary_state->crtc_x = 0;
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index cea7a7efa43c..5f28e3a5a3e0 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -461,27 +461,6 @@ int drm_mode_set_config_internal(struct drm_mode_set *set)
 EXPORT_SYMBOL(drm_mode_set_config_internal);
 
 /**
- * drm_crtc_get_hv_timing - Fetches hdisplay/vdisplay for given mode
- * @mode: mode to query
- * @hdisplay: hdisplay value to fill in
- * @vdisplay: vdisplay value to fill in
- *
- * The vdisplay value will be doubled if the specified mode is a stereo mode of
- * the appropriate layout.
- */
-void drm_crtc_get_hv_timing(const struct drm_display_mode *mode,
-			    int *hdisplay, int *vdisplay)
-{
-	struct drm_display_mode adjusted;
-
-	drm_mode_copy(&adjusted, mode);
-	drm_mode_set_crtcinfo(&adjusted, CRTC_STEREO_DOUBLE_ONLY);
-	*hdisplay = adjusted.crtc_hdisplay;
-	*vdisplay = adjusted.crtc_vdisplay;
-}
-EXPORT_SYMBOL(drm_crtc_get_hv_timing);
-
-/**
  * drm_crtc_check_viewport - Checks that a framebuffer is big enough for the
  *     CRTC viewport
  * @crtc: CRTC that framebuffer will be displayed on
@@ -498,7 +477,7 @@ int drm_crtc_check_viewport(const struct drm_crtc *crtc,
 {
 	int hdisplay, vdisplay;
 
-	drm_crtc_get_hv_timing(mode, &hdisplay, &vdisplay);
+	drm_mode_get_hv_timing(mode, &hdisplay, &vdisplay);
 
 	if (crtc->state &&
 	    drm_rotation_90_or_270(crtc->primary->state->rotation))
diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
index e6b19bc9021a..73ed6399c3fb 100644
--- a/drivers/gpu/drm/drm_modes.c
+++ b/drivers/gpu/drm/drm_modes.c
@@ -797,6 +797,27 @@ int drm_mode_vrefresh(const struct drm_display_mode *mode)
 EXPORT_SYMBOL(drm_mode_vrefresh);
 
 /**
+ * drm_mode_get_hv_timing - Fetches hdisplay/vdisplay for given mode
+ * @mode: mode to query
+ * @hdisplay: hdisplay value to fill in
+ * @vdisplay: vdisplay value to fill in
+ *
+ * The vdisplay value will be doubled if the specified mode is a stereo mode of
+ * the appropriate layout.
+ */
+void drm_mode_get_hv_timing(const struct drm_display_mode *mode,
+			    int *hdisplay, int *vdisplay)
+{
+	struct drm_display_mode adjusted;
+
+	drm_mode_copy(&adjusted, mode);
+	drm_mode_set_crtcinfo(&adjusted, CRTC_STEREO_DOUBLE_ONLY);
+	*hdisplay = adjusted.crtc_hdisplay;
+	*vdisplay = adjusted.crtc_vdisplay;
+}
+EXPORT_SYMBOL(drm_mode_get_hv_timing);
+
+/**
  * drm_mode_set_crtcinfo - set CRTC modesetting timing parameters
  * @p: mode
  * @adjust_flags: a combination of adjustment flags
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 7af8ddcaa075..50096f9bc420 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -11099,7 +11099,7 @@ static int intel_modeset_setup_plane_state(struct drm_atomic_state *state,
 		return PTR_ERR(plane_state);
 
 	if (mode)
-		drm_crtc_get_hv_timing(mode, &hdisplay, &vdisplay);
+		drm_mode_get_hv_timing(mode, &hdisplay, &vdisplay);
 	else
 		hdisplay = vdisplay = 0;
 
@@ -12992,7 +12992,7 @@ intel_modeset_pipe_config(struct drm_crtc *crtc,
 	 * computation to clearly distinguish it from the adjusted mode, which
 	 * can be changed by the connectors in the below retry loop.
 	 */
-	drm_crtc_get_hv_timing(&pipe_config->base.mode,
+	drm_mode_get_hv_timing(&pipe_config->base.mode,
 			       &pipe_config->pipe_src_w,
 			       &pipe_config->pipe_src_h);
 
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index bef18a1fa36e..816edab054e6 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -826,8 +826,6 @@ static inline uint32_t drm_crtc_mask(const struct drm_crtc *crtc)
 	return 1 << drm_crtc_index(crtc);
 }
 
-void drm_crtc_get_hv_timing(const struct drm_display_mode *mode,
-			    int *hdisplay, int *vdisplay);
 int drm_crtc_force_disable(struct drm_crtc *crtc);
 int drm_crtc_force_disable_all(struct drm_device *dev);
 
diff --git a/include/drm/drm_modes.h b/include/drm/drm_modes.h
index 9934d91619c1..6dd34280e892 100644
--- a/include/drm/drm_modes.h
+++ b/include/drm/drm_modes.h
@@ -459,6 +459,8 @@ int of_get_drm_display_mode(struct device_node *np,
 void drm_mode_set_name(struct drm_display_mode *mode);
 int drm_mode_hsync(const struct drm_display_mode *mode);
 int drm_mode_vrefresh(const struct drm_display_mode *mode);
+void drm_mode_get_hv_timing(const struct drm_display_mode *mode,
+			    int *hdisplay, int *vdisplay);
 
 void drm_mode_set_crtcinfo(struct drm_display_mode *p,
 			   int adjust_flags);
-- 
2.11.0

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

  parent reply	other threads:[~2017-01-25  6:27 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-25  6:26 [PATCH 00/15] More kerneldoc cleanup Daniel Vetter
2017-01-25  6:26 ` [PATCH 01/15] drm/kms-helpers: Use recommened kerneldoc for struct member refs Daniel Vetter
2017-01-25 12:48   ` [Intel-gfx] " Gustavo Padovan
2017-01-25 15:19     ` Daniel Vetter
2017-01-25  6:26 ` [PATCH 02/15] drm/bridge: " Daniel Vetter
2017-01-25  9:33   ` Archit Taneja
2017-01-25 12:40     ` Daniel Vetter
2017-01-25  6:26 ` [PATCH 03/15] drm/kms-core: " Daniel Vetter
2017-01-25 13:52   ` Eric Engestrom
2017-01-25  6:26 ` [PATCH 04/15] drm/gem|prime|mm: " Daniel Vetter
2017-01-25 12:51   ` Gustavo Padovan
2017-01-25  6:26 ` [PATCH 05/15] drm/core: " Daniel Vetter
2017-01-25 12:55   ` Gustavo Padovan
2017-01-25 15:23     ` Daniel Vetter
2017-01-25  6:26 ` [PATCH 06/15] drm/doc: Clarify connector overview Daniel Vetter
2017-01-25 12:57   ` [Intel-gfx] " Gustavo Padovan
2017-01-25 15:33     ` Daniel Vetter
2017-01-25 18:08       ` Gustavo Padovan
2017-01-25  6:26 ` [PATCH 07/15] drm/gma500: Nuke device_is_agp callback Daniel Vetter
2017-01-25 12:58   ` Gustavo Padovan
2017-01-26  0:11   ` Patrik Jakobsson
2017-01-25  6:26 ` [PATCH 08/15] drm/i810: drop " Daniel Vetter
2017-01-25 17:36   ` Alex Deucher
2017-01-25  6:26 ` [PATCH 09/15] drm/mga: remove " Daniel Vetter
2017-01-25 17:33   ` Alex Deucher
2017-01-25  6:26 ` [PATCH 10/15] drm: " Daniel Vetter
2017-01-25 17:34   ` Alex Deucher
2017-01-25  6:26 ` [PATCH 11/15] drm: Nuke ums vgaarb support Daniel Vetter
2017-01-25 17:40   ` Alex Deucher
2017-01-25  6:26 ` [PATCH 12/15] drm/moc: Mark legacy fields in drm_driver as such Daniel Vetter
2017-01-25 17:43   ` Alex Deucher
2017-01-25  6:26 ` [PATCH 13/15] drm/doc: Fix typos for early_unregister doc Daniel Vetter
2017-01-26  9:49   ` Daniel Vetter
2017-01-25  6:26 ` Daniel Vetter [this message]
2017-01-25 17:31   ` [PATCH 14/15] drm: s/drm_crtc_get_hv_timings/drm_mode_get_hv_timings/ Alex Deucher
2017-01-26  9:48     ` Daniel Vetter
2017-01-25  6:26 ` [PATCH 15/15] drm: Update kerneldoc for drm_crtc.[hc] Daniel Vetter
2017-01-25 14:26   ` Eric Engestrom
2017-01-25 15:36     ` Daniel Vetter
2017-01-25  7:54 ` ✗ Fi.CI.BAT: warning for More kerneldoc cleanup Patchwork

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=20170125062657.19270-15-daniel.vetter@ffwll.ch \
    --to=daniel.vetter@ffwll.ch \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.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.