Re: [PATCH 5/9] drm/i915/pcode: Add a couple of pcode helpers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Ashutosh,

On Tue, Apr 19, 2022 at 11:25:05PM -0700, Ashutosh Dixit wrote:
> From: Dale B Stimson <dale.b.stimson@xxxxxxxxx>
> 
> Add a couple of helpers to help formatting pcode commands and improve code
> readability.

Can you please add some more details on the helpers?

> v2: Fixed commit author (Rodrigo)
> 
> Cc: Mike Ruhl <michael.j.ruhl@xxxxxxxxx>
> Cc: Rodrigo Vivi <rodrigo.vivi@xxxxxxxxx>
> Signed-off-by: Dale B Stimson <dale.b.stimson@xxxxxxxxx>
> Signed-off-by: Ashutosh Dixit <ashutosh.dixit@xxxxxxxxx>
> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@xxxxxxxxx>

[...]

> +/*
> + * Helpers for dGfx PCODE mailbox command formatting
> + */
> +int __intel_gt_pcode_read(struct intel_gt *gt, u32 mbcmd, u32 p1, u32 p2, u32 *val);
> +int __intel_gt_pcode_write(struct intel_gt *gt, u32 mbcmd, u32 p1, u32 p2, u32 val);
> +
> +#define __snb_pcode_read(i915, mbcmd, p1, p2, val) \
> +	__intel_gt_pcode_read(&(i915)->gt0, mbcmd, p1, p2, val)
> +
> +#define __snb_pcode_write(i915, mbcmd, p1, p2, val) \
> +	__intel_gt_pcode_write(&(i915)->gt0, mbcmd, p1, p2, val)

to_gt(i915)

Why do we need these defines? Looks hacky and lazy. Can't we just
replace all __snb_pcode_read/write()?

Andi



[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux