* [PATCH 1/8] drm/i915: Change use get_new_plane_state instead of existing plane state
2017-07-20 13:15 [PATCH 0/8] drm/i915: Stop using get_existing_state Maarten Lankhorst
@ 2017-07-20 13:15 ` Maarten Lankhorst
2017-08-01 6:36 ` Mahesh Kumar
2017-07-20 13:15 ` [PATCH 2/8] drm/i915: Change get_existing_crtc_state to old state Maarten Lankhorst
` (7 subsequent siblings)
8 siblings, 1 reply; 18+ messages in thread
From: Maarten Lankhorst @ 2017-07-20 13:15 UTC (permalink / raw)
To: intel-gfx
The get_existing macros are deprecated and should be replaced by
get_old/new_state for clarity.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
drivers/gpu/drm/i915/intel_atomic.c | 4 ++--
drivers/gpu/drm/i915/intel_drv.h | 4 ++--
drivers/gpu/drm/i915/intel_pm.c | 5 ++---
3 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_atomic.c b/drivers/gpu/drm/i915/intel_atomic.c
index 36d4e635e4ce..5d9a26fa5f6d 100644
--- a/drivers/gpu/drm/i915/intel_atomic.c
+++ b/drivers/gpu/drm/i915/intel_atomic.c
@@ -301,8 +301,8 @@ int intel_atomic_setup_scalers(struct drm_i915_private *dev_priv,
continue;
}
- plane_state = intel_atomic_get_existing_plane_state(drm_state,
- intel_plane);
+ plane_state = intel_atomic_get_new_plane_state(drm_state,
+ intel_plane);
scaler_id = &plane_state->scaler_id;
}
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 4f9775a05df7..f59507137347 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -1958,12 +1958,12 @@ intel_atomic_get_existing_crtc_state(struct drm_atomic_state *state,
}
static inline struct intel_plane_state *
-intel_atomic_get_existing_plane_state(struct drm_atomic_state *state,
+intel_atomic_get_new_plane_state(struct drm_atomic_state *state,
struct intel_plane *plane)
{
struct drm_plane_state *plane_state;
- plane_state = drm_atomic_get_existing_plane_state(state, &plane->base);
+ plane_state = drm_atomic_get_new_plane_state(state, &plane->base);
return to_intel_plane_state(plane_state);
}
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 48785ef75d33..0cdb9453e0e2 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -3028,8 +3028,7 @@ static int ilk_compute_pipe_wm(struct intel_crtc_state *cstate)
for_each_intel_plane_on_crtc(dev, intel_crtc, intel_plane) {
struct intel_plane_state *ps;
- ps = intel_atomic_get_existing_plane_state(state,
- intel_plane);
+ ps = intel_atomic_get_new_plane_state(state, intel_plane);
if (!ps)
continue;
@@ -4766,7 +4765,7 @@ skl_ddb_add_affected_planes(struct intel_crtc_state *cstate)
struct drm_plane *plane;
enum pipe pipe = intel_crtc->pipe;
- WARN_ON(!drm_atomic_get_existing_crtc_state(state, crtc));
+ WARN_ON(!drm_atomic_get_new_crtc_state(state, crtc));
drm_for_each_plane_mask(plane, dev, cstate->base.plane_mask) {
enum plane_id plane_id = to_intel_plane(plane)->id;
--
2.11.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 18+ messages in thread* Re: [PATCH 1/8] drm/i915: Change use get_new_plane_state instead of existing plane state
2017-07-20 13:15 ` [PATCH 1/8] drm/i915: Change use get_new_plane_state instead of existing plane state Maarten Lankhorst
@ 2017-08-01 6:36 ` Mahesh Kumar
2017-08-01 7:55 ` Maarten Lankhorst
0 siblings, 1 reply; 18+ messages in thread
From: Mahesh Kumar @ 2017-08-01 6:36 UTC (permalink / raw)
To: Maarten Lankhorst, intel-gfx
Hi,
On Thursday 20 July 2017 06:45 PM, Maarten Lankhorst wrote:
> The get_existing macros are deprecated and should be replaced by
> get_old/new_state for clarity.
>
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
> drivers/gpu/drm/i915/intel_atomic.c | 4 ++--
> drivers/gpu/drm/i915/intel_drv.h | 4 ++--
> drivers/gpu/drm/i915/intel_pm.c | 5 ++---
> 3 files changed, 6 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_atomic.c b/drivers/gpu/drm/i915/intel_atomic.c
> index 36d4e635e4ce..5d9a26fa5f6d 100644
> --- a/drivers/gpu/drm/i915/intel_atomic.c
> +++ b/drivers/gpu/drm/i915/intel_atomic.c
> @@ -301,8 +301,8 @@ int intel_atomic_setup_scalers(struct drm_i915_private *dev_priv,
> continue;
> }
>
> - plane_state = intel_atomic_get_existing_plane_state(drm_state,
> - intel_plane);
> + plane_state = intel_atomic_get_new_plane_state(drm_state,
> + intel_plane);
> scaler_id = &plane_state->scaler_id;
> }
>
> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> index 4f9775a05df7..f59507137347 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -1958,12 +1958,12 @@ intel_atomic_get_existing_crtc_state(struct drm_atomic_state *state,
> }
>
> static inline struct intel_plane_state *
> -intel_atomic_get_existing_plane_state(struct drm_atomic_state *state,
> +intel_atomic_get_new_plane_state(struct drm_atomic_state *state,
> struct intel_plane *plane)
please fix indentation of arguments as well.
> {
> struct drm_plane_state *plane_state;
>
> - plane_state = drm_atomic_get_existing_plane_state(state, &plane->base);
> + plane_state = drm_atomic_get_new_plane_state(state, &plane->base);
>
> return to_intel_plane_state(plane_state);
> }
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index 48785ef75d33..0cdb9453e0e2 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -3028,8 +3028,7 @@ static int ilk_compute_pipe_wm(struct intel_crtc_state *cstate)
> for_each_intel_plane_on_crtc(dev, intel_crtc, intel_plane) {
> struct intel_plane_state *ps;
>
> - ps = intel_atomic_get_existing_plane_state(state,
> - intel_plane);
> + ps = intel_atomic_get_new_plane_state(state, intel_plane);
> if (!ps)
> continue;
>
> @@ -4766,7 +4765,7 @@ skl_ddb_add_affected_planes(struct intel_crtc_state *cstate)
> struct drm_plane *plane;
> enum pipe pipe = intel_crtc->pipe;
>
> - WARN_ON(!drm_atomic_get_existing_crtc_state(state, crtc));
> + WARN_ON(!drm_atomic_get_new_crtc_state(state, crtc));
Patch talks about changing get_existing_plane_state, but you are
changing get_existing_crtc_state here.
IMO it should be part of different patch or patch subject should be changed.
-Mahesh
>
> drm_for_each_plane_mask(plane, dev, cstate->base.plane_mask) {
> enum plane_id plane_id = to_intel_plane(plane)->id;
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 18+ messages in thread* Re: [PATCH 1/8] drm/i915: Change use get_new_plane_state instead of existing plane state
2017-08-01 6:36 ` Mahesh Kumar
@ 2017-08-01 7:55 ` Maarten Lankhorst
0 siblings, 0 replies; 18+ messages in thread
From: Maarten Lankhorst @ 2017-08-01 7:55 UTC (permalink / raw)
To: Mahesh Kumar, intel-gfx
Op 01-08-17 om 08:36 schreef Mahesh Kumar:
> Hi,
>
>
> On Thursday 20 July 2017 06:45 PM, Maarten Lankhorst wrote:
>> The get_existing macros are deprecated and should be replaced by
>> get_old/new_state for clarity.
>>
>> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
>> ---
>> drivers/gpu/drm/i915/intel_atomic.c | 4 ++--
>> drivers/gpu/drm/i915/intel_drv.h | 4 ++--
>> drivers/gpu/drm/i915/intel_pm.c | 5 ++---
>> 3 files changed, 6 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/intel_atomic.c b/drivers/gpu/drm/i915/intel_atomic.c
>> index 36d4e635e4ce..5d9a26fa5f6d 100644
>> --- a/drivers/gpu/drm/i915/intel_atomic.c
>> +++ b/drivers/gpu/drm/i915/intel_atomic.c
>> @@ -301,8 +301,8 @@ int intel_atomic_setup_scalers(struct drm_i915_private *dev_priv,
>> continue;
>> }
>> - plane_state = intel_atomic_get_existing_plane_state(drm_state,
>> - intel_plane);
>> + plane_state = intel_atomic_get_new_plane_state(drm_state,
>> + intel_plane);
>> scaler_id = &plane_state->scaler_id;
>> }
>> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
>> index 4f9775a05df7..f59507137347 100644
>> --- a/drivers/gpu/drm/i915/intel_drv.h
>> +++ b/drivers/gpu/drm/i915/intel_drv.h
>> @@ -1958,12 +1958,12 @@ intel_atomic_get_existing_crtc_state(struct drm_atomic_state *state,
>> }
>> static inline struct intel_plane_state *
>> -intel_atomic_get_existing_plane_state(struct drm_atomic_state *state,
>> +intel_atomic_get_new_plane_state(struct drm_atomic_state *state,
>> struct intel_plane *plane)
> please fix indentation of arguments as well.
>
>> {
>> struct drm_plane_state *plane_state;
>> - plane_state = drm_atomic_get_existing_plane_state(state, &plane->base);
>> + plane_state = drm_atomic_get_new_plane_state(state, &plane->base);
>> return to_intel_plane_state(plane_state);
>> }
>> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
>> index 48785ef75d33..0cdb9453e0e2 100644
>> --- a/drivers/gpu/drm/i915/intel_pm.c
>> +++ b/drivers/gpu/drm/i915/intel_pm.c
>> @@ -3028,8 +3028,7 @@ static int ilk_compute_pipe_wm(struct intel_crtc_state *cstate)
>> for_each_intel_plane_on_crtc(dev, intel_crtc, intel_plane) {
>> struct intel_plane_state *ps;
>> - ps = intel_atomic_get_existing_plane_state(state,
>> - intel_plane);
>> + ps = intel_atomic_get_new_plane_state(state, intel_plane);
>> if (!ps)
>> continue;
>> @@ -4766,7 +4765,7 @@ skl_ddb_add_affected_planes(struct intel_crtc_state *cstate)
>> struct drm_plane *plane;
>> enum pipe pipe = intel_crtc->pipe;
>> - WARN_ON(!drm_atomic_get_existing_crtc_state(state, crtc));
>> + WARN_ON(!drm_atomic_get_new_crtc_state(state, crtc));
> Patch talks about changing get_existing_plane_state, but you are changing get_existing_crtc_state here.
> IMO it should be part of different patch or patch subject should be changed.
Yeah ok, this hunk should be separate.
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 2/8] drm/i915: Change get_existing_crtc_state to old state
2017-07-20 13:15 [PATCH 0/8] drm/i915: Stop using get_existing_state Maarten Lankhorst
2017-07-20 13:15 ` [PATCH 1/8] drm/i915: Change use get_new_plane_state instead of existing plane state Maarten Lankhorst
@ 2017-07-20 13:15 ` Maarten Lankhorst
2017-08-01 6:46 ` Mahesh Kumar
2017-07-20 13:15 ` [PATCH 3/8] drm/i915: Use new atomic helpers in intel_plane_atomic_check Maarten Lankhorst
` (6 subsequent siblings)
8 siblings, 1 reply; 18+ messages in thread
From: Maarten Lankhorst @ 2017-07-20 13:15 UTC (permalink / raw)
To: intel-gfx
get_existing_crtc_state is currently unused, but the next commit
needs to access the old intel state. Rename this and use this
as convenience wrapper.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
drivers/gpu/drm/i915/intel_drv.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index f59507137347..3723ee443faa 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -1944,12 +1944,12 @@ intel_atomic_get_crtc_state(struct drm_atomic_state *state,
}
static inline struct intel_crtc_state *
-intel_atomic_get_existing_crtc_state(struct drm_atomic_state *state,
- struct intel_crtc *crtc)
+intel_atomic_get_old_crtc_state(struct drm_atomic_state *state,
+ struct intel_crtc *crtc)
{
struct drm_crtc_state *crtc_state;
- crtc_state = drm_atomic_get_existing_crtc_state(state, &crtc->base);
+ crtc_state = drm_atomic_get_old_crtc_state(state, &crtc->base);
if (crtc_state)
return to_intel_crtc_state(crtc_state);
--
2.11.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 18+ messages in thread* Re: [PATCH 2/8] drm/i915: Change get_existing_crtc_state to old state
2017-07-20 13:15 ` [PATCH 2/8] drm/i915: Change get_existing_crtc_state to old state Maarten Lankhorst
@ 2017-08-01 6:46 ` Mahesh Kumar
2017-08-01 7:53 ` Maarten Lankhorst
0 siblings, 1 reply; 18+ messages in thread
From: Mahesh Kumar @ 2017-08-01 6:46 UTC (permalink / raw)
To: Maarten Lankhorst, intel-gfx
Hi,
As per my understanding "get_existing_*_state == get_new_*_state"
It looks like you are trying to use currently available unused wrapper
for completely different purpose. But IMHO you should create a new
wrapper for get_old_state
& this should be renamed to get_new_state. :)
-Mahesh
On Thursday 20 July 2017 06:45 PM, Maarten Lankhorst wrote:
> get_existing_crtc_state is currently unused, but the next commit
> needs to access the old intel state. Rename this and use this
> as convenience wrapper.
>
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
> drivers/gpu/drm/i915/intel_drv.h | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> index f59507137347..3723ee443faa 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -1944,12 +1944,12 @@ intel_atomic_get_crtc_state(struct drm_atomic_state *state,
> }
>
> static inline struct intel_crtc_state *
> -intel_atomic_get_existing_crtc_state(struct drm_atomic_state *state,
> - struct intel_crtc *crtc)
> +intel_atomic_get_old_crtc_state(struct drm_atomic_state *state,
> + struct intel_crtc *crtc)
> {
> struct drm_crtc_state *crtc_state;
>
> - crtc_state = drm_atomic_get_existing_crtc_state(state, &crtc->base);
> + crtc_state = drm_atomic_get_old_crtc_state(state, &crtc->base);
>
> if (crtc_state)
> return to_intel_crtc_state(crtc_state);
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 18+ messages in thread* Re: [PATCH 2/8] drm/i915: Change get_existing_crtc_state to old state
2017-08-01 6:46 ` Mahesh Kumar
@ 2017-08-01 7:53 ` Maarten Lankhorst
2017-08-01 8:04 ` Mahesh Kumar
0 siblings, 1 reply; 18+ messages in thread
From: Maarten Lankhorst @ 2017-08-01 7:53 UTC (permalink / raw)
To: Mahesh Kumar, intel-gfx
Hey,
Op 01-08-17 om 08:46 schreef Mahesh Kumar:
> Hi,
>
> As per my understanding "get_existing_*_state == get_new_*_state"
>
> It looks like you are trying to use currently available unused wrapper for completely different purpose. But IMHO you should create a new wrapper for get_old_state
>
> & this should be renamed to get_new_state. :)
This really depends, and is the reason why we have to rename this.
Before commit:
get_existing_state == get_new_state
After commit:
get_existing_state == get_old_state.
Perhaps I can add both in this patch, I'll clean the series up slightly.
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 2/8] drm/i915: Change get_existing_crtc_state to old state
2017-08-01 7:53 ` Maarten Lankhorst
@ 2017-08-01 8:04 ` Mahesh Kumar
0 siblings, 0 replies; 18+ messages in thread
From: Mahesh Kumar @ 2017-08-01 8:04 UTC (permalink / raw)
To: Maarten Lankhorst, intel-gfx
On Tuesday 01 August 2017 01:23 PM, Maarten Lankhorst wrote:
> Hey,
>
> Op 01-08-17 om 08:46 schreef Mahesh Kumar:
>> Hi,
>>
>> As per my understanding "get_existing_*_state == get_new_*_state"
>>
>> It looks like you are trying to use currently available unused wrapper for completely different purpose. But IMHO you should create a new wrapper for get_old_state
>>
>> & this should be renamed to get_new_state. :)
> This really depends, and is the reason why we have to rename this.
>
> Before commit:
> get_existing_state == get_new_state
>
> After commit:
> get_existing_state == get_old_state.
yeah, right :)
>
> Perhaps I can add both in this patch, I'll clean the series up slightly.
sounds good
-Mahesh
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 3/8] drm/i915: Use new atomic helpers in intel_plane_atomic_check
2017-07-20 13:15 [PATCH 0/8] drm/i915: Stop using get_existing_state Maarten Lankhorst
2017-07-20 13:15 ` [PATCH 1/8] drm/i915: Change use get_new_plane_state instead of existing plane state Maarten Lankhorst
2017-07-20 13:15 ` [PATCH 2/8] drm/i915: Change get_existing_crtc_state to old state Maarten Lankhorst
@ 2017-07-20 13:15 ` Maarten Lankhorst
2017-08-01 7:57 ` Mahesh Kumar
2017-07-20 13:15 ` [PATCH 4/8] drm/i915: Use intel_atomic_get_new_crtc_state in intel_fbc.c Maarten Lankhorst
` (5 subsequent siblings)
8 siblings, 1 reply; 18+ messages in thread
From: Maarten Lankhorst @ 2017-07-20 13:15 UTC (permalink / raw)
To: intel-gfx
Remove the use of plane->state and drm_atomic_get_existing_state,
instead use the new helpers, and also add
intel_atomic_get_new_crtc_state as it's needed.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
drivers/gpu/drm/i915/intel_atomic_plane.c | 22 +++++++++++++---------
drivers/gpu/drm/i915/intel_drv.h | 14 ++++++++++++++
2 files changed, 27 insertions(+), 9 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_atomic_plane.c b/drivers/gpu/drm/i915/intel_atomic_plane.c
index ee76fab7bb6f..1081d0b63b6e 100644
--- a/drivers/gpu/drm/i915/intel_atomic_plane.c
+++ b/drivers/gpu/drm/i915/intel_atomic_plane.c
@@ -198,12 +198,17 @@ int intel_plane_atomic_check_with_state(struct intel_crtc_state *crtc_state,
}
static int intel_plane_atomic_check(struct drm_plane *plane,
- struct drm_plane_state *state)
+ struct drm_plane_state *new_plane_state)
{
- struct drm_crtc *crtc = state->crtc;
- struct drm_crtc_state *drm_crtc_state;
+ struct drm_atomic_state *state = new_plane_state->state;
+ struct intel_crtc *crtc;
+ struct intel_crtc_state *new_crtc_state;
+ struct drm_plane_state *old_plane_state;
+ struct intel_plane_state *new_intel_plane_state;
- crtc = crtc ? crtc : plane->state->crtc;
+ old_plane_state = drm_atomic_get_old_plane_state(state, plane);
+
+ crtc = to_intel_crtc(new_plane_state->crtc ?: old_plane_state->crtc);
/*
* Both crtc and plane->crtc could be NULL if we're updating a
@@ -214,12 +219,11 @@ static int intel_plane_atomic_check(struct drm_plane *plane,
if (!crtc)
return 0;
- drm_crtc_state = drm_atomic_get_existing_crtc_state(state->state, crtc);
- if (WARN_ON(!drm_crtc_state))
- return -EINVAL;
+ new_crtc_state = intel_atomic_get_new_crtc_state(state, crtc);
+ new_intel_plane_state = to_intel_plane_state(new_plane_state);
- return intel_plane_atomic_check_with_state(to_intel_crtc_state(drm_crtc_state),
- to_intel_plane_state(state));
+ return intel_plane_atomic_check_with_state(new_crtc_state,
+ new_intel_plane_state);
}
static void intel_plane_atomic_update(struct drm_plane *plane,
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 3723ee443faa..98851ed5ec2b 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -1957,6 +1957,20 @@ intel_atomic_get_old_crtc_state(struct drm_atomic_state *state,
return NULL;
}
+static inline struct intel_crtc_state *
+intel_atomic_get_new_crtc_state(struct drm_atomic_state *state,
+ struct intel_crtc *crtc)
+{
+ struct drm_crtc_state *crtc_state;
+
+ crtc_state = drm_atomic_get_new_crtc_state(state, &crtc->base);
+
+ if (crtc_state)
+ return to_intel_crtc_state(crtc_state);
+ else
+ return NULL;
+}
+
static inline struct intel_plane_state *
intel_atomic_get_new_plane_state(struct drm_atomic_state *state,
struct intel_plane *plane)
--
2.11.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 18+ messages in thread* Re: [PATCH 3/8] drm/i915: Use new atomic helpers in intel_plane_atomic_check
2017-07-20 13:15 ` [PATCH 3/8] drm/i915: Use new atomic helpers in intel_plane_atomic_check Maarten Lankhorst
@ 2017-08-01 7:57 ` Mahesh Kumar
0 siblings, 0 replies; 18+ messages in thread
From: Mahesh Kumar @ 2017-08-01 7:57 UTC (permalink / raw)
To: Maarten Lankhorst, intel-gfx
Hi,
On Thursday 20 July 2017 06:45 PM, Maarten Lankhorst wrote:
> Remove the use of plane->state and drm_atomic_get_existing_state,
> instead use the new helpers, and also add
> intel_atomic_get_new_crtc_state as it's needed.
>
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
> drivers/gpu/drm/i915/intel_atomic_plane.c | 22 +++++++++++++---------
> drivers/gpu/drm/i915/intel_drv.h | 14 ++++++++++++++
> 2 files changed, 27 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_atomic_plane.c b/drivers/gpu/drm/i915/intel_atomic_plane.c
> index ee76fab7bb6f..1081d0b63b6e 100644
> --- a/drivers/gpu/drm/i915/intel_atomic_plane.c
> +++ b/drivers/gpu/drm/i915/intel_atomic_plane.c
> @@ -198,12 +198,17 @@ int intel_plane_atomic_check_with_state(struct intel_crtc_state *crtc_state,
> }
>
> static int intel_plane_atomic_check(struct drm_plane *plane,
> - struct drm_plane_state *state)
> + struct drm_plane_state *new_plane_state)
> {
> - struct drm_crtc *crtc = state->crtc;
> - struct drm_crtc_state *drm_crtc_state;
> + struct drm_atomic_state *state = new_plane_state->state;
> + struct intel_crtc *crtc;
> + struct intel_crtc_state *new_crtc_state;
> + struct drm_plane_state *old_plane_state;
> + struct intel_plane_state *new_intel_plane_state;
>
> - crtc = crtc ? crtc : plane->state->crtc;
> + old_plane_state = drm_atomic_get_old_plane_state(state, plane);
> +
> + crtc = to_intel_crtc(new_plane_state->crtc ?: old_plane_state->crtc);
>
> /*
> * Both crtc and plane->crtc could be NULL if we're updating a
you may want to update comment as well for better understanding. :)
> @@ -214,12 +219,11 @@ static int intel_plane_atomic_check(struct drm_plane *plane,
> if (!crtc)
> return 0;
>
> - drm_crtc_state = drm_atomic_get_existing_crtc_state(state->state, crtc);
> - if (WARN_ON(!drm_crtc_state))
> - return -EINVAL;
> + new_crtc_state = intel_atomic_get_new_crtc_state(state, crtc);
> + new_intel_plane_state = to_intel_plane_state(new_plane_state);
>
> - return intel_plane_atomic_check_with_state(to_intel_crtc_state(drm_crtc_state),
> - to_intel_plane_state(state));
> + return intel_plane_atomic_check_with_state(new_crtc_state,
> + new_intel_plane_state);
> }
>
> static void intel_plane_atomic_update(struct drm_plane *plane,
> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> index 3723ee443faa..98851ed5ec2b 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -1957,6 +1957,20 @@ intel_atomic_get_old_crtc_state(struct drm_atomic_state *state,
> return NULL;
> }
>
> +static inline struct intel_crtc_state *
> +intel_atomic_get_new_crtc_state(struct drm_atomic_state *state,
> + struct intel_crtc *crtc)
> +{
> + struct drm_crtc_state *crtc_state;
> +
> + crtc_state = drm_atomic_get_new_crtc_state(state, &crtc->base);
> +
> + if (crtc_state)
> + return to_intel_crtc_state(crtc_state);
> + else
> + return NULL;
> +}
> +
With previous patch comment addressed, This wrapper will be already
available.
otherwise patch looks ok to me.
-Mahesh
> static inline struct intel_plane_state *
> intel_atomic_get_new_plane_state(struct drm_atomic_state *state,
> struct intel_plane *plane)
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 4/8] drm/i915: Use intel_atomic_get_new_crtc_state in intel_fbc.c
2017-07-20 13:15 [PATCH 0/8] drm/i915: Stop using get_existing_state Maarten Lankhorst
` (2 preceding siblings ...)
2017-07-20 13:15 ` [PATCH 3/8] drm/i915: Use new atomic helpers in intel_plane_atomic_check Maarten Lankhorst
@ 2017-07-20 13:15 ` Maarten Lankhorst
2017-08-01 8:00 ` Mahesh Kumar
2017-07-20 13:15 ` [PATCH 5/8] drm/i915: Remove last references to drm_atomic_get_existing* macros Maarten Lankhorst
` (4 subsequent siblings)
8 siblings, 1 reply; 18+ messages in thread
From: Maarten Lankhorst @ 2017-07-20 13:15 UTC (permalink / raw)
To: intel-gfx
The previous commit added intel_atomic_get_new_crtc_state,
convert intel_fbc.c to the new helper.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
drivers/gpu/drm/i915/intel_fbc.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_fbc.c b/drivers/gpu/drm/i915/intel_fbc.c
index 860b8c26d29b..81d156f04db9 100644
--- a/drivers/gpu/drm/i915/intel_fbc.c
+++ b/drivers/gpu/drm/i915/intel_fbc.c
@@ -1046,7 +1046,7 @@ void intel_fbc_choose_crtc(struct drm_i915_private *dev_priv,
/* Does this atomic commit involve the CRTC currently tied to FBC? */
if (fbc->crtc &&
- !drm_atomic_get_existing_crtc_state(state, &fbc->crtc->base))
+ !intel_atomic_get_new_crtc_state(state, fbc->crtc))
goto out;
if (!intel_fbc_can_enable(dev_priv))
@@ -1071,8 +1071,7 @@ void intel_fbc_choose_crtc(struct drm_i915_private *dev_priv,
if (fbc_on_plane_a_only(dev_priv) && crtc->plane != PLANE_A)
continue;
- intel_crtc_state = to_intel_crtc_state(
- drm_atomic_get_existing_crtc_state(state, &crtc->base));
+ intel_crtc_state = intel_atomic_get_new_crtc_state(state, crtc);
intel_crtc_state->enable_fbc = true;
crtc_chosen = true;
--
2.11.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 18+ messages in thread* Re: [PATCH 4/8] drm/i915: Use intel_atomic_get_new_crtc_state in intel_fbc.c
2017-07-20 13:15 ` [PATCH 4/8] drm/i915: Use intel_atomic_get_new_crtc_state in intel_fbc.c Maarten Lankhorst
@ 2017-08-01 8:00 ` Mahesh Kumar
0 siblings, 0 replies; 18+ messages in thread
From: Mahesh Kumar @ 2017-08-01 8:00 UTC (permalink / raw)
To: Maarten Lankhorst, intel-gfx
[-- Attachment #1.1: Type: text/plain, Size: 1440 bytes --]
Hi,
patch looks ok to me.
Reviewed-by: Mahesh Kumar <mahesh1.kumar@intel.com>
On Thursday 20 July 2017 06:45 PM, Maarten Lankhorst wrote:
> The previous commit added intel_atomic_get_new_crtc_state,
> convert intel_fbc.c to the new helper.
>
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
> drivers/gpu/drm/i915/intel_fbc.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_fbc.c b/drivers/gpu/drm/i915/intel_fbc.c
> index 860b8c26d29b..81d156f04db9 100644
> --- a/drivers/gpu/drm/i915/intel_fbc.c
> +++ b/drivers/gpu/drm/i915/intel_fbc.c
> @@ -1046,7 +1046,7 @@ void intel_fbc_choose_crtc(struct drm_i915_private *dev_priv,
>
> /* Does this atomic commit involve the CRTC currently tied to FBC? */
> if (fbc->crtc &&
> - !drm_atomic_get_existing_crtc_state(state, &fbc->crtc->base))
> + !intel_atomic_get_new_crtc_state(state, fbc->crtc))
> goto out;
>
> if (!intel_fbc_can_enable(dev_priv))
> @@ -1071,8 +1071,7 @@ void intel_fbc_choose_crtc(struct drm_i915_private *dev_priv,
> if (fbc_on_plane_a_only(dev_priv) && crtc->plane != PLANE_A)
> continue;
>
> - intel_crtc_state = to_intel_crtc_state(
> - drm_atomic_get_existing_crtc_state(state, &crtc->base));
> + intel_crtc_state = intel_atomic_get_new_crtc_state(state, crtc);
>
> intel_crtc_state->enable_fbc = true;
> crtc_chosen = true;
[-- Attachment #1.2: Type: text/html, Size: 1996 bytes --]
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 5/8] drm/i915: Remove last references to drm_atomic_get_existing* macros
2017-07-20 13:15 [PATCH 0/8] drm/i915: Stop using get_existing_state Maarten Lankhorst
` (3 preceding siblings ...)
2017-07-20 13:15 ` [PATCH 4/8] drm/i915: Use intel_atomic_get_new_crtc_state in intel_fbc.c Maarten Lankhorst
@ 2017-07-20 13:15 ` Maarten Lankhorst
2017-07-20 13:15 ` [PATCH 6/8] drm/i915: Do not update legacy state any more Maarten Lankhorst
` (3 subsequent siblings)
8 siblings, 0 replies; 18+ messages in thread
From: Maarten Lankhorst @ 2017-07-20 13:15 UTC (permalink / raw)
To: intel-gfx
All the references to get_existing_state can be converted to
get_new_state or get_old_state, which means that i915 is now
get_existing_state free.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
drivers/gpu/drm/i915/intel_display.c | 57 +++++++++++++++++-------------------
1 file changed, 27 insertions(+), 30 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 8bd8ed362e1a..d95b3ba1fe47 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -4956,27 +4956,25 @@ static void intel_post_plane_update(struct intel_crtc_state *old_crtc_state)
struct intel_crtc *crtc = to_intel_crtc(old_crtc_state->base.crtc);
struct drm_atomic_state *old_state = old_crtc_state->base.state;
struct intel_crtc_state *pipe_config =
- to_intel_crtc_state(crtc->base.state);
+ intel_atomic_get_new_crtc_state(old_state, crtc);
struct drm_plane *primary = crtc->base.primary;
- struct drm_plane_state *old_pri_state =
- drm_atomic_get_existing_plane_state(old_state, primary);
+ struct drm_plane_state *old_primary_state =
+ drm_atomic_get_old_plane_state(old_state, primary);
intel_frontbuffer_flip(to_i915(crtc->base.dev), pipe_config->fb_bits);
if (pipe_config->update_wm_post && pipe_config->base.active)
intel_update_watermarks(crtc);
- if (old_pri_state) {
- struct intel_plane_state *primary_state =
- to_intel_plane_state(primary->state);
- struct intel_plane_state *old_primary_state =
- to_intel_plane_state(old_pri_state);
+ if (old_primary_state) {
+ struct drm_plane_state *new_primary_state =
+ drm_atomic_get_new_plane_state(old_state, primary);
intel_fbc_post_update(crtc);
- if (primary_state->base.visible &&
+ if (new_primary_state->visible &&
(needs_modeset(&pipe_config->base) ||
- !old_primary_state->base.visible))
+ !old_primary_state->visible))
intel_post_enable_primary(&crtc->base);
}
}
@@ -4989,22 +4987,21 @@ static void intel_pre_plane_update(struct intel_crtc_state *old_crtc_state,
struct drm_i915_private *dev_priv = to_i915(dev);
struct drm_atomic_state *old_state = old_crtc_state->base.state;
struct drm_plane *primary = crtc->base.primary;
- struct drm_plane_state *old_pri_state =
- drm_atomic_get_existing_plane_state(old_state, primary);
+ struct drm_plane_state *old_primary_state =
+ drm_atomic_get_old_plane_state(old_state, primary);
bool modeset = needs_modeset(&pipe_config->base);
struct intel_atomic_state *old_intel_state =
to_intel_atomic_state(old_state);
- if (old_pri_state) {
- struct intel_plane_state *primary_state =
- to_intel_plane_state(primary->state);
- struct intel_plane_state *old_primary_state =
- to_intel_plane_state(old_pri_state);
+ if (old_primary_state) {
+ struct drm_plane_state *new_primary_state =
+ drm_atomic_get_new_plane_state(old_state, primary);
- intel_fbc_pre_update(crtc, pipe_config, primary_state);
+ intel_fbc_pre_update(crtc, pipe_config,
+ to_intel_plane_state(new_primary_state));
- if (old_primary_state->base.visible &&
- (modeset || !primary_state->base.visible))
+ if (old_primary_state->visible &&
+ (modeset || !new_primary_state->visible))
intel_pre_disable_primary(&crtc->base);
}
@@ -10822,7 +10819,7 @@ static bool check_digital_port_conflicts(struct drm_atomic_state *state)
struct drm_connector_state *connector_state;
struct intel_encoder *encoder;
- connector_state = drm_atomic_get_existing_connector_state(state, connector);
+ connector_state = drm_atomic_get_new_connector_state(state, connector);
if (!connector_state)
connector_state = connector->state;
@@ -11039,15 +11036,15 @@ intel_modeset_update_crtc_state(struct drm_atomic_state *state)
/* Double check state. */
for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) {
+ struct drm_plane_state *plane_state;
to_intel_crtc(crtc)->config = to_intel_crtc_state(new_crtc_state);
/*
* Update legacy state to satisfy fbc code. This can
* be removed when fbc uses the atomic state.
*/
- if (drm_atomic_get_existing_plane_state(state, crtc->primary)) {
- struct drm_plane_state *plane_state = crtc->primary->state;
-
+ plane_state = drm_atomic_get_new_plane_state(state, crtc->primary);
+ if (plane_state) {
crtc->primary->fb = plane_state->fb;
crtc->x = plane_state->src_x >> 16;
crtc->y = plane_state->src_y >> 16;
@@ -12250,6 +12247,9 @@ static void intel_update_crtc(struct drm_crtc *crtc,
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
struct intel_crtc_state *pipe_config = to_intel_crtc_state(new_crtc_state);
bool modeset = needs_modeset(new_crtc_state);
+ struct intel_plane_state *new_plane_state =
+ intel_atomic_get_new_plane_state(old_crtc_state->state,
+ to_intel_plane(crtc->primary));
if (modeset) {
update_scanline_offset(intel_crtc);
@@ -12259,11 +12259,8 @@ static void intel_update_crtc(struct drm_crtc *crtc,
pipe_config);
}
- if (drm_atomic_get_existing_plane_state(state, crtc->primary)) {
- intel_fbc_enable(
- intel_crtc, pipe_config,
- to_intel_plane_state(crtc->primary->state));
- }
+ if (new_plane_state)
+ intel_fbc_enable(intel_crtc, pipe_config, new_plane_state);
drm_atomic_helper_commit_planes_on_crtc(old_crtc_state);
@@ -12739,7 +12736,7 @@ intel_prepare_plane_fb(struct drm_plane *plane,
if (old_obj) {
struct drm_crtc_state *crtc_state =
- drm_atomic_get_existing_crtc_state(new_state->state,
+ drm_atomic_get_new_crtc_state(new_state->state,
plane->state->crtc);
/* Big Hammer, we also need to ensure that any pending
--
2.11.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 18+ messages in thread* [PATCH 6/8] drm/i915: Do not update legacy state any more
2017-07-20 13:15 [PATCH 0/8] drm/i915: Stop using get_existing_state Maarten Lankhorst
` (4 preceding siblings ...)
2017-07-20 13:15 ` [PATCH 5/8] drm/i915: Remove last references to drm_atomic_get_existing* macros Maarten Lankhorst
@ 2017-07-20 13:15 ` Maarten Lankhorst
2017-07-20 13:15 ` [RFC PATCH 7/8] drm/i915: Calculate ironlake intermediate watermarks correctly, v2 Maarten Lankhorst
` (2 subsequent siblings)
8 siblings, 0 replies; 18+ messages in thread
From: Maarten Lankhorst @ 2017-07-20 13:15 UTC (permalink / raw)
To: intel-gfx
FBC has been converted to atomic, so updating
some legacy variables is no longer needed.
drm_atomic_helper_update_legacy_modeset_state
does update crtc->x/y anyway, but we shouldn't need it.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
drivers/gpu/drm/i915/intel_display.c | 30 ++++--------------------------
1 file changed, 4 insertions(+), 26 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index d95b3ba1fe47..6e47ee8827ae 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -11027,31 +11027,6 @@ intel_modeset_pipe_config(struct drm_crtc *crtc,
return ret;
}
-static void
-intel_modeset_update_crtc_state(struct drm_atomic_state *state)
-{
- struct drm_crtc *crtc;
- struct drm_crtc_state *new_crtc_state;
- int i;
-
- /* Double check state. */
- for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) {
- struct drm_plane_state *plane_state;
- to_intel_crtc(crtc)->config = to_intel_crtc_state(new_crtc_state);
-
- /*
- * Update legacy state to satisfy fbc code. This can
- * be removed when fbc uses the atomic state.
- */
- plane_state = drm_atomic_get_new_plane_state(state, crtc->primary);
- if (plane_state) {
- crtc->primary->fb = plane_state->fb;
- crtc->x = plane_state->src_x >> 16;
- crtc->y = plane_state->src_y >> 16;
- }
- }
-}
-
static bool intel_fuzzy_clock_check(int clock1, int clock2)
{
int diff;
@@ -12438,7 +12413,10 @@ static void intel_atomic_commit_tail(struct drm_atomic_state *state)
/* Only after disabling all output pipelines that will be changed can we
* update the the output configuration. */
- intel_modeset_update_crtc_state(state);
+
+ /* Update legacy crtc->config pointer */
+ for_each_new_crtc_in_state(state, crtc, new_crtc_state, i)
+ to_intel_crtc(crtc)->config = to_intel_crtc_state(new_crtc_state);
if (intel_state->modeset) {
drm_atomic_helper_update_legacy_modeset_state(state->dev, state);
--
2.11.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 18+ messages in thread* [RFC PATCH 7/8] drm/i915: Calculate ironlake intermediate watermarks correctly, v2.
2017-07-20 13:15 [PATCH 0/8] drm/i915: Stop using get_existing_state Maarten Lankhorst
` (5 preceding siblings ...)
2017-07-20 13:15 ` [PATCH 6/8] drm/i915: Do not update legacy state any more Maarten Lankhorst
@ 2017-07-20 13:15 ` Maarten Lankhorst
2017-07-20 13:15 ` [RFC PATCH 8/8] drm/i915: Calculate vlv/chv intermediate watermarks correctly, v3 Maarten Lankhorst
2017-07-20 15:40 ` ✓ Fi.CI.BAT: success for drm/i915: Stop using get_existing_state Patchwork
8 siblings, 0 replies; 18+ messages in thread
From: Maarten Lankhorst @ 2017-07-20 13:15 UTC (permalink / raw)
To: intel-gfx
The watermarks it should calculate against are the old optimal watermarks.
The currently active crtc watermarks are pure fiction, and are invalid in
case of a nonblocking modeset, page flip enabling/disabling planes or any
other reason.
When the crtc is disabled or during a modeset the intermediate watermarks
don't need to be programmed separately, and could be directly assigned
to the optimal watermarks.
Changes since v1:
- Use intel_atomic_get_old_crtc_state. (ville)
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
drivers/gpu/drm/i915/intel_pm.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 0cdb9453e0e2..0048bf043337 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -3105,7 +3105,9 @@ static int ilk_compute_intermediate_wm(struct drm_device *dev,
struct intel_crtc_state *newstate)
{
struct intel_pipe_wm *a = &newstate->wm.ilk.intermediate;
- struct intel_pipe_wm *b = &intel_crtc->wm.active.ilk;
+ const struct intel_crtc_state *oldstate =
+ intel_atomic_get_old_crtc_state(newstate->base.state, intel_crtc);
+ const struct intel_pipe_wm *b = &oldstate->wm.ilk.optimal;
int level, max_level = ilk_wm_max_level(to_i915(dev));
/*
@@ -3114,6 +3116,9 @@ static int ilk_compute_intermediate_wm(struct drm_device *dev,
* and after the vblank.
*/
*a = newstate->wm.ilk.optimal;
+ if (!newstate->base.active || drm_atomic_crtc_needs_modeset(&newstate->base))
+ return 0;
+
a->pipe_enabled |= b->pipe_enabled;
a->sprites_enabled |= b->sprites_enabled;
a->sprites_scaled |= b->sprites_scaled;
--
2.11.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 18+ messages in thread* [RFC PATCH 8/8] drm/i915: Calculate vlv/chv intermediate watermarks correctly, v3.
2017-07-20 13:15 [PATCH 0/8] drm/i915: Stop using get_existing_state Maarten Lankhorst
` (6 preceding siblings ...)
2017-07-20 13:15 ` [RFC PATCH 7/8] drm/i915: Calculate ironlake intermediate watermarks correctly, v2 Maarten Lankhorst
@ 2017-07-20 13:15 ` Maarten Lankhorst
2017-07-20 16:26 ` Maarten Lankhorst
2017-07-20 15:40 ` ✓ Fi.CI.BAT: success for drm/i915: Stop using get_existing_state Patchwork
8 siblings, 1 reply; 18+ messages in thread
From: Maarten Lankhorst @ 2017-07-20 13:15 UTC (permalink / raw)
To: intel-gfx
The watermarks it should calculate against are the old optimal watermarks.
The currently active crtc watermarks are pure fiction, and are invalid in
case of a nonblocking modeset, page flip enabling/disabling planes or any
other reason.
When the crtc is disabled or during a modeset the intermediate watermarks
don't need to be programmed separately, and could be directly assigned
to the optimal watermarks.
CXSR must always be disabled in the intermediate case for modesets, else
we get a WARN for vblank wait timeout.
Also rename crtc_state to new_crtc_state, to distinguish it from the old state.
Changes since v1:
- Use intel_atomic_get_old_crtc_state. (ville)
Changes since v2:
- Always unset cxsr during modeset.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101597
---
drivers/gpu/drm/i915/intel_pm.c | 22 ++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 0048bf043337..96de4f8e3b2a 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -2004,16 +2004,25 @@ static void vlv_atomic_update_fifo(struct intel_atomic_state *state,
static int vlv_compute_intermediate_wm(struct drm_device *dev,
struct intel_crtc *crtc,
- struct intel_crtc_state *crtc_state)
+ struct intel_crtc_state *new_crtc_state)
{
- struct vlv_wm_state *intermediate = &crtc_state->wm.vlv.intermediate;
- const struct vlv_wm_state *optimal = &crtc_state->wm.vlv.optimal;
- const struct vlv_wm_state *active = &crtc->wm.active.vlv;
+ struct vlv_wm_state *intermediate = &new_crtc_state->wm.vlv.intermediate;
+ const struct vlv_wm_state *optimal = &new_crtc_state->wm.vlv.optimal;
+ const struct intel_crtc_state *old_crtc_state =
+ intel_atomic_get_old_crtc_state(new_crtc_state->base.state, crtc);
+ const struct vlv_wm_state *active = &old_crtc_state->wm.vlv.optimal;
int level;
+ if (!new_crtc_state->base.active || drm_atomic_crtc_needs_modeset(&new_crtc_state->base)) {
+ *intermediate = *optimal;
+
+ intermediate->cxsr = false;
+ goto out;
+ }
+
intermediate->num_levels = min(optimal->num_levels, active->num_levels);
intermediate->cxsr = optimal->cxsr && active->cxsr &&
- !crtc_state->disable_cxsr;
+ !new_crtc_state->disable_cxsr;
for (level = 0; level < intermediate->num_levels; level++) {
enum plane_id plane_id;
@@ -2032,12 +2041,13 @@ static int vlv_compute_intermediate_wm(struct drm_device *dev,
vlv_invalidate_wms(crtc, intermediate, level);
+out:
/*
* If our intermediate WM are identical to the final WM, then we can
* omit the post-vblank programming; only update if it's different.
*/
if (memcmp(intermediate, optimal, sizeof(*intermediate)) != 0)
- crtc_state->wm.need_postvbl_update = true;
+ new_crtc_state->wm.need_postvbl_update = true;
return 0;
}
--
2.11.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 18+ messages in thread* Re: [RFC PATCH 8/8] drm/i915: Calculate vlv/chv intermediate watermarks correctly, v3.
2017-07-20 13:15 ` [RFC PATCH 8/8] drm/i915: Calculate vlv/chv intermediate watermarks correctly, v3 Maarten Lankhorst
@ 2017-07-20 16:26 ` Maarten Lankhorst
0 siblings, 0 replies; 18+ messages in thread
From: Maarten Lankhorst @ 2017-07-20 16:26 UTC (permalink / raw)
To: Intel Graphics Development
Op 20-07-17 om 15:15 schreef Maarten Lankhorst:
> The watermarks it should calculate against are the old optimal watermarks.
> The currently active crtc watermarks are pure fiction, and are invalid in
> case of a nonblocking modeset, page flip enabling/disabling planes or any
> other reason.
>
> When the crtc is disabled or during a modeset the intermediate watermarks
> don't need to be programmed separately, and could be directly assigned
> to the optimal watermarks.
>
> CXSR must always be disabled in the intermediate case for modesets, else
> we get a WARN for vblank wait timeout.
>
> Also rename crtc_state to new_crtc_state, to distinguish it from the old state.
>
> Changes since v1:
> - Use intel_atomic_get_old_crtc_state. (ville)
> Changes since v2:
> - Always unset cxsr during modeset.
>
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101597
> ---
> drivers/gpu/drm/i915/intel_pm.c | 22 ++++++++++++++++------
> 1 file changed, 16 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index 0048bf043337..96de4f8e3b2a 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -2004,16 +2004,25 @@ static void vlv_atomic_update_fifo(struct intel_atomic_state *state,
>
> static int vlv_compute_intermediate_wm(struct drm_device *dev,
> struct intel_crtc *crtc,
> - struct intel_crtc_state *crtc_state)
> + struct intel_crtc_state *new_crtc_state)
> {
> - struct vlv_wm_state *intermediate = &crtc_state->wm.vlv.intermediate;
> - const struct vlv_wm_state *optimal = &crtc_state->wm.vlv.optimal;
> - const struct vlv_wm_state *active = &crtc->wm.active.vlv;
> + struct vlv_wm_state *intermediate = &new_crtc_state->wm.vlv.intermediate;
> + const struct vlv_wm_state *optimal = &new_crtc_state->wm.vlv.optimal;
> + const struct intel_crtc_state *old_crtc_state =
> + intel_atomic_get_old_crtc_state(new_crtc_state->base.state, crtc);
> + const struct vlv_wm_state *active = &old_crtc_state->wm.vlv.optimal;
> int level;
>
> + if (!new_crtc_state->base.active || drm_atomic_crtc_needs_modeset(&new_crtc_state->base)) {
> + *intermediate = *optimal;
> +
> + intermediate->cxsr = false;
> + goto out;
> + }
Derp, can't fix the above bug since it's PNV.. But still needs to be done here.
So I'll have to take out the bugzilla listed above..
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 18+ messages in thread
* ✓ Fi.CI.BAT: success for drm/i915: Stop using get_existing_state.
2017-07-20 13:15 [PATCH 0/8] drm/i915: Stop using get_existing_state Maarten Lankhorst
` (7 preceding siblings ...)
2017-07-20 13:15 ` [RFC PATCH 8/8] drm/i915: Calculate vlv/chv intermediate watermarks correctly, v3 Maarten Lankhorst
@ 2017-07-20 15:40 ` Patchwork
8 siblings, 0 replies; 18+ messages in thread
From: Patchwork @ 2017-07-20 15:40 UTC (permalink / raw)
To: Maarten Lankhorst; +Cc: intel-gfx
== Series Details ==
Series: drm/i915: Stop using get_existing_state.
URL : https://patchwork.freedesktop.org/series/27640/
State : success
== Summary ==
Series 27640v1 drm/i915: Stop using get_existing_state.
https://patchwork.freedesktop.org/api/1.0/series/27640/revisions/1/mbox/
Test kms_flip:
Subgroup basic-flip-vs-modeset:
pass -> SKIP (fi-skl-x1585l) fdo#101781
Test kms_pipe_crc_basic:
Subgroup hang-read-crc-pipe-b:
dmesg-warn -> PASS (fi-pnv-d510) fdo#101597
Subgroup suspend-read-crc-pipe-b:
dmesg-warn -> PASS (fi-byt-n2820) fdo#101705
fdo#101781 https://bugs.freedesktop.org/show_bug.cgi?id=101781
fdo#101597 https://bugs.freedesktop.org/show_bug.cgi?id=101597
fdo#101705 https://bugs.freedesktop.org/show_bug.cgi?id=101705
fi-bdw-5557u total:279 pass:268 dwarn:0 dfail:0 fail:0 skip:11 time:442s
fi-bdw-gvtdvm total:279 pass:265 dwarn:0 dfail:0 fail:0 skip:14 time:429s
fi-blb-e6850 total:279 pass:224 dwarn:1 dfail:0 fail:0 skip:54 time:361s
fi-bsw-n3050 total:279 pass:243 dwarn:0 dfail:0 fail:0 skip:36 time:539s
fi-bxt-j4205 total:279 pass:260 dwarn:0 dfail:0 fail:0 skip:19 time:514s
fi-byt-j1900 total:279 pass:255 dwarn:0 dfail:0 fail:0 skip:24 time:487s
fi-byt-n2820 total:279 pass:251 dwarn:0 dfail:0 fail:0 skip:28 time:487s
fi-glk-2a total:279 pass:260 dwarn:0 dfail:0 fail:0 skip:19 time:598s
fi-hsw-4770 total:279 pass:263 dwarn:0 dfail:0 fail:0 skip:16 time:440s
fi-hsw-4770r total:279 pass:263 dwarn:0 dfail:0 fail:0 skip:16 time:413s
fi-ilk-650 total:279 pass:229 dwarn:0 dfail:0 fail:0 skip:50 time:417s
fi-ivb-3520m total:279 pass:261 dwarn:0 dfail:0 fail:0 skip:18 time:496s
fi-ivb-3770 total:279 pass:261 dwarn:0 dfail:0 fail:0 skip:18 time:468s
fi-kbl-7500u total:279 pass:261 dwarn:0 dfail:0 fail:0 skip:18 time:463s
fi-kbl-7560u total:279 pass:269 dwarn:0 dfail:0 fail:0 skip:10 time:577s
fi-kbl-r total:279 pass:261 dwarn:0 dfail:0 fail:0 skip:18 time:583s
fi-pnv-d510 total:279 pass:222 dwarn:2 dfail:0 fail:0 skip:55 time:559s
fi-skl-6260u total:279 pass:269 dwarn:0 dfail:0 fail:0 skip:10 time:482s
fi-skl-6700hq total:279 pass:262 dwarn:0 dfail:0 fail:0 skip:17 time:588s
fi-skl-6700k total:279 pass:261 dwarn:0 dfail:0 fail:0 skip:18 time:472s
fi-skl-6770hq total:279 pass:269 dwarn:0 dfail:0 fail:0 skip:10 time:486s
fi-skl-gvtdvm total:279 pass:266 dwarn:0 dfail:0 fail:0 skip:13 time:435s
fi-skl-x1585l total:279 pass:268 dwarn:0 dfail:0 fail:0 skip:11 time:466s
fi-snb-2520m total:279 pass:251 dwarn:0 dfail:0 fail:0 skip:28 time:543s
fi-snb-2600 total:279 pass:250 dwarn:0 dfail:0 fail:0 skip:29 time:408s
05cf23d5c759917f3b50aea0dcb0df1464366b93 drm-tip: 2017y-07m-20d-14h-24m-27s UTC integration manifest
c18c405 drm/i915: Calculate vlv/chv intermediate watermarks correctly, v3.
99976be drm/i915: Calculate ironlake intermediate watermarks correctly, v2.
8e20c12 drm/i915: Do not update legacy state any more
5cecb757 drm/i915: Remove last references to drm_atomic_get_existing* macros
23f118a drm/i915: Use intel_atomic_get_new_crtc_state in intel_fbc.c
0fe7279 drm/i915: Use new atomic helpers in intel_plane_atomic_check
350aeadd drm/i915: Change get_existing_crtc_state to old state
1633215 drm/i915: Change use get_new_plane_state instead of existing plane state
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_5252/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 18+ messages in thread