diff mbox

[2/2] drm/i915: Constify load detect mode

Message ID 20170518193837.393-2-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ville Syrjälä May 18, 2017, 7:38 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Make the mode used for load detection const, and adjust all relevant
functions to accept a const mode.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 12 ++++++------
 drivers/gpu/drm/i915/intel_drv.h     |  2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)

Comments

Daniel Vetter May 22, 2017, 7:42 a.m. UTC | #1
On Thu, May 18, 2017 at 10:38:37PM +0300, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Make the mode used for load detection const, and adjust all relevant
> functions to accept a const mode.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

> ---
>  drivers/gpu/drm/i915/intel_display.c | 12 ++++++------
>  drivers/gpu/drm/i915/intel_drv.h     |  2 +-
>  2 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 8217ed0e7132..6c08a7d6a0de 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -9538,7 +9538,7 @@ static void i9xx_disable_cursor(struct intel_plane *plane,
>  
>  
>  /* VESA 640x480x72Hz mode to set on the pipe */
> -static struct drm_display_mode load_detect_mode = {
> +static const struct drm_display_mode load_detect_mode = {
>  	DRM_MODE("640x480", DRM_MODE_TYPE_DEFAULT, 31500, 640, 664,
>  		 704, 832, 0, 480, 489, 491, 520, 0, DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC),
>  };
> @@ -9573,7 +9573,7 @@ intel_framebuffer_pitch_for_width(int width, int bpp)
>  }
>  
>  static u32
> -intel_framebuffer_size_for_mode(struct drm_display_mode *mode, int bpp)
> +intel_framebuffer_size_for_mode(const struct drm_display_mode *mode, int bpp)
>  {
>  	u32 pitch = intel_framebuffer_pitch_for_width(mode->hdisplay, bpp);
>  	return PAGE_ALIGN(pitch * mode->vdisplay);
> @@ -9581,7 +9581,7 @@ intel_framebuffer_size_for_mode(struct drm_display_mode *mode, int bpp)
>  
>  static struct drm_framebuffer *
>  intel_framebuffer_create_for_mode(struct drm_device *dev,
> -				  struct drm_display_mode *mode,
> +				  const struct drm_display_mode *mode,
>  				  int depth, int bpp)
>  {
>  	struct drm_framebuffer *fb;
> @@ -9608,7 +9608,7 @@ intel_framebuffer_create_for_mode(struct drm_device *dev,
>  
>  static struct drm_framebuffer *
>  mode_fits_in_fbdev(struct drm_device *dev,
> -		   struct drm_display_mode *mode)
> +		   const struct drm_display_mode *mode)
>  {
>  #ifdef CONFIG_DRM_FBDEV_EMULATION
>  	struct drm_i915_private *dev_priv = to_i915(dev);
> @@ -9641,7 +9641,7 @@ mode_fits_in_fbdev(struct drm_device *dev,
>  
>  static int intel_modeset_setup_plane_state(struct drm_atomic_state *state,
>  					   struct drm_crtc *crtc,
> -					   struct drm_display_mode *mode,
> +					   const struct drm_display_mode *mode,
>  					   struct drm_framebuffer *fb,
>  					   int x, int y)
>  {
> @@ -9675,7 +9675,7 @@ static int intel_modeset_setup_plane_state(struct drm_atomic_state *state,
>  }
>  
>  int intel_get_load_detect_pipe(struct drm_connector *connector,
> -			       struct drm_display_mode *mode,
> +			       const struct drm_display_mode *mode,
>  			       struct intel_load_detect_pipe *old,
>  			       struct drm_modeset_acquire_ctx *ctx)
>  {
> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> index bd500977b3fc..d2aa92fa7ec4 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -1398,7 +1398,7 @@ void vlv_wait_port_ready(struct drm_i915_private *dev_priv,
>  			 struct intel_digital_port *dport,
>  			 unsigned int expected_mask);
>  int intel_get_load_detect_pipe(struct drm_connector *connector,
> -			       struct drm_display_mode *mode,
> +			       const struct drm_display_mode *mode,
>  			       struct intel_load_detect_pipe *old,
>  			       struct drm_modeset_acquire_ctx *ctx);
>  void intel_release_load_detect_pipe(struct drm_connector *connector,
> -- 
> 2.10.2
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Ville Syrjälä Sept. 5, 2017, 6:25 p.m. UTC | #2
On Mon, May 22, 2017 at 09:42:01AM +0200, Daniel Vetter wrote:
> On Thu, May 18, 2017 at 10:38:37PM +0300, ville.syrjala@linux.intel.com wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > Make the mode used for load detection const, and adjust all relevant
> > functions to accept a const mode.
> > 
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Thanks. Pushed to dinq.
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 8217ed0e7132..6c08a7d6a0de 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -9538,7 +9538,7 @@  static void i9xx_disable_cursor(struct intel_plane *plane,
 
 
 /* VESA 640x480x72Hz mode to set on the pipe */
-static struct drm_display_mode load_detect_mode = {
+static const struct drm_display_mode load_detect_mode = {
 	DRM_MODE("640x480", DRM_MODE_TYPE_DEFAULT, 31500, 640, 664,
 		 704, 832, 0, 480, 489, 491, 520, 0, DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC),
 };
@@ -9573,7 +9573,7 @@  intel_framebuffer_pitch_for_width(int width, int bpp)
 }
 
 static u32
-intel_framebuffer_size_for_mode(struct drm_display_mode *mode, int bpp)
+intel_framebuffer_size_for_mode(const struct drm_display_mode *mode, int bpp)
 {
 	u32 pitch = intel_framebuffer_pitch_for_width(mode->hdisplay, bpp);
 	return PAGE_ALIGN(pitch * mode->vdisplay);
@@ -9581,7 +9581,7 @@  intel_framebuffer_size_for_mode(struct drm_display_mode *mode, int bpp)
 
 static struct drm_framebuffer *
 intel_framebuffer_create_for_mode(struct drm_device *dev,
-				  struct drm_display_mode *mode,
+				  const struct drm_display_mode *mode,
 				  int depth, int bpp)
 {
 	struct drm_framebuffer *fb;
@@ -9608,7 +9608,7 @@  intel_framebuffer_create_for_mode(struct drm_device *dev,
 
 static struct drm_framebuffer *
 mode_fits_in_fbdev(struct drm_device *dev,
-		   struct drm_display_mode *mode)
+		   const struct drm_display_mode *mode)
 {
 #ifdef CONFIG_DRM_FBDEV_EMULATION
 	struct drm_i915_private *dev_priv = to_i915(dev);
@@ -9641,7 +9641,7 @@  mode_fits_in_fbdev(struct drm_device *dev,
 
 static int intel_modeset_setup_plane_state(struct drm_atomic_state *state,
 					   struct drm_crtc *crtc,
-					   struct drm_display_mode *mode,
+					   const struct drm_display_mode *mode,
 					   struct drm_framebuffer *fb,
 					   int x, int y)
 {
@@ -9675,7 +9675,7 @@  static int intel_modeset_setup_plane_state(struct drm_atomic_state *state,
 }
 
 int intel_get_load_detect_pipe(struct drm_connector *connector,
-			       struct drm_display_mode *mode,
+			       const struct drm_display_mode *mode,
 			       struct intel_load_detect_pipe *old,
 			       struct drm_modeset_acquire_ctx *ctx)
 {
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index bd500977b3fc..d2aa92fa7ec4 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -1398,7 +1398,7 @@  void vlv_wait_port_ready(struct drm_i915_private *dev_priv,
 			 struct intel_digital_port *dport,
 			 unsigned int expected_mask);
 int intel_get_load_detect_pipe(struct drm_connector *connector,
-			       struct drm_display_mode *mode,
+			       const struct drm_display_mode *mode,
 			       struct intel_load_detect_pipe *old,
 			       struct drm_modeset_acquire_ctx *ctx);
 void intel_release_load_detect_pipe(struct drm_connector *connector,