All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 0/5] drm/i915/pmu: hide struct i915_pmu
Date: Tue, 07 Nov 2023 13:29:31 +0200	[thread overview]
Message-ID: <871qd1ztr8.fsf@intel.com> (raw)
In-Reply-To: <4b259843-c3e2-4fd0-9160-14f1d67ed27d@linux.intel.com>

On Fri, 03 Nov 2023, Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> wrote:
> On 02/11/2023 16:47, Jani Nikula wrote:
>> On Thu, 02 Nov 2023, Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> wrote:
>>> On 02/11/2023 15:42, Jani Nikula wrote:
>>>> The implementation details of pmu should be implementation details
>>>> hidden inside i915_pmu.c. Make it so.
>>>
>>> Don't tell me i915->pmu bothers xe somehow?
>> 
>> It doesn't bother xe, it bothers me...
>> 
>>> I am not a fan of the series
>>> on a glance. Replacing an increment with a function call for instance.
>> 
>> I think you glanced at the wart of this series. ;)
>> 
>> It just bugs me that we expose a plethora of data that should be
>> internal to pmu, basically just for that one increment.
>> 
>> And we pull in a bunch of headers to define struct i915_pmu, and then we
>> implicitly depend on those headers in a ton of places through incredible
>> chains of includes.
>> 
>> And we rebuild everything and a half when those headers change. Or when
>> the pmu implementation details change.
>
> On the other hand i915_pmu.h is a small header file, which does not 
> include _any_ other internal i915 headers (only uapi) and is always 
> present (if you ignore gens <= 2) which does not driver the allocate on 
> demand approach. In the past three years it had like seven edits.

It's really not about allocation on demand at all. It's about hiding the
implementation, using the mechanisms that C provides us for
abstractions, and reducing the header dependencies.

> Given all that, the change of direction you propose here sounds a bit 
> radical and I would rather not replace that increment with a function 
> call, when it is questionable if the same separation of components 
> approach can be, or will be, applied to the whole driver. Gut feeling 
> says it is bound to be hard and possibly not happen in which case I 
> don't see what is gained by churning on the tiny and quiet i915_pmu.h|c.

Yeah, the approach probably won't be applied to the whole driver anytime
soon. Maybe never. What matters to me though is that all of these set
the example. People look at drm_i915_private, and always just add a new
struct member, and never even stop to think if they could make it an
opaque pointer instead.

Heck, the same damn approach was copy-pasted to the xe driver, warts and
all.

Anyway.

All that said, I think I'm going to drop this, along with all
refactoring that isn't strictly related to display.

BR,
Jani.

-- 
Jani Nikula, Intel

  reply	other threads:[~2023-11-07 11:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-02 15:42 [Intel-gfx] [PATCH 0/5] drm/i915/pmu: hide struct i915_pmu Jani Nikula
2023-11-02 15:42 ` [Intel-gfx] [PATCH 1/5] drm/i915/pmu: report irqs to pmu code Jani Nikula
2023-11-02 15:42 ` [Intel-gfx] [PATCH 2/5] drm/i915/pmu: convert one more container_of() to event_to_pmu() Jani Nikula
2023-11-02 15:42 ` [Intel-gfx] [PATCH 3/5] drm/i915/pmu: change attr_group allocation and initialization Jani Nikula
2023-11-02 15:42 ` [Intel-gfx] [PATCH 4/5] drm/i915/pmu: hide struct i915_pmu inside i915_pmu.c Jani Nikula
2023-11-02 15:42 ` [Intel-gfx] [PATCH 5/5] drm/i915: add a number of explicit includes to avoid implicit ones Jani Nikula
2023-11-02 15:54 ` [Intel-gfx] [PATCH 0/5] drm/i915/pmu: hide struct i915_pmu Tvrtko Ursulin
2023-11-02 16:47   ` Jani Nikula
2023-11-03 11:06     ` Tvrtko Ursulin
2023-11-07 11:29       ` Jani Nikula [this message]
2023-11-02 23:23 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for " 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=871qd1ztr8.fsf@intel.com \
    --to=jani.nikula@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=tvrtko.ursulin@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.