From: Daniel Vetter <daniel@ffwll.ch>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: Rob Clark <robdclark@gmail.com>,
dri-devel@lists.freedesktop.org,
Rob Clark <robdclark@chromium.org>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] drm/vblank: Simplify drm_dev_has_vblank()
Date: Wed, 5 Apr 2023 10:10:15 +0200 [thread overview]
Message-ID: <ZC0s56+O0bsQPmpC@phenom.ffwll.local> (raw)
In-Reply-To: <ZCyP55f2CFQqtP0a@intel.com>
On Wed, Apr 05, 2023 at 12:00:23AM +0300, Ville Syrjälä wrote:
> On Tue, Apr 04, 2023 at 10:46:00PM +0200, Daniel Vetter wrote:
> > On Mon, Apr 03, 2023 at 09:07:35AM -0700, Rob Clark wrote:
> > > From: Rob Clark <robdclark@chromium.org>
> > >
> > > What does vblank have to do with num_crtcs? Well, this was technically
> > > correct, but you'd have to go look at where num_crtcs is initialized to
> > > understand why. Lets just replace it with the simpler and more obvious
> > > check.
> >
> > If you want to fix this, then I think the right fix is to rename num_crtcs
> > to be something like num_vblank_crtcs. It's a historical accident back
> > when vblanks without kms was a thing.
> >
> > Plan B is someone gets really busy and fixes up the entire vblank mess and
> > moves it into drm_crtc struct. Now that the dri1 drivers are gone we could
> > indeed do that.
>
> And easy first step could to simply wrap all the naked
> &dev->vblank[drm_crtc_index()] things into a function
> call with some cocci/etc. That way most of the vblank
> code doesn't need to care where that thing actually lives.
Yeah I think that might work out. Roughly:
- Wrap all the drm_vblank_crtc lookups
- Emebed it into drm_crtc, delete the drm_device->vblank array
- rename drm_device->num_crtc to something more meaningful maybe and move
into drm_modeset_config
The big holdup always was step 2 because we still had to care about legacy
drivers without drm_crtc, which meant you'd have to have two paths, which
was kinda really annoying.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
prev parent reply other threads:[~2023-04-05 8:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-03 16:07 [PATCH] drm/vblank: Simplify drm_dev_has_vblank() Rob Clark
2023-04-03 16:23 ` Ville Syrjälä
2023-04-03 16:28 ` Randy Dunlap
2023-04-04 20:46 ` Daniel Vetter
2023-04-04 21:00 ` Ville Syrjälä
2023-04-05 8:10 ` Daniel Vetter [this message]
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=ZC0s56+O0bsQPmpC@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=airlied@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=robdclark@chromium.org \
--cc=robdclark@gmail.com \
--cc=tzimmermann@suse.de \
--cc=ville.syrjala@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox