* [PATCH] drm/i915: Remove useless casts to intel_plane_state
@ 2017-01-12 9:43 Maarten Lankhorst
2017-01-12 9:54 ` Chris Wilson
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Maarten Lankhorst @ 2017-01-12 9:43 UTC (permalink / raw)
To: intel-gfx
The visible member used to be in intel_plane_state->visible,
but has been moved to drm_plane_state->visible. In the conversion
some casts were left in that are now useless.
to_intel_plane_state(x)->base.visible is the same as x->visible,
so use the latter to clear up the code a little.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
drivers/gpu/drm/i915/intel_display.c | 12 ++++++------
drivers/gpu/drm/i915/intel_fbc.c | 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 5364724df57f..82cd0e27ba1f 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -2796,7 +2796,7 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
* simplest solution is to just disable the primary plane now and
* pretend the BIOS never had it enabled.
*/
- to_intel_plane_state(plane_state)->base.visible = false;
+ plane_state->visible = false;
crtc_state->plane_mask &= ~(1 << drm_plane_index(primary));
intel_pre_disable_primary_noatomic(&intel_crtc->base);
intel_plane->disable_plane(primary, &intel_crtc->base);
@@ -6884,13 +6884,13 @@ static void intel_crtc_disable_noatomic(struct drm_crtc *crtc)
if (!intel_crtc->active)
return;
- if (to_intel_plane_state(crtc->primary->state)->base.visible) {
+ if (crtc->primary->state->visible) {
WARN_ON(intel_crtc->flip_work);
intel_pre_disable_primary_noatomic(crtc);
intel_crtc_disable_planes(crtc, 1 << drm_plane_index(crtc->primary));
- to_intel_plane_state(crtc->primary->state)->base.visible = false;
+ crtc->primary->state->visible = false;
}
state = drm_atomic_state_alloc(crtc->dev);
@@ -12464,7 +12464,7 @@ int intel_plane_atomic_calc_changes(struct drm_crtc_state *crtc_state,
}
was_visible = old_plane_state->base.visible;
- visible = to_intel_plane_state(plane_state)->base.visible;
+ visible = plane_state->visible;
if (!was_crtc_enabled && WARN_ON(was_visible))
was_visible = false;
@@ -12480,7 +12480,7 @@ int intel_plane_atomic_calc_changes(struct drm_crtc_state *crtc_state,
* only combine the results from all planes in the current place?
*/
if (!is_crtc_enabled)
- to_intel_plane_state(plane_state)->base.visible = visible = false;
+ plane_state->visible = visible = false;
if (!was_visible && !visible)
return 0;
@@ -16841,7 +16841,7 @@ static void intel_sanitize_crtc(struct intel_crtc *crtc)
* Temporarily change the plane mapping and disable everything
* ... */
plane = crtc->plane;
- to_intel_plane_state(crtc->base.primary->state)->base.visible = true;
+ crtc->base.primary->state->visible = true;
crtc->plane = !plane;
intel_crtc_disable_noatomic(&crtc->base);
crtc->plane = plane;
diff --git a/drivers/gpu/drm/i915/intel_fbc.c b/drivers/gpu/drm/i915/intel_fbc.c
index 26a81a9e9c1d..98cb85c88aff 100644
--- a/drivers/gpu/drm/i915/intel_fbc.c
+++ b/drivers/gpu/drm/i915/intel_fbc.c
@@ -1296,7 +1296,7 @@ void intel_fbc_init_pipe_state(struct drm_i915_private *dev_priv)
for_each_intel_crtc(&dev_priv->drm, crtc)
if (intel_crtc_active(crtc) &&
- to_intel_plane_state(crtc->base.primary->state)->base.visible)
+ crtc->base.primary->state->visible)
dev_priv->fbc.visible_pipes_mask |= (1 << crtc->pipe);
}
--
2.7.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] drm/i915: Remove useless casts to intel_plane_state
2017-01-12 9:43 [PATCH] drm/i915: Remove useless casts to intel_plane_state Maarten Lankhorst
@ 2017-01-12 9:54 ` Chris Wilson
2017-01-12 9:58 ` Ville Syrjälä
2017-01-12 12:53 ` ✓ Fi.CI.BAT: success for " Patchwork
2 siblings, 0 replies; 5+ messages in thread
From: Chris Wilson @ 2017-01-12 9:54 UTC (permalink / raw)
To: Maarten Lankhorst; +Cc: intel-gfx
On Thu, Jan 12, 2017 at 10:43:45AM +0100, Maarten Lankhorst wrote:
> The visible member used to be in intel_plane_state->visible,
> but has been moved to drm_plane_state->visible. In the conversion
> some casts were left in that are now useless.
>
> to_intel_plane_state(x)->base.visible is the same as x->visible,
> so use the latter to clear up the code a little.
>
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Matches the result of git grep "to_intel_plane_state(.*)->base\."
I didn't bother writing the spatch and just relied on reading the patch
instead.
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/i915: Remove useless casts to intel_plane_state
2017-01-12 9:43 [PATCH] drm/i915: Remove useless casts to intel_plane_state Maarten Lankhorst
2017-01-12 9:54 ` Chris Wilson
@ 2017-01-12 9:58 ` Ville Syrjälä
2017-01-12 14:52 ` Maarten Lankhorst
2017-01-12 12:53 ` ✓ Fi.CI.BAT: success for " Patchwork
2 siblings, 1 reply; 5+ messages in thread
From: Ville Syrjälä @ 2017-01-12 9:58 UTC (permalink / raw)
To: Maarten Lankhorst; +Cc: intel-gfx
On Thu, Jan 12, 2017 at 10:43:45AM +0100, Maarten Lankhorst wrote:
> The visible member used to be in intel_plane_state->visible,
> but has been moved to drm_plane_state->visible. In the conversion
> some casts were left in that are now useless.
>
> to_intel_plane_state(x)->base.visible is the same as x->visible,
> so use the latter to clear up the code a little.
I would generally prefer switching over to intel_foo_state all over.
But patch looks sane anyway
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
> drivers/gpu/drm/i915/intel_display.c | 12 ++++++------
> drivers/gpu/drm/i915/intel_fbc.c | 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 5364724df57f..82cd0e27ba1f 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -2796,7 +2796,7 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
> * simplest solution is to just disable the primary plane now and
> * pretend the BIOS never had it enabled.
> */
> - to_intel_plane_state(plane_state)->base.visible = false;
> + plane_state->visible = false;
> crtc_state->plane_mask &= ~(1 << drm_plane_index(primary));
> intel_pre_disable_primary_noatomic(&intel_crtc->base);
> intel_plane->disable_plane(primary, &intel_crtc->base);
> @@ -6884,13 +6884,13 @@ static void intel_crtc_disable_noatomic(struct drm_crtc *crtc)
> if (!intel_crtc->active)
> return;
>
> - if (to_intel_plane_state(crtc->primary->state)->base.visible) {
> + if (crtc->primary->state->visible) {
> WARN_ON(intel_crtc->flip_work);
>
> intel_pre_disable_primary_noatomic(crtc);
>
> intel_crtc_disable_planes(crtc, 1 << drm_plane_index(crtc->primary));
> - to_intel_plane_state(crtc->primary->state)->base.visible = false;
> + crtc->primary->state->visible = false;
> }
>
> state = drm_atomic_state_alloc(crtc->dev);
> @@ -12464,7 +12464,7 @@ int intel_plane_atomic_calc_changes(struct drm_crtc_state *crtc_state,
> }
>
> was_visible = old_plane_state->base.visible;
> - visible = to_intel_plane_state(plane_state)->base.visible;
> + visible = plane_state->visible;
>
> if (!was_crtc_enabled && WARN_ON(was_visible))
> was_visible = false;
> @@ -12480,7 +12480,7 @@ int intel_plane_atomic_calc_changes(struct drm_crtc_state *crtc_state,
> * only combine the results from all planes in the current place?
> */
> if (!is_crtc_enabled)
> - to_intel_plane_state(plane_state)->base.visible = visible = false;
> + plane_state->visible = visible = false;
>
> if (!was_visible && !visible)
> return 0;
> @@ -16841,7 +16841,7 @@ static void intel_sanitize_crtc(struct intel_crtc *crtc)
> * Temporarily change the plane mapping and disable everything
> * ... */
> plane = crtc->plane;
> - to_intel_plane_state(crtc->base.primary->state)->base.visible = true;
> + crtc->base.primary->state->visible = true;
> crtc->plane = !plane;
> intel_crtc_disable_noatomic(&crtc->base);
> crtc->plane = plane;
> diff --git a/drivers/gpu/drm/i915/intel_fbc.c b/drivers/gpu/drm/i915/intel_fbc.c
> index 26a81a9e9c1d..98cb85c88aff 100644
> --- a/drivers/gpu/drm/i915/intel_fbc.c
> +++ b/drivers/gpu/drm/i915/intel_fbc.c
> @@ -1296,7 +1296,7 @@ void intel_fbc_init_pipe_state(struct drm_i915_private *dev_priv)
>
> for_each_intel_crtc(&dev_priv->drm, crtc)
> if (intel_crtc_active(crtc) &&
> - to_intel_plane_state(crtc->base.primary->state)->base.visible)
> + crtc->base.primary->state->visible)
> dev_priv->fbc.visible_pipes_mask |= (1 << crtc->pipe);
> }
>
> --
> 2.7.4
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] drm/i915: Remove useless casts to intel_plane_state
2017-01-12 9:58 ` Ville Syrjälä
@ 2017-01-12 14:52 ` Maarten Lankhorst
0 siblings, 0 replies; 5+ messages in thread
From: Maarten Lankhorst @ 2017-01-12 14:52 UTC (permalink / raw)
To: Ville Syrjälä; +Cc: intel-gfx
Op 12-01-17 om 10:58 schreef Ville Syrjälä:
> On Thu, Jan 12, 2017 at 10:43:45AM +0100, Maarten Lankhorst wrote:
>> The visible member used to be in intel_plane_state->visible,
>> but has been moved to drm_plane_state->visible. In the conversion
>> some casts were left in that are now useless.
>>
>> to_intel_plane_state(x)->base.visible is the same as x->visible,
>> so use the latter to clear up the code a little.
> I would generally prefer switching over to intel_foo_state all over.
>
> But patch looks sane anyway
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Applied, thanks for reviewing. :)
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 5+ messages in thread
* ✓ Fi.CI.BAT: success for drm/i915: Remove useless casts to intel_plane_state
2017-01-12 9:43 [PATCH] drm/i915: Remove useless casts to intel_plane_state Maarten Lankhorst
2017-01-12 9:54 ` Chris Wilson
2017-01-12 9:58 ` Ville Syrjälä
@ 2017-01-12 12:53 ` Patchwork
2 siblings, 0 replies; 5+ messages in thread
From: Patchwork @ 2017-01-12 12:53 UTC (permalink / raw)
To: Maarten Lankhorst; +Cc: intel-gfx
== Series Details ==
Series: drm/i915: Remove useless casts to intel_plane_state
URL : https://patchwork.freedesktop.org/series/17894/
State : success
== Summary ==
Series 17894v1 drm/i915: Remove useless casts to intel_plane_state
https://patchwork.freedesktop.org/api/1.0/series/17894/revisions/1/mbox/
fi-bdw-5557u total:246 pass:232 dwarn:0 dfail:0 fail:0 skip:14
fi-bsw-n3050 total:246 pass:207 dwarn:0 dfail:0 fail:0 skip:39
fi-bxt-j4205 total:246 pass:224 dwarn:0 dfail:0 fail:0 skip:22
fi-bxt-t5700 total:82 pass:69 dwarn:0 dfail:0 fail:0 skip:12
fi-byt-j1900 total:246 pass:219 dwarn:0 dfail:0 fail:0 skip:27
fi-byt-n2820 total:246 pass:215 dwarn:0 dfail:0 fail:0 skip:31
fi-hsw-4770 total:246 pass:227 dwarn:0 dfail:0 fail:0 skip:19
fi-hsw-4770r total:246 pass:227 dwarn:0 dfail:0 fail:0 skip:19
fi-ivb-3520m total:246 pass:225 dwarn:0 dfail:0 fail:0 skip:21
fi-ivb-3770 total:246 pass:225 dwarn:0 dfail:0 fail:0 skip:21
fi-skl-6260u total:246 pass:233 dwarn:0 dfail:0 fail:0 skip:13
fi-skl-6700hq total:246 pass:226 dwarn:0 dfail:0 fail:0 skip:20
fi-skl-6700k total:246 pass:222 dwarn:3 dfail:0 fail:0 skip:21
fi-skl-6770hq total:246 pass:233 dwarn:0 dfail:0 fail:0 skip:13
fi-snb-2520m total:246 pass:215 dwarn:0 dfail:0 fail:0 skip:31
fi-snb-2600 total:246 pass:214 dwarn:0 dfail:0 fail:0 skip:32
43b23e65d1802ffaa1811a3ee958b0e9e0aba10e drm-tip: 2017y-01m-12d-10h-54m-07s UTC integration manifest
5d6bfb8 drm/i915: Remove useless casts to intel_plane_state
== Logs ==
For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_3497/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-01-12 14:52 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-12 9:43 [PATCH] drm/i915: Remove useless casts to intel_plane_state Maarten Lankhorst
2017-01-12 9:54 ` Chris Wilson
2017-01-12 9:58 ` Ville Syrjälä
2017-01-12 14:52 ` Maarten Lankhorst
2017-01-12 12:53 ` ✓ Fi.CI.BAT: success for " Patchwork
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox