[PATCH 1/3] drm/i915/reg: use REG_BIT and friends to define DP registers

Jani Nikula jani.nikula at intel.com
Wed Feb 12 09:39:11 UTC 2025


On Wed, 12 Feb 2025, "Kandpal, Suraj" <suraj.kandpal at intel.com> wrote:
>> diff --git a/drivers/gpu/drm/i915/i915_reg.h
>> b/drivers/gpu/drm/i915/i915_reg.h index 670cd2371f94..da658c3591f0
>> 100644
>> --- a/drivers/gpu/drm/i915/i915_reg.h
>> +++ b/drivers/gpu/drm/i915/i915_reg.h
>> @@ -1394,88 +1394,50 @@
>>  #define VLV_DP_B             _MMIO(VLV_DISPLAY_BASE + 0x64100)
>>  #define VLV_DP_C             _MMIO(VLV_DISPLAY_BASE + 0x64200)
>>  #define CHV_DP_D             _MMIO(VLV_DISPLAY_BASE + 0x64300)
>> -#define   DP_PORT_EN                 (1 << 31)
>> -#define   DP_PIPE_SEL_SHIFT          30
>> -#define   DP_PIPE_SEL_MASK           (1 << 30)
>> -#define   DP_PIPE_SEL(pipe)          ((pipe) << 30)
>> -#define   DP_PIPE_SEL_SHIFT_IVB              29
>> -#define   DP_PIPE_SEL_MASK_IVB               (3 << 29)
>> -#define   DP_PIPE_SEL_IVB(pipe)              ((pipe) << 29)
>> +#define   DP_PORT_EN                 REG_BIT(31)
>> +#define   DP_PIPE_SEL_MASK           REG_GENMASK(30, 30)
>
> Why not use REG_BIT() here REG_GENMASK for a single bit seems wrong

...because defining a MASK with BIT feels wrong to me. :)


BR,
Jani.


-- 
Jani Nikula, Intel


More information about the Intel-xe mailing list