Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: "Kandpal, Suraj" <suraj.kandpal@intel.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org>
Cc: "ville.syrjala@linux.intel.com" <ville.syrjala@linux.intel.com>,
	"Deak, Imre" <imre.deak@intel.com>
Subject: RE: [PATCH 1/3] drm/i915/reg: use REG_BIT and friends to define DP registers
Date: Wed, 12 Feb 2025 11:39:11 +0200	[thread overview]
Message-ID: <87v7tfzem8.fsf@intel.com> (raw)
In-Reply-To: <SN7PR11MB6750130E77EEDC5C1700E211E3FC2@SN7PR11MB6750.namprd11.prod.outlook.com>

On Wed, 12 Feb 2025, "Kandpal, Suraj" <suraj.kandpal@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

  reply	other threads:[~2025-02-12  9:39 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-07 13:35 [PATCH 0/3] drm/i915: i915_reg.h display split Jani Nikula
2025-02-07 13:35 ` [PATCH 1/3] drm/i915/reg: use REG_BIT and friends to define DP registers Jani Nikula
2025-02-12  8:07   ` Kandpal, Suraj
2025-02-12  9:39     ` Jani Nikula [this message]
2025-02-12 12:42       ` Kandpal, Suraj
2025-02-07 13:35 ` [PATCH 2/3] drm/i915/reg: Remove some extra blank lines Jani Nikula
2025-02-12  8:07   ` Kandpal, Suraj
2025-02-07 13:35 ` [PATCH 3/3] drm/i915: split out display register macros to a separate file Jani Nikula
2025-02-12  8:48   ` Kandpal, Suraj
2025-02-12  9:41     ` Jani Nikula
2025-02-12 14:45   ` Ville Syrjälä
2025-02-12 15:12     ` Ville Syrjälä
2025-02-12 16:49       ` Jani Nikula
2025-02-07 16:47 ` ✓ CI.Patch_applied: success for drm/i915: i915_reg.h display split Patchwork
2025-02-07 16:48 ` ✗ CI.checkpatch: warning " Patchwork
2025-02-07 16:49 ` ✓ CI.KUnit: success " Patchwork
2025-02-07 17:05 ` ✓ CI.Build: " Patchwork
2025-02-07 17:08 ` ✓ CI.Hooks: " Patchwork
2025-02-07 17:09 ` ✓ CI.checksparse: " Patchwork
2025-02-07 17:31 ` ✓ Xe.CI.BAT: " Patchwork
2025-02-08  4:09 ` ✗ Xe.CI.Full: failure " 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=87v7tfzem8.fsf@intel.com \
    --to=jani.nikula@intel.com \
    --cc=imre.deak@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=suraj.kandpal@intel.com \
    --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