All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Dave Airlie <airlied@gmail.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>,
	 Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
	 "Syrjala, Ville" <ville.syrjala@intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	 Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	Daniel Vetter <daniel.vetter@intel.com>
Subject: Re: [Intel-gfx] [PATCH 01/10] drm/i915: move display funcs into a display struct.
Date: Tue, 7 Sep 2021 10:14:51 +0200	[thread overview]
Message-ID: <CAKMK7uHeujMMWoo-AJuuksg7HBpQu0oqMEbgDHUx8_rDv2GDng@mail.gmail.com> (raw)
In-Reply-To: <CAPM=9ty4y9new=adp+cmKCP0fuGrMgJOCWGSV-nmzorN3nACKw@mail.gmail.com>

On Mon, Sep 6, 2021 at 9:45 PM Dave Airlie <airlied@gmail.com> wrote:
> On Mon, 6 Sept 2021 at 18:18, Jani Nikula <jani.nikula@linux.intel.com> wrote:
> > On Mon, 06 Sep 2021, Dave Airlie <airlied@gmail.com> wrote:
> > > From: Dave Airlie <airlied@redhat.com>
> > >
> > > This is the first step in an idea to refactor the display code
> > > into a bit more of a corner.
> >
> > So, do we want to make i915->display a pointer?
> >
> > If we do, and we're about to touch every place accessing the display
> > struct, we might just as well have:
> >
> > struct drm_i915_private {
> >         struct drm_i915_display _display;
> >         struct drm_i915_display *display;
> > };
> >
> > and initialize i915->display = &i915->_display, and make all access
> > happen via the pointer. If we want to allocate it dynamically at some
> > point, it'll be a *much* easier task.
> >
> > But the first question to figure out is whether we want to do that or
> > not.
>
> I think the advantage is that we can hide a lot more structs from the
> main struct,
> the disadvantage is additional pointer chasing, esp for the drm_device and other
> i915_priv members.

For display pointer chasing doesn't matter at all. Imo the case is
more what make sense as object hierarchy, and embedding vs pointer has
quite different meaning. We've discussed in the past that the split
into display/gem with branches seems to work ok-ish, but could
probably be improved a lot in code org. If we make display a lot more
a free-standing thing (i.e. pointer, not embedding) with a much more
clearer/cleaner api contract to other pieces, then maybe there's some
case to be made for all this churn.

The problem with all that is that we'd then essentially need to
backpointers everywhere in all display structures: One to the
drm_device provided by base structs, and the other to the i915_display
struct, which is what our code uses. This way display would stay
display. In a way this would then look similarly-ish to amdgpu's DC.

But I'm honestly not sure how much that would improve anything, and
whether it's worth all the churn to make drm/i915/display more
self-contained.
-Daniel

> Has anyone any non-anecdotal knowledge of how bad the latter problem
> actually is?
> Other drivers seem to do a lot of it and nobody has complained about it.
>
> I'm happy to move to a pointer for it all to be honest,
> Dave.



-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

  reply	other threads:[~2021-09-07  8:15 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-06  3:43 [Intel-gfx] [RFC PATCH 00/10] refactor display structs a little bit Dave Airlie
2021-09-06  3:43 ` [Intel-gfx] [PATCH 01/10] drm/i915: move display funcs into a display struct Dave Airlie
2021-09-06  8:18   ` Jani Nikula
2021-09-06 19:44     ` Dave Airlie
2021-09-07  8:14       ` Daniel Vetter [this message]
2021-09-07  9:52         ` Dave Airlie
2021-09-07 18:14           ` Ville Syrjälä
2021-09-08  1:05             ` Dave Airlie
2021-09-06  3:43 ` [Intel-gfx] [PATCH 02/10] drm/i915/display: move cdclk info into display Dave Airlie
2021-09-06  3:43 ` [Intel-gfx] [PATCH 03/10] drm/i915: move more pll/clocks into display struct Dave Airlie
2021-09-06  3:43 ` [Intel-gfx] [PATCH 04/10] drm/i915/display: move gmbus " Dave Airlie
2021-09-06  3:43 ` [Intel-gfx] [PATCH 05/10] drm/i915/display: move intel_dmc " Dave Airlie
2021-09-06  3:43 ` [Intel-gfx] [PATCH 06/10] drm/i915/display: move mipi_mmio_base to " Dave Airlie
2021-09-06  3:43 ` [Intel-gfx] [PATCH 07/10] drm/i915/display: move pps_mmio_base " Dave Airlie
2021-09-06  3:43 ` [Intel-gfx] [PATCH 08/10] drm/i915/drrs: just use some local vars to simplify drrs code Dave Airlie
2021-09-06  3:43 ` [Intel-gfx] [PATCH 09/10] drm/i915/display: move drrs into display struct Dave Airlie
2021-09-06  3:43 ` [Intel-gfx] [PATCH 10/10] drm/i915/display: move fbc " Dave Airlie
2021-09-06  4:21 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for refactor display structs a little bit Patchwork
2021-09-06  4:51 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-09-06  6:07 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " 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=CAKMK7uHeujMMWoo-AJuuksg7HBpQu0oqMEbgDHUx8_rDv2GDng@mail.gmail.com \
    --to=daniel@ffwll.ch \
    --cc=airlied@gmail.com \
    --cc=daniel.vetter@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=ville.syrjala@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.