]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915/display/psr: Program plane's calculated offset to plane SF register
authorJosé Roberto de Souza <jose.souza@intel.com>
Mon, 4 Jan 2021 20:56:54 +0000 (12:56 -0800)
committerJosé Roberto de Souza <jose.souza@intel.com>
Tue, 5 Jan 2021 13:32:56 +0000 (05:32 -0800)
It programs Plane's calculated x, y, offset to Plane SF register.
It does the calculation of x and y offsets using
skl_calc_main_surface_offset().

v3: Update commit message

Cc: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
Tested-by: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210104205654.238928-4-jose.souza@intel.com
drivers/gpu/drm/i915/display/intel_psr.c

index f5b9519b375682e28f09f5a53653dc269275c320..c24ae69426cf3b2b47e4198d1a7f5f8d15c76d13 100644 (file)
@@ -1186,7 +1186,8 @@ void intel_psr2_program_plane_sel_fetch(struct intel_plane *plane,
        struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
        enum pipe pipe = plane->pipe;
        const struct drm_rect *clip;
-       u32 val;
+       u32 val, offset;
+       int ret, x, y;
 
        if (!crtc_state->enable_psr2_sel_fetch)
                return;
@@ -1203,9 +1204,14 @@ void intel_psr2_program_plane_sel_fetch(struct intel_plane *plane,
        val |= plane_state->uapi.dst.x1;
        intel_de_write_fw(dev_priv, PLANE_SEL_FETCH_POS(pipe, plane->id), val);
 
-       /* TODO: consider tiling and auxiliary surfaces */
-       val = (clip->y1 + plane_state->color_plane[color_plane].y) << 16;
-       val |= plane_state->color_plane[color_plane].x;
+       /* TODO: consider auxiliary surfaces */
+       x = plane_state->uapi.src.x1 >> 16;
+       y = (plane_state->uapi.src.y1 >> 16) + clip->y1;
+       ret = skl_calc_main_surface_offset(plane_state, &x, &y, &offset);
+       if (ret)
+               drm_warn_once(&dev_priv->drm, "skl_calc_main_surface_offset() returned %i\n",
+                             ret);
+       val = y << 16 | x;
        intel_de_write_fw(dev_priv, PLANE_SEL_FETCH_OFFSET(pipe, plane->id),
                          val);