From: "Souza, Jose" <jose.souza@intel.com>
To: "ville.syrjala@linux.intel.com" <ville.syrjala@linux.intel.com>,
"intel-gfx@lists.freedesktop.org"
<intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH 05/18] drm/i915: Rename the plane_state->main/aux to plane_state->color_plane[]
Date: Wed, 22 Aug 2018 23:02:40 +0000 [thread overview]
Message-ID: <05f21c72a6d8110ca38e06f4d7fb0f1efeb3b377.camel@intel.com> (raw)
In-Reply-To: <20180719182214.4323-6-ville.syrjala@linux.intel.com>
On Thu, 2018-07-19 at 21:22 +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Make the main/aux surface stuff a bit more generic by using an array
> of structures. This will allow us to deal with both the main and aux
> surfaces with common code.
Nitpick: consider having a enum { SURFACE_MAIN = 0, SURFACE_AUX } and
use it instead of the magic numbers 0 and 1.
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> drivers/gpu/drm/i915/intel_display.c | 56 ++++++++++++++++++------
> ------------
> drivers/gpu/drm/i915/intel_drv.h | 6 +---
> drivers/gpu/drm/i915/intel_fbc.c | 4 +--
> drivers/gpu/drm/i915/intel_sprite.c | 29 ++++++++++---------
> 4 files changed, 46 insertions(+), 49 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c
> b/drivers/gpu/drm/i915/intel_display.c
> index 994685230b97..3aec789657b1 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -2946,9 +2946,9 @@ static bool
> skl_check_main_ccs_coordinates(struct intel_plane_state *plane_state
> const struct drm_framebuffer *fb = plane_state->base.fb;
> int hsub = fb->format->hsub;
> int vsub = fb->format->vsub;
> - int aux_x = plane_state->aux.x;
> - int aux_y = plane_state->aux.y;
> - u32 aux_offset = plane_state->aux.offset;
> + int aux_x = plane_state->color_plane[1].x;
> + int aux_y = plane_state->color_plane[1].y;
> + u32 aux_offset = plane_state->color_plane[1].offset;
> u32 alignment = intel_surf_alignment(fb, 1);
>
> while (aux_offset >= main_offset && aux_y <= main_y) {
> @@ -2971,9 +2971,9 @@ static bool
> skl_check_main_ccs_coordinates(struct intel_plane_state *plane_state
> if (aux_x != main_x || aux_y != main_y)
> return false;
>
> - plane_state->aux.offset = aux_offset;
> - plane_state->aux.x = aux_x;
> - plane_state->aux.y = aux_y;
> + plane_state->color_plane[1].offset = aux_offset;
> + plane_state->color_plane[1].x = aux_x;
> + plane_state->color_plane[1].y = aux_y;
>
> return true;
> }
> @@ -2994,7 +2994,7 @@ static int skl_check_main_surface(const struct
> intel_crtc_state *crtc_state,
> int pipe_src_w = crtc_state->pipe_src_w;
> int max_width = skl_max_plane_width(fb, 0, rotation);
> int max_height = 4096;
> - u32 alignment, offset, aux_offset = plane_state->aux.offset;
> + u32 alignment, offset, aux_offset = plane_state-
> >color_plane[1].offset;
>
> if (w > max_width || h > max_height) {
> DRM_DEBUG_KMS("requested Y/RGB source size %dx%d too
> big (limit %dx%d)\n",
> @@ -3067,15 +3067,15 @@ static int skl_check_main_surface(const
> struct intel_crtc_state *crtc_state,
> offs
> et, offset - alignment);
> }
>
> - if (x != plane_state->aux.x || y != plane_state->aux.y)
> {
> + if (x != plane_state->color_plane[1].x || y !=
> plane_state->color_plane[1].y) {
> DRM_DEBUG_KMS("Unable to find suitable display
> surface offset due to CCS\n");
> return -EINVAL;
> }
> }
>
> - plane_state->main.offset = offset;
> - plane_state->main.x = x;
> - plane_state->main.y = y;
> + plane_state->color_plane[0].offset = offset;
> + plane_state->color_plane[0].x = x;
> + plane_state->color_plane[0].y = y;
>
> return 0;
> }
> @@ -3125,9 +3125,9 @@ static int skl_check_nv12_aux_surface(struct
> intel_plane_state *plane_state)
> return -EINVAL;
> }
>
> - plane_state->aux.offset = offset;
> - plane_state->aux.x = x;
> - plane_state->aux.y = y;
> + plane_state->color_plane[1].offset = offset;
> + plane_state->color_plane[1].x = x;
> + plane_state->color_plane[1].y = y;
>
> return 0;
> }
> @@ -3152,9 +3152,9 @@ static int skl_check_ccs_aux_surface(struct
> intel_plane_state *plane_state)
> intel_add_fb_offsets(&x, &y, plane_state, 1);
> offset = intel_plane_compute_aligned_offset(&x, &y,
> plane_state, 1);
>
> - plane_state->aux.offset = offset;
> - plane_state->aux.x = x * hsub + src_x % hsub;
> - plane_state->aux.y = y * vsub + src_y % vsub;
> + plane_state->color_plane[1].offset = offset;
> + plane_state->color_plane[1].x = x * hsub + src_x % hsub;
> + plane_state->color_plane[1].y = y * vsub + src_y % vsub;
>
> return 0;
> }
> @@ -3198,9 +3198,9 @@ int skl_check_plane_surface(const struct
> intel_crtc_state *crtc_state,
> if (ret)
> return ret;
> } else {
> - plane_state->aux.offset = ~0xfff;
> - plane_state->aux.x = 0;
> - plane_state->aux.y = 0;
> + plane_state->color_plane[1].offset = ~0xfff;
> + plane_state->color_plane[1].x = 0;
> + plane_state->color_plane[1].y = 0;
> }
>
> ret = skl_check_main_surface(crtc_state, plane_state);
> @@ -3327,9 +3327,9 @@ int i9xx_check_plane_surface(struct
> intel_plane_state *plane_state)
> }
> }
>
> - plane_state->main.offset = offset;
> - plane_state->main.x = src_x;
> - plane_state->main.y = src_y;
> + plane_state->color_plane[0].offset = offset;
> + plane_state->color_plane[0].x = src_x;
> + plane_state->color_plane[0].y = src_y;
>
> return 0;
> }
> @@ -3344,15 +3344,15 @@ static void i9xx_update_plane(struct
> intel_plane *plane,
> u32 linear_offset;
> u32 dspcntr = plane_state->ctl;
> i915_reg_t reg = DSPCNTR(i9xx_plane);
> - int x = plane_state->main.x;
> - int y = plane_state->main.y;
> + int x = plane_state->color_plane[0].x;
> + int y = plane_state->color_plane[0].y;
> unsigned long irqflags;
> u32 dspaddr_offset;
>
> linear_offset = intel_fb_xy_to_linear(x, y, plane_state, 0);
>
> if (INTEL_GEN(dev_priv) >= 4)
> - dspaddr_offset = plane_state->main.offset;
> + dspaddr_offset = plane_state->color_plane[0].offset;
> else
> dspaddr_offset = linear_offset;
>
> @@ -9613,7 +9613,7 @@ static u32 intel_cursor_base(const struct
> intel_plane_state *plane_state)
> else
> base = intel_plane_ggtt_offset(plane_state);
>
> - base += plane_state->main.offset;
> + base += plane_state->color_plane[0].offset;
>
> /* ILK+ do this automagically */
> if (HAS_GMCH_DISPLAY(dev_priv) &&
> @@ -9692,7 +9692,7 @@ static int intel_check_cursor(struct
> intel_crtc_state *crtc_state,
> return -EINVAL;
> }
>
> - plane_state->main.offset = offset;
> + plane_state->color_plane[0].offset = offset;
>
> return 0;
> }
> diff --git a/drivers/gpu/drm/i915/intel_drv.h
> b/drivers/gpu/drm/i915/intel_drv.h
> index ad2bd62ee553..24282b855e81 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -501,11 +501,7 @@ struct intel_plane_state {
> struct {
> u32 offset;
> int x, y;
> - } main;
> - struct {
> - u32 offset;
> - int x, y;
> - } aux;
> + } color_plane[2];
>
> /* plane control register */
> u32 ctl;
> diff --git a/drivers/gpu/drm/i915/intel_fbc.c
> b/drivers/gpu/drm/i915/intel_fbc.c
> index 01d1d2088f04..74d425c700ef 100644
> --- a/drivers/gpu/drm/i915/intel_fbc.c
> +++ b/drivers/gpu/drm/i915/intel_fbc.c
> @@ -670,8 +670,8 @@ static void intel_fbc_update_state_cache(struct
> intel_crtc *crtc,
> cache->plane.src_w = drm_rect_width(&plane_state->base.src) >>
> 16;
> cache->plane.src_h = drm_rect_height(&plane_state->base.src) >>
> 16;
> cache->plane.visible = plane_state->base.visible;
> - cache->plane.adjusted_x = plane_state->main.x;
> - cache->plane.adjusted_y = plane_state->main.y;
> + cache->plane.adjusted_x = plane_state->color_plane[0].x;
> + cache->plane.adjusted_y = plane_state->color_plane[0].y;
> cache->plane.y = plane_state->base.src.y1 >> 16;
>
> if (!cache->plane.visible)
> diff --git a/drivers/gpu/drm/i915/intel_sprite.c
> b/drivers/gpu/drm/i915/intel_sprite.c
> index e35760814f25..d4b3d32d5e4a 100644
> --- a/drivers/gpu/drm/i915/intel_sprite.c
> +++ b/drivers/gpu/drm/i915/intel_sprite.c
> @@ -256,7 +256,7 @@ skl_update_plane(struct intel_plane *plane,
> enum pipe pipe = plane->pipe;
> u32 plane_ctl = plane_state->ctl;
> const struct drm_intel_sprite_colorkey *key = &plane_state-
> >ckey;
> - u32 surf_addr = plane_state->main.offset;
> + u32 surf_addr = plane_state->color_plane[0].offset;
> unsigned int rotation = plane_state->base.rotation;
> u32 stride = skl_plane_stride(fb, 0, rotation);
> u32 aux_stride = skl_plane_stride(fb, 1, rotation);
> @@ -264,8 +264,8 @@ skl_update_plane(struct intel_plane *plane,
> int crtc_y = plane_state->base.dst.y1;
> uint32_t crtc_w = drm_rect_width(&plane_state->base.dst);
> uint32_t crtc_h = drm_rect_height(&plane_state->base.dst);
> - uint32_t x = plane_state->main.x;
> - uint32_t y = plane_state->main.y;
> + uint32_t x = plane_state->color_plane[0].x;
> + uint32_t y = plane_state->color_plane[0].y;
> uint32_t src_w = drm_rect_width(&plane_state->base.src) >> 16;
> uint32_t src_h = drm_rect_height(&plane_state->base.src) >> 16;
> unsigned long irqflags;
> @@ -292,9 +292,10 @@ skl_update_plane(struct intel_plane *plane,
> I915_WRITE_FW(PLANE_STRIDE(pipe, plane_id), stride);
> I915_WRITE_FW(PLANE_SIZE(pipe, plane_id), (src_h << 16) |
> src_w);
> I915_WRITE_FW(PLANE_AUX_DIST(pipe, plane_id),
> - (plane_state->aux.offset - surf_addr) |
> aux_stride);
> + (plane_state->color_plane[1].offset - surf_addr)
> | aux_stride);
> I915_WRITE_FW(PLANE_AUX_OFFSET(pipe, plane_id),
> - (plane_state->aux.y << 16) | plane_state->aux.x);
> + (plane_state->color_plane[1].y << 16) |
> + plane_state->color_plane[1].x);
>
> /* program plane scaler */
> if (plane_state->scaler_id >= 0) {
> @@ -560,15 +561,15 @@ vlv_update_plane(struct intel_plane *plane,
> enum pipe pipe = plane->pipe;
> enum plane_id plane_id = plane->id;
> u32 sprctl = plane_state->ctl;
> - u32 sprsurf_offset = plane_state->main.offset;
> + u32 sprsurf_offset = plane_state->color_plane[0].offset;
> u32 linear_offset;
> const struct drm_intel_sprite_colorkey *key = &plane_state-
> >ckey;
> int crtc_x = plane_state->base.dst.x1;
> int crtc_y = plane_state->base.dst.y1;
> uint32_t crtc_w = drm_rect_width(&plane_state->base.dst);
> uint32_t crtc_h = drm_rect_height(&plane_state->base.dst);
> - uint32_t x = plane_state->main.x;
> - uint32_t y = plane_state->main.y;
> + uint32_t x = plane_state->color_plane[0].x;
> + uint32_t y = plane_state->color_plane[0].y;
> unsigned long irqflags;
>
> /* Sizes are 0 based */
> @@ -719,15 +720,15 @@ ivb_update_plane(struct intel_plane *plane,
> const struct drm_framebuffer *fb = plane_state->base.fb;
> enum pipe pipe = plane->pipe;
> u32 sprctl = plane_state->ctl, sprscale = 0;
> - u32 sprsurf_offset = plane_state->main.offset;
> + u32 sprsurf_offset = plane_state->color_plane[0].offset;
> u32 linear_offset;
> const struct drm_intel_sprite_colorkey *key = &plane_state-
> >ckey;
> int crtc_x = plane_state->base.dst.x1;
> int crtc_y = plane_state->base.dst.y1;
> uint32_t crtc_w = drm_rect_width(&plane_state->base.dst);
> uint32_t crtc_h = drm_rect_height(&plane_state->base.dst);
> - uint32_t x = plane_state->main.x;
> - uint32_t y = plane_state->main.y;
> + uint32_t x = plane_state->color_plane[0].x;
> + uint32_t y = plane_state->color_plane[0].y;
> uint32_t src_w = drm_rect_width(&plane_state->base.src) >> 16;
> uint32_t src_h = drm_rect_height(&plane_state->base.src) >> 16;
> unsigned long irqflags;
> @@ -891,15 +892,15 @@ g4x_update_plane(struct intel_plane *plane,
> const struct drm_framebuffer *fb = plane_state->base.fb;
> enum pipe pipe = plane->pipe;
> u32 dvscntr = plane_state->ctl, dvsscale = 0;
> - u32 dvssurf_offset = plane_state->main.offset;
> + u32 dvssurf_offset = plane_state->color_plane[0].offset;
> u32 linear_offset;
> const struct drm_intel_sprite_colorkey *key = &plane_state-
> >ckey;
> int crtc_x = plane_state->base.dst.x1;
> int crtc_y = plane_state->base.dst.y1;
> uint32_t crtc_w = drm_rect_width(&plane_state->base.dst);
> uint32_t crtc_h = drm_rect_height(&plane_state->base.dst);
> - uint32_t x = plane_state->main.x;
> - uint32_t y = plane_state->main.y;
> + uint32_t x = plane_state->color_plane[0].x;
> + uint32_t y = plane_state->color_plane[0].y;
> uint32_t src_w = drm_rect_width(&plane_state->base.src) >> 16;
> uint32_t src_h = drm_rect_height(&plane_state->base.src) >> 16;
> unsigned long irqflags;
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2018-08-22 23:02 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-19 18:21 [PATCH 00/18] drm/i915: GTT remapping for display Ville Syrjala
2018-07-19 18:21 ` [PATCH 01/18] drm/i915: Fix glk/cnl display w/a #1175 Ville Syrjala
2018-07-20 10:55 ` Imre Deak
2018-07-19 18:21 ` [PATCH 02/18] drm/i915: s/tile_offset/aligned_offset/ Ville Syrjala
2018-08-22 21:55 ` Souza, Jose
2018-07-19 18:21 ` [PATCH 03/18] drm/i915: Add .max_stride() plane hook Ville Syrjala
2018-08-22 22:03 ` Souza, Jose
2018-08-22 22:19 ` Souza, Jose
2018-08-23 14:48 ` Ville Syrjälä
2018-08-23 14:52 ` Ville Syrjälä
2018-07-19 18:22 ` [PATCH 04/18] drm/i915: Use pipe A primary plane .max_stride() as the global stride limit Ville Syrjala
2018-08-22 22:22 ` Souza, Jose
2018-07-19 18:22 ` [PATCH 05/18] drm/i915: Rename the plane_state->main/aux to plane_state->color_plane[] Ville Syrjala
2018-08-22 23:02 ` Souza, Jose [this message]
2018-07-19 18:22 ` [PATCH 06/18] drm/i915: Store the final plane stride in plane_state Ville Syrjala
2018-07-20 11:06 ` [PATCH v2 " Ville Syrjala
2018-08-22 23:44 ` Souza, Jose
2018-07-19 18:22 ` [PATCH 07/18] drm/i915: Store ggtt_view " Ville Syrjala
2018-08-24 20:13 ` Souza, Jose
2018-07-19 18:22 ` [PATCH 08/18] drm/i915: s/int plane/int color_plane/ Ville Syrjala
2018-08-23 1:14 ` Rodrigo Vivi
2018-08-24 0:05 ` Souza, Jose
2018-07-19 18:22 ` [PATCH 09/18] drm/i915: Nuke plane->can_scale/min_downscale Ville Syrjala
2018-08-24 0:32 ` Souza, Jose
2018-07-19 18:22 ` [PATCH 10/18] drm/i915: Extract per-platform plane->check() functions Ville Syrjala
2018-08-24 1:01 ` Souza, Jose
2018-08-24 12:03 ` Ville Syrjälä
2018-07-19 18:22 ` [PATCH 11/18] drm/i915: Move skl plane fb related checks into a better place Ville Syrjala
2018-08-24 19:56 ` Souza, Jose
2018-08-27 11:48 ` Ville Syrjälä
2018-07-19 18:22 ` [PATCH 12/18] drm/i915: Move display w/a #1175 Ville Syrjala
2018-08-23 1:09 ` Rodrigo Vivi
2018-07-19 18:22 ` [PATCH 13/18] drm/i915: Move chv rotation checks to plane->check() Ville Syrjala
2018-08-24 20:04 ` Souza, Jose
2018-07-19 18:22 ` [PATCH 14/18] drm/i915: Extract intel_cursor_check_surface() Ville Syrjala
2018-08-24 20:08 ` Souza, Jose
2018-07-19 18:22 ` [PATCH 15/18] drm/i915: Add a new "remapped" gtt_view Ville Syrjala
2018-07-19 18:59 ` Chris Wilson
2018-07-19 19:33 ` Ville Syrjälä
2018-07-19 19:46 ` Chris Wilson
2018-07-19 19:55 ` Ville Syrjälä
2018-07-19 20:16 ` Ville Syrjälä
2018-07-19 20:25 ` Chris Wilson
2018-07-19 18:22 ` [PATCH 16/18] drm/i915: Overcome display engine stride limits via GTT remapping Ville Syrjala
2018-07-19 19:01 ` Chris Wilson
2018-07-19 19:20 ` Ville Syrjälä
2018-07-19 18:22 ` [PATCH 17/18] drm/i915: Bump gen4+ fb stride limit to 256KiB Ville Syrjala
2018-08-24 20:49 ` Souza, Jose
2018-07-19 18:22 ` [PATCH 18/18] drm/i915: Bump gen4+ fb size limits to 32kx32k Ville Syrjala
2018-08-24 20:49 ` Souza, Jose
2018-07-19 18:52 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: GTT remapping for display Patchwork
2018-07-19 19:00 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-07-19 19:15 ` ✓ Fi.CI.BAT: success " Patchwork
2018-07-20 0:02 ` ✗ Fi.CI.IGT: failure " Patchwork
2018-07-20 11:15 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: GTT remapping for display (rev2) Patchwork
2018-07-20 11:23 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-07-20 11:37 ` ✓ Fi.CI.BAT: success " Patchwork
2018-07-21 14:16 ` ✓ Fi.CI.IGT: " 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=05f21c72a6d8110ca38e06f4d7fb0f1efeb3b377.camel@intel.com \
--to=jose.souza@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=ville.syrjala@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).