[Intel-gfx] [PATCH v4 1/5] drm/i915/guc: Move GuC WOPCM related code into separate files

Yaodong Li yaodong.li at intel.com
Wed Dec 13 18:29:53 UTC 2017


On 12/13/2017 12:19 AM, Joonas Lahtinen wrote:
> On Tue, 2017-12-12 at 14:56 -0800, Jackie Li wrote:
>> intel_guc_reg.h should only include definition for GuC registers
>> and related register bits. GuC WOPCM related values should not
>> be defined in intel_guc_reg.h
>>
>> This patch creates a better file structure by moving GuC WOPCM
>> related definitions int to a new header intel_guc_wopcm.h
>> and moving GuC WOPCM related functions to a new source file
>> intel_guc_wopcm.c
>>
>> Cc: Michal Wajdeczko <michal.wajdeczko at intel.com>
>> Cc: Sagar Arun Kamble <sagar.a.kamble at intel.com>
>> Cc: Chris Wilson <chris at chris-wilson.co.uk>
>> Cc: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
>> Signed-off-by: Jackie Li <yaodong.li at intel.com>
> <SNIP>
>
>> +++ b/drivers/gpu/drm/i915/intel_uc.c
>> @@ -218,7 +218,7 @@ int intel_uc_init_hw(struct drm_i915_private *dev_priv)
>>   	}
>>   
>>   	/* init WOPCM */
>> -	I915_WRITE(GUC_WOPCM_SIZE, intel_guc_wopcm_size(dev_priv));
>> +	I915_WRITE(GUC_WOPCM_SIZE, intel_guc_wopcm_size(guc));
> This is a write-once register, the code needs to be refactored to
> account that somebody (like an ugly BIOS) wrote it already and we have
> to live with that value. Otherwise we're digging a hole for future
> selves.
It's the way the current code works. I will work out a new patch to
do the code refactoring. Anyhow, this is a good catch! Thanks!
>
> We should also verify that the write sticks as we expect.
For the verification - the following dynamic partitioning patch will
guarantee the correctness of this size value. As for the successful
register updating, I will address it within the new patch code refactoring
patch.
>
> Regards, Joonas



More information about the Intel-gfx mailing list