[20/42] drm/i915: remove use of crtc->config from intel_atomic.c and intel_sprite.c
diff mbox

Message ID 1431354318-11995-21-git-send-email-maarten.lankhorst@linux.intel.com
State New
Headers show

Commit Message

Maarten Lankhorst May 11, 2015, 2:24 p.m. UTC
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_atomic.c | 10 +++-------
 drivers/gpu/drm/i915/intel_sprite.c |  4 ++--
 2 files changed, 5 insertions(+), 9 deletions(-)

Comments

Daniel Vetter May 12, 2015, 9:03 a.m. UTC | #1
On Mon, May 11, 2015 at 04:24:56PM +0200, Maarten Lankhorst wrote:
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_atomic.c | 10 +++-------
>  drivers/gpu/drm/i915/intel_sprite.c |  4 ++--
>  2 files changed, 5 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_atomic.c b/drivers/gpu/drm/i915/intel_atomic.c
> index 7ed8033aae60..ace6aeeb1359 100644
> --- a/drivers/gpu/drm/i915/intel_atomic.c
> +++ b/drivers/gpu/drm/i915/intel_atomic.c
> @@ -176,7 +176,7 @@ int intel_atomic_commit(struct drm_device *dev,
>  			continue;
>  		}
>  
> -		to_intel_crtc(crtc)->config->scaler_state =
> +		to_intel_crtc_state(crtc->state)->scaler_state =
>  			to_intel_crtc_state(state->crtc_states[i])->scaler_state;
>  
>  		if (INTEL_INFO(dev)->gen >= 9)
> @@ -241,14 +241,10 @@ intel_connector_atomic_get_property(struct drm_connector *connector,
>  struct drm_crtc_state *
>  intel_crtc_duplicate_state(struct drm_crtc *crtc)
>  {
> -	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
>  	struct intel_crtc_state *crtc_state;
>  
> -	if (WARN_ON(!intel_crtc->config))
> -		crtc_state = kzalloc(sizeof(*crtc_state), GFP_KERNEL);
> -	else
> -		crtc_state = kmemdup(intel_crtc->config,
> -				     sizeof(*intel_crtc->config), GFP_KERNEL);
> +	crtc_state = kmemdup(crtc->state,
> +			     sizeof(*crtc_state), GFP_KERNEL);

Separate patch for this hunk please.
-Daniel

>  
>  	if (!crtc_state)
>  		return NULL;
> diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
> index 28291ab0993f..dfb6656ef544 100644
> --- a/drivers/gpu/drm/i915/intel_sprite.c
> +++ b/drivers/gpu/drm/i915/intel_sprite.c
> @@ -81,7 +81,7 @@ static int usecs_to_scanlines(const struct drm_display_mode *mode, int usecs)
>  bool intel_pipe_update_start(struct intel_crtc *crtc, uint32_t *start_vbl_count)
>  {
>  	struct drm_device *dev = crtc->base.dev;
> -	const struct drm_display_mode *mode = &crtc->config->base.adjusted_mode;
> +	const struct drm_display_mode *mode = &crtc->base.state->adjusted_mode;
>  	enum pipe pipe = crtc->pipe;
>  	long timeout = msecs_to_jiffies_timeout(1);
>  	int scanline, min, max, vblank_start;
> @@ -187,7 +187,7 @@ skl_update_plane(struct drm_plane *drm_plane, struct drm_crtc *crtc,
>  	u32 tile_height, plane_offset, plane_size;
>  	unsigned int rotation;
>  	int x_offset, y_offset;
> -	struct intel_crtc_state *crtc_state = to_intel_crtc(crtc)->config;
> +	struct intel_crtc_state *crtc_state = to_intel_crtc_state(crtc->state);
>  	int scaler_id;
>  
>  	plane_ctl = PLANE_CTL_ENABLE |
> -- 
> 2.1.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Maarten Lankhorst May 12, 2015, 1:36 p.m. UTC | #2
Op 12-05-15 om 11:03 schreef Daniel Vetter:
> On Mon, May 11, 2015 at 04:24:56PM +0200, Maarten Lankhorst wrote:
>> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
>> ---
>>  drivers/gpu/drm/i915/intel_atomic.c | 10 +++-------
>>  drivers/gpu/drm/i915/intel_sprite.c |  4 ++--
>>  2 files changed, 5 insertions(+), 9 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/intel_atomic.c b/drivers/gpu/drm/i915/intel_atomic.c
>> index 7ed8033aae60..ace6aeeb1359 100644
>> --- a/drivers/gpu/drm/i915/intel_atomic.c
>> +++ b/drivers/gpu/drm/i915/intel_atomic.c
>> @@ -176,7 +176,7 @@ int intel_atomic_commit(struct drm_device *dev,
>>  			continue;
>>  		}
>>  
>> -		to_intel_crtc(crtc)->config->scaler_state =
>> +		to_intel_crtc_state(crtc->state)->scaler_state =
>>  			to_intel_crtc_state(state->crtc_states[i])->scaler_state;
>>  
>>  		if (INTEL_INFO(dev)->gen >= 9)
>> @@ -241,14 +241,10 @@ intel_connector_atomic_get_property(struct drm_connector *connector,
>>  struct drm_crtc_state *
>>  intel_crtc_duplicate_state(struct drm_crtc *crtc)
>>  {
>> -	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
>>  	struct intel_crtc_state *crtc_state;
>>  
>> -	if (WARN_ON(!intel_crtc->config))
>> -		crtc_state = kzalloc(sizeof(*crtc_state), GFP_KERNEL);
>> -	else
>> -		crtc_state = kmemdup(intel_crtc->config,
>> -				     sizeof(*intel_crtc->config), GFP_KERNEL);
>> +	crtc_state = kmemdup(crtc->state,
>> +			     sizeof(*crtc_state), GFP_KERNEL);
> Separate patch for this hunk please.
> -Daniel
>
Ok.

~Maarten

Patch
diff mbox

diff --git a/drivers/gpu/drm/i915/intel_atomic.c b/drivers/gpu/drm/i915/intel_atomic.c
index 7ed8033aae60..ace6aeeb1359 100644
--- a/drivers/gpu/drm/i915/intel_atomic.c
+++ b/drivers/gpu/drm/i915/intel_atomic.c
@@ -176,7 +176,7 @@  int intel_atomic_commit(struct drm_device *dev,
 			continue;
 		}
 
-		to_intel_crtc(crtc)->config->scaler_state =
+		to_intel_crtc_state(crtc->state)->scaler_state =
 			to_intel_crtc_state(state->crtc_states[i])->scaler_state;
 
 		if (INTEL_INFO(dev)->gen >= 9)
@@ -241,14 +241,10 @@  intel_connector_atomic_get_property(struct drm_connector *connector,
 struct drm_crtc_state *
 intel_crtc_duplicate_state(struct drm_crtc *crtc)
 {
-	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
 	struct intel_crtc_state *crtc_state;
 
-	if (WARN_ON(!intel_crtc->config))
-		crtc_state = kzalloc(sizeof(*crtc_state), GFP_KERNEL);
-	else
-		crtc_state = kmemdup(intel_crtc->config,
-				     sizeof(*intel_crtc->config), GFP_KERNEL);
+	crtc_state = kmemdup(crtc->state,
+			     sizeof(*crtc_state), GFP_KERNEL);
 
 	if (!crtc_state)
 		return NULL;
diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
index 28291ab0993f..dfb6656ef544 100644
--- a/drivers/gpu/drm/i915/intel_sprite.c
+++ b/drivers/gpu/drm/i915/intel_sprite.c
@@ -81,7 +81,7 @@  static int usecs_to_scanlines(const struct drm_display_mode *mode, int usecs)
 bool intel_pipe_update_start(struct intel_crtc *crtc, uint32_t *start_vbl_count)
 {
 	struct drm_device *dev = crtc->base.dev;
-	const struct drm_display_mode *mode = &crtc->config->base.adjusted_mode;
+	const struct drm_display_mode *mode = &crtc->base.state->adjusted_mode;
 	enum pipe pipe = crtc->pipe;
 	long timeout = msecs_to_jiffies_timeout(1);
 	int scanline, min, max, vblank_start;
@@ -187,7 +187,7 @@  skl_update_plane(struct drm_plane *drm_plane, struct drm_crtc *crtc,
 	u32 tile_height, plane_offset, plane_size;
 	unsigned int rotation;
 	int x_offset, y_offset;
-	struct intel_crtc_state *crtc_state = to_intel_crtc(crtc)->config;
+	struct intel_crtc_state *crtc_state = to_intel_crtc_state(crtc->state);
 	int scaler_id;
 
 	plane_ctl = PLANE_CTL_ENABLE |