[Intel-xe] [PATCH v2 05/11] drm/xe: Remove dependency on intel_gt_regs.h
Lucas De Marchi
lucas.demarchi at intel.com
Fri Feb 17 22:08:28 UTC 2023
On Fri, Feb 17, 2023 at 03:20:38PM -0500, Rodrigo Vivi wrote:
>On Thu, Feb 16, 2023 at 04:52:20PM -0800, Lucas De Marchi wrote:
>> Create regs/xe_gt_regs.h file with all the registers and bit
>> definitions used by the xe driver. Eventually the registers may be
>> defined in a different way and since xe doesn't supported below gen12,
>> the number of registers touched is much smaller, so create a new header.
>>
>> The definitions themselves are direct copy from the
>> gt/intel_gt_regs.h file, just sorting the registers by address.
>> Cleaning those up and adhering to a common coding style is left for
>> later.
>>
>> Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>
>> ---
>> drivers/gpu/drm/i915/i915_reg_defs.h | 2 +
>> drivers/gpu/drm/xe/regs/xe_gt_regs.h | 287 ++++++++++++++++++++++++++
>> drivers/gpu/drm/xe/xe_execlist.c | 2 +-
>> drivers/gpu/drm/xe/xe_force_wake.c | 3 +-
>> drivers/gpu/drm/xe/xe_ggtt.c | 2 +-
>> drivers/gpu/drm/xe/xe_gt.c | 3 +-
>> drivers/gpu/drm/xe/xe_gt_clock.c | 2 +-
>> drivers/gpu/drm/xe/xe_gt_mcr.c | 3 +-
>> drivers/gpu/drm/xe/xe_guc.c | 2 +-
>> drivers/gpu/drm/xe/xe_guc_ads.c | 4 +-
>> drivers/gpu/drm/xe/xe_guc_pc.c | 2 +-
>> drivers/gpu/drm/xe/xe_hw_engine.c | 2 +-
>> drivers/gpu/drm/xe/xe_irq.c | 2 +-
>> drivers/gpu/drm/xe/xe_lrc.c | 2 +-
>> drivers/gpu/drm/xe/xe_mmio.c | 2 +-
>> drivers/gpu/drm/xe/xe_mocs.c | 3 +-
>> drivers/gpu/drm/xe/xe_reg_sr.c | 3 +-
>> drivers/gpu/drm/xe/xe_reg_whitelist.c | 3 +-
>> drivers/gpu/drm/xe/xe_ring_ops.c | 2 +-
>> drivers/gpu/drm/xe/xe_tuning.c | 3 +-
>> drivers/gpu/drm/xe/xe_wa.c | 2 +-
>> 21 files changed, 308 insertions(+), 28 deletions(-)
>> create mode 100644 drivers/gpu/drm/xe/regs/xe_gt_regs.h
>>
>> diff --git a/drivers/gpu/drm/i915/i915_reg_defs.h b/drivers/gpu/drm/i915/i915_reg_defs.h
>> index b5e06b6a9478..a6080c983a77 100644
>> --- a/drivers/gpu/drm/i915/i915_reg_defs.h
>> +++ b/drivers/gpu/drm/i915/i915_reg_defs.h
>> @@ -136,6 +136,8 @@ typedef struct {
>> u32 reg;
>> } i915_mcr_reg_t;
>>
>> +#define MCR_REG(offset) ((const i915_mcr_reg_t){ .reg = (offset) })
>> +
>> #define INVALID_MMIO_REG _MMIO(0)
>>
>> /*
>> diff --git a/drivers/gpu/drm/xe/regs/xe_gt_regs.h b/drivers/gpu/drm/xe/regs/xe_gt_regs.h
>> new file mode 100644
>> index 000000000000..da40133252fb
>> --- /dev/null
>> +++ b/drivers/gpu/drm/xe/regs/xe_gt_regs.h
>> @@ -0,0 +1,287 @@
>> +/* SPDX-License-Identifier: MIT */
>> +/*
>> + * Copyright © 2023 Intel Corporation
>> + */
>> +
>> +#ifndef _XE_GT_REGS_H_
>> +#define _XE_GT_REGS_H_
>> +
>> +#include "i915_reg_defs.h"
>> +
>> +/* RPM unit config (Gen8+) */
>> +#define RPM_CONFIG0 _MMIO(0xd00)
>> +#define GEN11_RPM_CONFIG0_CRYSTAL_CLOCK_FREQ_SHIFT 3
>
>https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/215
>https://lore.kernel.org/all/Y9hw0sSC58B32yPg@mdroper-desk1.amr.corp.intel.com/
>
>Matt has asked us to get rid of the GEN stuff...
>I believe this is a great opportunity, although I believe it is not
>a blocker and could be done later.
I have that issue assigned to me so I don't forget. However I'd separate
the rather manual movement here from any cleanup. It's too easy to land
regressions because of a typo while converting coding style together
with a big code move like this. From the commit message:
The definitions themselves are direct copy from the
gt/intel_gt_regs.h file, just sorting the registers by address.
Cleaning those up and adhering to a common coding style is left for
later.
thanks
Lucas De Marchi
More information about the Intel-xe
mailing list