Skip to content

Commit e1c6c70

Browse files
committed
drm/i915: pass dev_priv explicitly to PALETTE
Avoid the implicit dev_priv local variable use, and pass dev_priv explicitly to the PALETTE register macro. Reviewed-by: Rodrigo Vivi <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/bf07d29cefef23ebd5d54fbb0d3bf7e41d132d93.1714399071.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <[email protected]>
1 parent 41b088a commit e1c6c70

File tree

2 files changed

+20
-11
lines changed

2 files changed

+20
-11
lines changed

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

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1227,7 +1227,7 @@ static void i9xx_load_lut_8(struct intel_crtc *crtc,
12271227
lut = blob->data;
12281228

12291229
for (i = 0; i < 256; i++)
1230-
intel_de_write_fw(dev_priv, PALETTE(pipe, i),
1230+
intel_de_write_fw(dev_priv, PALETTE(dev_priv, pipe, i),
12311231
i9xx_lut_8(&lut[i]));
12321232
}
12331233

@@ -1240,9 +1240,11 @@ static void i9xx_load_lut_10(struct intel_crtc *crtc,
12401240
enum pipe pipe = crtc->pipe;
12411241

12421242
for (i = 0; i < lut_size - 1; i++) {
1243-
intel_de_write_fw(dev_priv, PALETTE(pipe, 2 * i + 0),
1243+
intel_de_write_fw(dev_priv,
1244+
PALETTE(dev_priv, pipe, 2 * i + 0),
12441245
i9xx_lut_10_ldw(&lut[i]));
1245-
intel_de_write_fw(dev_priv, PALETTE(pipe, 2 * i + 1),
1246+
intel_de_write_fw(dev_priv,
1247+
PALETTE(dev_priv, pipe, 2 * i + 1),
12461248
i9xx_lut_10_udw(&lut[i]));
12471249
}
12481250
}
@@ -1274,9 +1276,11 @@ static void i965_load_lut_10p6(struct intel_crtc *crtc,
12741276
enum pipe pipe = crtc->pipe;
12751277

12761278
for (i = 0; i < lut_size - 1; i++) {
1277-
intel_de_write_fw(dev_priv, PALETTE(pipe, 2 * i + 0),
1279+
intel_de_write_fw(dev_priv,
1280+
PALETTE(dev_priv, pipe, 2 * i + 0),
12781281
i965_lut_10p6_ldw(&lut[i]));
1279-
intel_de_write_fw(dev_priv, PALETTE(pipe, 2 * i + 1),
1282+
intel_de_write_fw(dev_priv,
1283+
PALETTE(dev_priv, pipe, 2 * i + 1),
12801284
i965_lut_10p6_udw(&lut[i]));
12811285
}
12821286

@@ -3150,7 +3154,8 @@ static struct drm_property_blob *i9xx_read_lut_8(struct intel_crtc *crtc)
31503154
lut = blob->data;
31513155

31523156
for (i = 0; i < LEGACY_LUT_LENGTH; i++) {
3153-
u32 val = intel_de_read_fw(dev_priv, PALETTE(pipe, i));
3157+
u32 val = intel_de_read_fw(dev_priv,
3158+
PALETTE(dev_priv, pipe, i));
31543159

31553160
i9xx_lut_8_pack(&lut[i], val);
31563161
}
@@ -3176,8 +3181,10 @@ static struct drm_property_blob *i9xx_read_lut_10(struct intel_crtc *crtc)
31763181
lut = blob->data;
31773182

31783183
for (i = 0; i < lut_size - 1; i++) {
3179-
ldw = intel_de_read_fw(dev_priv, PALETTE(pipe, 2 * i + 0));
3180-
udw = intel_de_read_fw(dev_priv, PALETTE(pipe, 2 * i + 1));
3184+
ldw = intel_de_read_fw(dev_priv,
3185+
PALETTE(dev_priv, pipe, 2 * i + 0));
3186+
udw = intel_de_read_fw(dev_priv,
3187+
PALETTE(dev_priv, pipe, 2 * i + 1));
31813188

31823189
i9xx_lut_10_pack(&lut[i], ldw, udw);
31833190
}
@@ -3224,8 +3231,10 @@ static struct drm_property_blob *i965_read_lut_10p6(struct intel_crtc *crtc)
32243231
lut = blob->data;
32253232

32263233
for (i = 0; i < lut_size - 1; i++) {
3227-
u32 ldw = intel_de_read_fw(dev_priv, PALETTE(pipe, 2 * i + 0));
3228-
u32 udw = intel_de_read_fw(dev_priv, PALETTE(pipe, 2 * i + 1));
3234+
u32 ldw = intel_de_read_fw(dev_priv,
3235+
PALETTE(dev_priv, pipe, 2 * i + 0));
3236+
u32 udw = intel_de_read_fw(dev_priv,
3237+
PALETTE(dev_priv, pipe, 2 * i + 1));
32293238

32303239
i965_lut_10p6_pack(&lut[i], ldw, udw);
32313240
}

drivers/gpu/drm/i915/display/intel_color_regs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#define PALETTE_10BIT_BLUE_EXP_MASK REG_GENMASK(7, 6)
3131
#define PALETTE_10BIT_BLUE_MANT_MASK REG_GENMASK(5, 2)
3232
#define PALETTE_10BIT_BLUE_UDW_MASK REG_GENMASK(1, 0)
33-
#define PALETTE(pipe, i) _MMIO(DISPLAY_MMIO_BASE(dev_priv) + \
33+
#define PALETTE(dev_priv, pipe, i) _MMIO(DISPLAY_MMIO_BASE(dev_priv) + \
3434
_PICK_EVEN_2RANGES(pipe, 2, \
3535
_PALETTE_A, _PALETTE_B, \
3636
_CHV_PALETTE_C, _CHV_PALETTE_C) + \

0 commit comments

Comments
 (0)