[Intel-gfx] [RFC 1/2] drm/i915: add display uncore helpers

Jani Nikula jani.nikula at intel.com
Tue Nov 5 13:33:07 UTC 2019


On Tue, 05 Nov 2019, Joonas Lahtinen <joonas.lahtinen at linux.intel.com> wrote:
> Quoting Jani Nikula (2019-10-29 12:51:55)
>> Add convenience helpers for the most common uncore operations with
>> struct drm_i915_private * as context rather than struct intel_uncore *.
>> 
>> The goal is to replace all instances of I915_READ(),
>> I915_POSTING_READ(), and I915_WRITE() in display/ with these, to finally
>> be able to get rid of the implicit dev_priv local parameter use.
>> 
>> The idea is that any non-u32 reads or writes are special enough that
>> they can use the intel_uncore_* functions directly.
>> 
>> Cc: Chris Wilson <chris at chris-wilson.co.uk>
>> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio at intel.com>
>> Cc: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
>> Cc: Lucas De Marchi <lucas.demarchi at intel.com>
>> Cc: Rodrigo Vivi <rodrigo.vivi at intel.com>
>> Cc: Ville Syrjälä <ville.syrjala at linux.intel.com>
>> Signed-off-by: Jani Nikula <jani.nikula at intel.com>
>
> <SNIP>
>
>> +++ b/drivers/gpu/drm/i915/display/intel_display_uncore.h
>> @@ -0,0 +1,36 @@
>> +/* SPDX-License-Identifier: MIT */
>> +/*
>> + * Copyright © 2019 Intel Corporation
>> + */
>> +
>> +#ifndef __INTEL_DISPLAY_UNCORE_H__
>> +#define __INTEL_DISPLAY_UNCORE_H__
>
> intel_de_uncore.c/.h for easier finding?
>
>> +
>> +#include "i915_drv.h"
>> +#include "i915_reg.h"
>> +#include "intel_uncore.h"
>> +
>> +static inline u32 intel_de_read(struct drm_i915_private *i915, i915_reg_t reg)
>
> I think it'd be good a opportunity to pass struct intel_de{,_uncore}
> as a parameter, and start grouping DE stuff underneath it?
>
> It'll of course be much bigger change.

One of the main points here was that for display code passing struct
drm_i915_private * should be the easiest thing to do. If there's a need
to group stuff within i915, fine, but no need to pass that here.

BR,
Jani.


-- 
Jani Nikula, Intel Open Source Graphics Center


More information about the Intel-gfx mailing list