From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [CI 11/12] drm/i915: Complete plane hw and uapi split, v2.
Date: Wed, 30 Oct 2019 19:04:49 +0200 [thread overview]
Message-ID: <20191030170449.GS1208@intel.com> (raw)
In-Reply-To: <20191030142657.22405-11-maarten.lankhorst@linux.intel.com>
On Wed, Oct 30, 2019 at 03:26:56PM +0100, Maarten Lankhorst wrote:
> Splitting plane state is easier than splitting crtc_state,
> before plane check we copy the drm properties to hw so we can
> do the same in bigjoiner later on.
>
> We copy the state after we did all the modeset handling, but fortunately
> i915 seems to be split correctly and nothing during modeset looks
> at plane_state.
>
> Changes since v1:
> - Do not clear hw state on duplication.
>
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
lgtm, apart from the slightly wasteful types, but we can fix those
later when fixing the core struct too.
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> .../gpu/drm/i915/display/intel_atomic_plane.c | 37 ++++++++++++++++++-
> .../gpu/drm/i915/display/intel_atomic_plane.h | 2 +
> drivers/gpu/drm/i915/display/intel_display.c | 1 +
> .../drm/i915/display/intel_display_types.h | 23 +++++++++---
> 4 files changed, 57 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c b/drivers/gpu/drm/i915/display/intel_atomic_plane.c
> index 18023422a34d..249fb41d78a5 100644
> --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c
> +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c
> @@ -93,6 +93,10 @@ intel_plane_duplicate_state(struct drm_plane *plane)
> intel_state->vma = NULL;
> intel_state->flags = 0;
>
> + /* add reference to fb */
> + if (intel_state->hw.fb)
> + drm_framebuffer_get(intel_state->hw.fb);
> +
> return &intel_state->uapi;
> }
>
> @@ -112,6 +116,8 @@ intel_plane_destroy_state(struct drm_plane *plane,
> WARN_ON(plane_state->vma);
>
> __drm_atomic_helper_plane_destroy_state(&plane_state->uapi);
> + if (plane_state->hw.fb)
> + drm_framebuffer_put(plane_state->hw.fb);
> kfree(plane_state);
> }
>
> @@ -176,15 +182,44 @@ bool intel_plane_calc_min_cdclk(struct intel_atomic_state *state,
> return false;
> }
>
> +static void intel_plane_clear_hw_state(struct intel_plane_state *plane_state)
> +{
> + if (plane_state->hw.fb)
> + drm_framebuffer_put(plane_state->hw.fb);
> +
> + memset(&plane_state->hw, 0, sizeof(plane_state->hw));
> +}
> +
> +void intel_plane_copy_uapi_to_hw_state(struct intel_plane_state *plane_state,
> + const struct intel_plane_state *from_plane_state)
> +{
> + intel_plane_clear_hw_state(plane_state);
> +
> + plane_state->hw.crtc = from_plane_state->uapi.crtc;
> + plane_state->hw.fb = from_plane_state->uapi.fb;
> + if (plane_state->hw.fb)
> + drm_framebuffer_get(plane_state->hw.fb);
> +
> + plane_state->hw.alpha = from_plane_state->uapi.alpha;
> + plane_state->hw.pixel_blend_mode =
> + from_plane_state->uapi.pixel_blend_mode;
> + plane_state->hw.rotation = from_plane_state->uapi.rotation;
> + plane_state->hw.color_encoding = from_plane_state->uapi.color_encoding;
> + plane_state->hw.color_range = from_plane_state->uapi.color_range;
> +}
> +
> int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_state,
> struct intel_crtc_state *new_crtc_state,
> const struct intel_plane_state *old_plane_state,
> struct intel_plane_state *new_plane_state)
> {
> struct intel_plane *plane = to_intel_plane(new_plane_state->uapi.plane);
> - const struct drm_framebuffer *fb = new_plane_state->hw.fb;
> + const struct drm_framebuffer *fb;
> int ret;
>
> + intel_plane_copy_uapi_to_hw_state(new_plane_state, new_plane_state);
> + fb = new_plane_state->hw.fb;
> +
> new_crtc_state->active_planes &= ~BIT(plane->id);
> new_crtc_state->nv12_planes &= ~BIT(plane->id);
> new_crtc_state->c8_planes &= ~BIT(plane->id);
> diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.h b/drivers/gpu/drm/i915/display/intel_atomic_plane.h
> index e61e9a82aadf..cdb0f97d09f9 100644
> --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.h
> +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.h
> @@ -20,6 +20,8 @@ extern const struct drm_plane_helper_funcs intel_plane_helper_funcs;
>
> unsigned int intel_plane_data_rate(const struct intel_crtc_state *crtc_state,
> const struct intel_plane_state *plane_state);
> +void intel_plane_copy_uapi_to_hw_state(struct intel_plane_state *plane_state,
> + const struct intel_plane_state *from_plane_state);
> void intel_update_plane(struct intel_plane *plane,
> const struct intel_crtc_state *crtc_state,
> const struct intel_plane_state *plane_state);
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index 1584421c76b9..7ee5d1f5a180 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -3283,6 +3283,7 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
>
> plane_state->fb = fb;
> plane_state->crtc = &intel_crtc->base;
> + intel_plane_copy_uapi_to_hw_state(intel_state, intel_state);
>
> atomic_or(to_intel_plane(primary)->frontbuffer_bit,
> &to_intel_frontbuffer(fb)->bits);
> diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
> index 6036b2b3980b..fef81e450e22 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_types.h
> +++ b/drivers/gpu/drm/i915/display/intel_display_types.h
> @@ -523,11 +523,24 @@ struct intel_atomic_state {
> };
>
> struct intel_plane_state {
> - union {
> - struct drm_plane_state base;
> - struct drm_plane_state uapi;
> - struct drm_plane_state hw;
> - };
> + struct drm_plane_state uapi;
> +
> + /*
> + * actual hardware state, the state we program to the hardware.
> + * The following members are used to verify the hardware state:
> + * During initial hw readout, they need to be copied from uapi.
> + */
> + struct {
> + struct drm_crtc *crtc;
> + struct drm_framebuffer *fb;
> +
> + u16 alpha;
> + uint16_t pixel_blend_mode;
> + unsigned int rotation;
> + enum drm_color_encoding color_encoding;
> + enum drm_color_range color_range;
> + } hw;
> +
> struct i915_ggtt_view view;
> struct i915_vma *vma;
> unsigned long flags;
> --
> 2.23.0
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
WARNING: multiple messages have this Message-ID (diff)
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [CI 11/12] drm/i915: Complete plane hw and uapi split, v2.
Date: Wed, 30 Oct 2019 19:04:49 +0200 [thread overview]
Message-ID: <20191030170449.GS1208@intel.com> (raw)
Message-ID: <20191030170449.DghliV1nSIYAAXcPjGqljvO-Vek2wxRQl9fsQV0qz3Y@z> (raw)
In-Reply-To: <20191030142657.22405-11-maarten.lankhorst@linux.intel.com>
On Wed, Oct 30, 2019 at 03:26:56PM +0100, Maarten Lankhorst wrote:
> Splitting plane state is easier than splitting crtc_state,
> before plane check we copy the drm properties to hw so we can
> do the same in bigjoiner later on.
>
> We copy the state after we did all the modeset handling, but fortunately
> i915 seems to be split correctly and nothing during modeset looks
> at plane_state.
>
> Changes since v1:
> - Do not clear hw state on duplication.
>
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
lgtm, apart from the slightly wasteful types, but we can fix those
later when fixing the core struct too.
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> .../gpu/drm/i915/display/intel_atomic_plane.c | 37 ++++++++++++++++++-
> .../gpu/drm/i915/display/intel_atomic_plane.h | 2 +
> drivers/gpu/drm/i915/display/intel_display.c | 1 +
> .../drm/i915/display/intel_display_types.h | 23 +++++++++---
> 4 files changed, 57 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c b/drivers/gpu/drm/i915/display/intel_atomic_plane.c
> index 18023422a34d..249fb41d78a5 100644
> --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c
> +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c
> @@ -93,6 +93,10 @@ intel_plane_duplicate_state(struct drm_plane *plane)
> intel_state->vma = NULL;
> intel_state->flags = 0;
>
> + /* add reference to fb */
> + if (intel_state->hw.fb)
> + drm_framebuffer_get(intel_state->hw.fb);
> +
> return &intel_state->uapi;
> }
>
> @@ -112,6 +116,8 @@ intel_plane_destroy_state(struct drm_plane *plane,
> WARN_ON(plane_state->vma);
>
> __drm_atomic_helper_plane_destroy_state(&plane_state->uapi);
> + if (plane_state->hw.fb)
> + drm_framebuffer_put(plane_state->hw.fb);
> kfree(plane_state);
> }
>
> @@ -176,15 +182,44 @@ bool intel_plane_calc_min_cdclk(struct intel_atomic_state *state,
> return false;
> }
>
> +static void intel_plane_clear_hw_state(struct intel_plane_state *plane_state)
> +{
> + if (plane_state->hw.fb)
> + drm_framebuffer_put(plane_state->hw.fb);
> +
> + memset(&plane_state->hw, 0, sizeof(plane_state->hw));
> +}
> +
> +void intel_plane_copy_uapi_to_hw_state(struct intel_plane_state *plane_state,
> + const struct intel_plane_state *from_plane_state)
> +{
> + intel_plane_clear_hw_state(plane_state);
> +
> + plane_state->hw.crtc = from_plane_state->uapi.crtc;
> + plane_state->hw.fb = from_plane_state->uapi.fb;
> + if (plane_state->hw.fb)
> + drm_framebuffer_get(plane_state->hw.fb);
> +
> + plane_state->hw.alpha = from_plane_state->uapi.alpha;
> + plane_state->hw.pixel_blend_mode =
> + from_plane_state->uapi.pixel_blend_mode;
> + plane_state->hw.rotation = from_plane_state->uapi.rotation;
> + plane_state->hw.color_encoding = from_plane_state->uapi.color_encoding;
> + plane_state->hw.color_range = from_plane_state->uapi.color_range;
> +}
> +
> int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_state,
> struct intel_crtc_state *new_crtc_state,
> const struct intel_plane_state *old_plane_state,
> struct intel_plane_state *new_plane_state)
> {
> struct intel_plane *plane = to_intel_plane(new_plane_state->uapi.plane);
> - const struct drm_framebuffer *fb = new_plane_state->hw.fb;
> + const struct drm_framebuffer *fb;
> int ret;
>
> + intel_plane_copy_uapi_to_hw_state(new_plane_state, new_plane_state);
> + fb = new_plane_state->hw.fb;
> +
> new_crtc_state->active_planes &= ~BIT(plane->id);
> new_crtc_state->nv12_planes &= ~BIT(plane->id);
> new_crtc_state->c8_planes &= ~BIT(plane->id);
> diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.h b/drivers/gpu/drm/i915/display/intel_atomic_plane.h
> index e61e9a82aadf..cdb0f97d09f9 100644
> --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.h
> +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.h
> @@ -20,6 +20,8 @@ extern const struct drm_plane_helper_funcs intel_plane_helper_funcs;
>
> unsigned int intel_plane_data_rate(const struct intel_crtc_state *crtc_state,
> const struct intel_plane_state *plane_state);
> +void intel_plane_copy_uapi_to_hw_state(struct intel_plane_state *plane_state,
> + const struct intel_plane_state *from_plane_state);
> void intel_update_plane(struct intel_plane *plane,
> const struct intel_crtc_state *crtc_state,
> const struct intel_plane_state *plane_state);
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index 1584421c76b9..7ee5d1f5a180 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -3283,6 +3283,7 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
>
> plane_state->fb = fb;
> plane_state->crtc = &intel_crtc->base;
> + intel_plane_copy_uapi_to_hw_state(intel_state, intel_state);
>
> atomic_or(to_intel_plane(primary)->frontbuffer_bit,
> &to_intel_frontbuffer(fb)->bits);
> diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
> index 6036b2b3980b..fef81e450e22 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_types.h
> +++ b/drivers/gpu/drm/i915/display/intel_display_types.h
> @@ -523,11 +523,24 @@ struct intel_atomic_state {
> };
>
> struct intel_plane_state {
> - union {
> - struct drm_plane_state base;
> - struct drm_plane_state uapi;
> - struct drm_plane_state hw;
> - };
> + struct drm_plane_state uapi;
> +
> + /*
> + * actual hardware state, the state we program to the hardware.
> + * The following members are used to verify the hardware state:
> + * During initial hw readout, they need to be copied from uapi.
> + */
> + struct {
> + struct drm_crtc *crtc;
> + struct drm_framebuffer *fb;
> +
> + u16 alpha;
> + uint16_t pixel_blend_mode;
> + unsigned int rotation;
> + enum drm_color_encoding color_encoding;
> + enum drm_color_range color_range;
> + } hw;
> +
> struct i915_ggtt_view view;
> struct i915_vma *vma;
> unsigned long flags;
> --
> 2.23.0
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2019-10-30 17:04 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-30 14:26 [CI 01/12] drm/i915: Handle a few more cases for crtc hw/uapi split, v3 Maarten Lankhorst
2019-10-30 14:26 ` [Intel-gfx] " Maarten Lankhorst
2019-10-30 14:26 ` [CI 02/12] drm/i915: Add aliases for uapi and hw to crtc_state Maarten Lankhorst
2019-10-30 14:26 ` [Intel-gfx] " Maarten Lankhorst
2019-10-30 14:26 ` [CI 03/12] drm/i915: Perform manual conversions for crtc uapi/hw split, v2 Maarten Lankhorst
2019-10-30 14:26 ` [Intel-gfx] " Maarten Lankhorst
2019-10-30 17:03 ` Ville Syrjälä
2019-10-30 17:03 ` [Intel-gfx] " Ville Syrjälä
2019-10-30 18:11 ` Maarten Lankhorst
2019-10-30 18:11 ` [Intel-gfx] " Maarten Lankhorst
2019-10-30 14:26 ` [CI 04/12] drm/i915: Perform automated conversions for crtc uapi/hw split, base -> hw Maarten Lankhorst
2019-10-30 14:26 ` [Intel-gfx] " Maarten Lankhorst
2019-10-30 14:26 ` [CI 05/12] drm/i915: Perform automated conversions for crtc uapi/hw split, base -> uapi Maarten Lankhorst
2019-10-30 14:26 ` [Intel-gfx] " Maarten Lankhorst
2019-10-30 14:26 ` [CI 06/12] drm/i915: Complete crtc hw/uapi split, v5 Maarten Lankhorst
2019-10-30 14:26 ` [Intel-gfx] " Maarten Lankhorst
2019-10-30 16:51 ` Ville Syrjälä
2019-10-30 16:51 ` [Intel-gfx] " Ville Syrjälä
2019-10-30 14:26 ` [CI 07/12] drm/i915: Add aliases for uapi and hw to plane_state Maarten Lankhorst
2019-10-30 14:26 ` [Intel-gfx] " Maarten Lankhorst
2019-10-30 14:26 ` [CI 08/12] drm/i915: Perform manual conversions for plane uapi/hw split, v2 Maarten Lankhorst
2019-10-30 14:26 ` [Intel-gfx] " Maarten Lankhorst
2019-10-30 16:19 ` Ville Syrjälä
2019-10-30 16:19 ` [Intel-gfx] " Ville Syrjälä
2019-10-31 9:15 ` Maarten Lankhorst
2019-10-31 9:15 ` [Intel-gfx] " Maarten Lankhorst
2019-10-31 10:30 ` Ville Syrjälä
2019-10-31 10:30 ` [Intel-gfx] " Ville Syrjälä
2019-10-31 11:27 ` Maarten Lankhorst
2019-10-31 11:27 ` [Intel-gfx] " Maarten Lankhorst
2019-10-30 14:26 ` [CI 09/12] drm/i915: Perform automated conversions for plane uapi/hw split, base -> hw Maarten Lankhorst
2019-10-30 14:26 ` [Intel-gfx] " Maarten Lankhorst
2019-10-30 14:26 ` [CI 10/12] drm/i915: Perform automated conversions for plane uapi/hw split, base -> uapi Maarten Lankhorst
2019-10-30 14:26 ` [Intel-gfx] " Maarten Lankhorst
2019-10-30 16:41 ` Ville Syrjälä
2019-10-30 16:41 ` [Intel-gfx] " Ville Syrjälä
2019-10-30 14:26 ` [CI 11/12] drm/i915: Complete plane hw and uapi split, v2 Maarten Lankhorst
2019-10-30 14:26 ` [Intel-gfx] " Maarten Lankhorst
2019-10-30 17:04 ` Ville Syrjälä [this message]
2019-10-30 17:04 ` Ville Syrjälä
2019-10-30 14:26 ` [CI 12/12] drm/i915: Remove special case slave handling during hw programming, v3 Maarten Lankhorst
2019-10-30 14:26 ` [Intel-gfx] " Maarten Lankhorst
2019-10-30 17:00 ` Ville Syrjälä
2019-10-30 17:00 ` [Intel-gfx] " Ville Syrjälä
2019-10-30 14:41 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [CI,01/12] drm/i915: Handle a few more cases for crtc hw/uapi split, v3 Patchwork
2019-10-30 14:41 ` [Intel-gfx] " Patchwork
2019-10-30 14:47 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-10-30 14:47 ` [Intel-gfx] " Patchwork
2019-10-30 15:16 ` ✓ Fi.CI.BAT: success " Patchwork
2019-10-30 15:16 ` [Intel-gfx] " Patchwork
2019-10-31 16:34 ` ✓ Fi.CI.IGT: " Patchwork
2019-10-31 16:34 ` [Intel-gfx] " 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=20191030170449.GS1208@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=maarten.lankhorst@linux.intel.com \
/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.