From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Deepak Singh Rawat <drawat@vmware.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
"intel-gfx@lists.freedesktop.org"
<intel-gfx@lists.freedesktop.org>,
linux-graphics-maintainer <linux-graphics-maintainer@vmware.com>,
Thomas Hellstrom <thellstrom@vmware.com>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 2/7] drm/vmwgfx: Stop using plane->fb in vmw_kms_atomic_check_modeset()
Date: Thu, 5 Apr 2018 23:29:13 +0300 [thread overview]
Message-ID: <20180405202913.GN5453@intel.com> (raw)
In-Reply-To: <BN6PR05MB3106EECCC87BB444A7DE1611BABB0@BN6PR05MB3106.namprd05.prod.outlook.com>
On Thu, Apr 05, 2018 at 08:15:05PM +0000, Deepak Singh Rawat wrote:
>
> >
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > Instead of looking at plane->fb let's look at the proper new
> > plane state.
> >
> > Not that the code makes a ton of sense. It's only going through the
> > crtcs in the atomic state, so assuming not all of them are included
> > we're not even calculating the total bandwidth here. Also we're
> > not considering whether each crtc is actually enabled or not.
> >
> > Cc: Thomas Hellstrom <thellstrom@vmware.com>
> > Cc: Sinclair Yeh <syeh@vmware.com>
> > Cc: VMware Graphics <linux-graphics-maintainer@vmware.com>
> > Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> > drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 10 +++++++---
> > 1 file changed, 7 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
> > b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
> > index 6728c6247b4b..a2a796b4cc23 100644
> > --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
> > +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
> > @@ -1536,9 +1536,13 @@ vmw_kms_atomic_check_modeset(struct
> > drm_device *dev,
> > unsigned long requested_bb_mem = 0;
> >
> > if (dev_priv->active_display_unit ==
> > vmw_du_screen_target) {
> > - if (crtc->primary->fb) {
> > - int cpp = crtc->primary->fb->pitches[0] /
> > - crtc->primary->fb->width;
> > + struct drm_plane *plane = crtc->primary;
> > + struct drm_plane_state *plane_state;
> > +
> > + plane_state =
> > drm_atomic_get_new_plane_state(state, plane);
> > +
> > + if (plane_state && plane_state->fb) {
> > + int cpp = plane_state->fb->format->cpp[0];
>
> Hi Ville,
>
> Thanks for the patch, recently I have done some refactoring of this code area
> which is no yet sent to dri-devel. But the refactored code eliminated the need
> to look the fb
>
> https://cgit.freedesktop.org/mesa/vmwgfx/commit/?id=c54cdb6549b7d1c04ff61e639fc0e6de0dcc1ed6
Hmm. What's the timelike for landing that stuff?
A cursory glance tells me we should just change the current code with
s/cpp/4/ and it should still be fine?
BTW the drm_for_each_crtc(crtc, dev) loop in there doesn't look entirely
kosher. It's potentially going to access crtc->state w/o holding the lock.
>
> There is still some future work to be done in this area.
>
> >
> > requested_bb_mem += crtc->mode.hdisplay
> > * cpp *
> > crtc->mode.vdisplay;
> > --
> > 2.16.1
--
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2018-04-05 20:29 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-05 19:50 [PATCH 1/7] drm/arc: Stop consulting plane->fb Ville Syrjala
2018-04-05 19:50 ` [PATCH 2/7] drm/vmwgfx: Stop using plane->fb in vmw_kms_atomic_check_modeset() Ville Syrjala
2018-04-05 20:15 ` Deepak Singh Rawat
2018-04-05 20:29 ` Ville Syrjälä [this message]
2018-04-05 20:38 ` Deepak Singh Rawat
2018-04-05 19:50 ` [PATCH 3/7] drm/vmwgfx: Stop using plane->fb in vmw_kms_helper_dirty() Ville Syrjala
2018-04-05 20:15 ` Thomas Hellstrom
2018-04-05 20:26 ` Ville Syrjälä
2018-04-05 20:33 ` [PATCH v2 " Ville Syrjala
2018-04-06 8:51 ` [PATCH " kbuild test robot
2018-04-05 19:50 ` [PATCH 4/7] drm/vmwgfx: Stop using plane->fb in vmw_kms_update_implicit_fb() Ville Syrjala
2018-04-06 18:21 ` Deepak Singh Rawat
2018-04-05 19:50 ` [PATCH 5/7] drm/vmwgfx: Stop updating plane->fb Ville Syrjala
2018-04-06 19:14 ` Deepak Singh Rawat
2018-04-06 19:35 ` Ville Syrjälä
2018-05-11 15:54 ` Ville Syrjälä
2018-05-16 17:10 ` Deepak Singh Rawat
2018-04-05 19:50 ` [PATCH 6/7] drm/vmwgfx: Stop using plane->fb in atomic_enable() Ville Syrjala
2018-04-06 18:56 ` Deepak Singh Rawat
2018-04-05 19:50 ` [PATCH 7/7] drm/vmwgfx: Stop messing about with plane->fb/old_fb/crtc Ville Syrjala
2018-04-05 20:39 ` Daniel Vetter
2018-04-05 20:07 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/7] drm/arc: Stop consulting plane->fb Patchwork
2018-04-05 20:08 ` [PATCH 1/7] " Daniel Vetter
2018-04-05 20:19 ` Ville Syrjälä
2018-04-05 20:43 ` Daniel Vetter
2018-04-05 20:23 ` ✓ Fi.CI.BAT: success for series starting with [1/7] " Patchwork
2018-04-05 20:51 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/7] drm/arc: Stop consulting plane->fb (rev2) Patchwork
2018-04-05 21:06 ` ✓ Fi.CI.BAT: success " Patchwork
2018-04-05 22:14 ` ✓ Fi.CI.IGT: success for series starting with [1/7] drm/arc: Stop consulting plane->fb Patchwork
2018-04-05 22:50 ` ✗ Fi.CI.IGT: warning for series starting with [1/7] drm/arc: Stop consulting plane->fb (rev2) Patchwork
2018-04-06 5:58 ` Saarinen, Jani
2018-04-06 8:50 ` [PATCH 1/7] drm/arc: Stop consulting plane->fb Alexey Brodkin
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=20180405202913.GN5453@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=daniel.vetter@ffwll.ch \
--cc=drawat@vmware.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=linux-graphics-maintainer@vmware.com \
--cc=thellstrom@vmware.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