Skip to content

Commit 5554e05

Browse files
committed
Merge tag 'drm-intel-fixes-2026-07-17' of https://gitlab.freedesktop.org/drm/i915/kernel into drm-fixes
Couple of display fixes (NV12 for bigjoiner and Watermark clear on plane disable) along with couple of GT selftests fixes. Signed-off-by: Dave Airlie <airlied@redhat.com> From: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://patch.msgid.link/alp3ks0K1ZsxUC05@intel.com
2 parents e442677 + 612978b commit 5554e05

4 files changed

Lines changed: 19 additions & 26 deletions

File tree

drivers/gpu/drm/i915/display/skl_universal_plane.c

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2126,19 +2126,6 @@ static int skl_check_main_surface(struct intel_plane_state *plane_state)
21262126
return 0;
21272127
}
21282128

2129-
2130-
/* Divide a U16.16 fixed-point value by 2, staying in fixed-point domain */
2131-
static inline u32 fp_16_16_div2(u32 fp)
2132-
{
2133-
return fp >> 1;
2134-
}
2135-
2136-
/* Convert a U16.16 fixed-point value to integer, rounding up */
2137-
static inline int fp_16_16_to_int_ceil(u32 fp)
2138-
{
2139-
return DIV_ROUND_UP(fp, 1 << 16);
2140-
}
2141-
21422129
static int skl_check_nv12_aux_surface(struct intel_plane_state *plane_state)
21432130
{
21442131
struct intel_display *display = to_intel_display(plane_state);
@@ -2154,14 +2141,20 @@ static int skl_check_nv12_aux_surface(struct intel_plane_state *plane_state)
21542141
int max_height = intel_plane_max_height(plane, fb, uv_plane, rotation);
21552142

21562143
/*
2157-
* LNL+ UV surface start/size =
2158-
* ceiling(half of Y plane start/size). Use ceiling division
2159-
* unconditionally; it is a no-op for even values.
2144+
* UV (chroma) start/size = ceiling(half of the *integer* Y plane
2145+
* start/size), i.e. the value the luma surface programs (src >> 16),
2146+
* not the raw U16.16. A bigjoiner seam mapped through the scaler can
2147+
* give a fractional luma src; ceiling that directly would round the
2148+
* chroma one column too far and read past the chroma surface.
21602149
*/
2161-
int x = fp_16_16_to_int_ceil(fp_16_16_div2(plane_state->uapi.src.x1));
2162-
int y = fp_16_16_to_int_ceil(fp_16_16_div2(plane_state->uapi.src.y1));
2163-
int w = fp_16_16_to_int_ceil(fp_16_16_div2(drm_rect_width(&plane_state->uapi.src)));
2164-
int h = fp_16_16_to_int_ceil(fp_16_16_div2(drm_rect_height(&plane_state->uapi.src)));
2150+
int luma_x = plane_state->uapi.src.x1 >> 16;
2151+
int luma_y = plane_state->uapi.src.y1 >> 16;
2152+
int luma_w = drm_rect_width(&plane_state->uapi.src) >> 16;
2153+
int luma_h = drm_rect_height(&plane_state->uapi.src) >> 16;
2154+
int x = DIV_ROUND_UP(luma_x, 2);
2155+
int y = DIV_ROUND_UP(luma_y, 2);
2156+
int w = DIV_ROUND_UP(luma_x + luma_w, 2) - x;
2157+
int h = DIV_ROUND_UP(luma_y + luma_h, 2) - y;
21652158
u32 offset;
21662159

21672160
/* FIXME not quite sure how/if these apply to the chroma plane */

drivers/gpu/drm/i915/display/skl_watermark.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3856,7 +3856,7 @@ void skl_wm_plane_disable_noatomic(struct intel_crtc *crtc,
38563856
return;
38573857

38583858
skl_ddb_entry_init(&crtc_state->wm.skl.plane_ddb[plane->id], 0, 0);
3859-
skl_ddb_entry_init(&crtc_state->wm.skl.plane_ddb[plane->id], 0, 0);
3859+
skl_ddb_entry_init(&crtc_state->wm.skl.plane_ddb_y[plane->id], 0, 0);
38603860

38613861
crtc_state->wm.skl.plane_min_ddb[plane->id] = 0;
38623862
crtc_state->wm.skl.plane_interim_ddb[plane->id] = 0;

drivers/gpu/drm/i915/gt/intel_engine_user.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ void intel_engines_driver_register(struct drm_i915_private *i915)
259259
p = &prev->rb_right;
260260
}
261261

262-
if (IS_ENABLED(CONFIG_DRM_I915_SELFTESTS) &&
262+
if (IS_ENABLED(CONFIG_DRM_I915_SELFTEST) &&
263263
IS_ENABLED(CONFIG_DRM_I915_DEBUG_GEM)) {
264264
struct intel_engine_cs *engine;
265265
unsigned int isolation;

drivers/gpu/drm/i915/gt/selftest_gt_pm.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ static int cmp_u64(const void *A, const void *B)
1616
{
1717
const u64 *a = A, *b = B;
1818

19-
if (a < b)
19+
if (*a < *b)
2020
return -1;
21-
else if (a > b)
21+
else if (*a > *b)
2222
return 1;
2323
else
2424
return 0;
@@ -28,9 +28,9 @@ static int cmp_u32(const void *A, const void *B)
2828
{
2929
const u32 *a = A, *b = B;
3030

31-
if (a < b)
31+
if (*a < *b)
3232
return -1;
33-
else if (a > b)
33+
else if (*a > *b)
3434
return 1;
3535
else
3636
return 0;

0 commit comments

Comments
 (0)