All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: "Noralf Trønnes" <noralf@tronnes.org>
Cc: dri-devel@lists.freedesktop.org, David Airlie <airlied@linux.ie>,
	open list <linux-kernel@vger.kernel.org>,
	"open list:DRM DRIVER FOR QXL VIRTUAL GPU" 
	<virtualization@lists.linux-foundation.org>,
	"open list:DRM DRIVER FOR QXL VIRTUAL GPU" 
	<spice-devel@lists.freedesktop.org>,
	Dave Airlie <airlied@redhat.com>
Subject: Re: [PATCH v3 10/23] drm/qxl: move qxl_primary_apply_cursor to correct place
Date: Mon, 28 Jan 2019 09:10:05 +0100	[thread overview]
Message-ID: <20190128081005.j6z2ecnytuocfidh@sirius.home.kraxel.org> (raw)
In-Reply-To: <b3c756b3-c7b6-f4d3-5208-c8de0168d655@tronnes.org>

> > The cursor must be set again after creating the primary surface.
> > Also drop the error message.

> >  	if (!bo->is_primary) {
> > -		if (!same_shadow)
> > +		if (!same_shadow) {
> >  			qxl_io_create_primary(qdev, 0, bo);
> > +			qxl_primary_apply_cursor(plane);
> > +		}
> >  		bo->is_primary = true;
> >  	}
> >  
> > 
> 
> I don't see how the commit message matches what you're doing. It gives
> the impression that it must be applied under yet another condition, but
> the condition for applying the cursor is changed from bo_old->is_primary
> to !bo->is_primary.

The qxl device ties the cursor to the primary surface.  Therefore
calling qxl_io_destroy_primary() and qxl_io_create_primary() to switch
the framebuffer causes the cursor information being lost and the driver
must re-apply it.

The correct call order to do that is qxl_io_destroy_primary() +
qxl_io_create_primary() + qxl_primary_apply_cursor().

The old code did qxl_io_destroy_primary() + qxl_primary_apply_cursor() +
qxl_io_create_primary().  Due to qxl_primary_apply_cursor request being
queued in a ringbuffer and qxl_io_create_primary() trapping to the
hypervisor instantly there is a high chance that qxl_io_create_primary()
is processed first even with the wrong call order.  But it's racy and
thus not reliable.

> It probably makes sense to someone that knows the driver.

If the above explains things better to you I should probably replace the
commit message with that.

> Acked-by: Noralf Trønnes <noralf@tronnes.org>

thanks,
  Gerd


  reply	other threads:[~2019-01-28  8:10 UTC|newest]

Thread overview: 165+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-18 12:19 [PATCH v3 00/23] drm/qxl: ttm fixes, cleanups, allocation tweaks, multihead, fbdev Gerd Hoffmann
2019-01-18 12:19 ` [PATCH v3 01/23] drm/qxl: drop ttm_mem_reg arg from qxl_hw_surface_alloc() Gerd Hoffmann
2019-01-18 12:19   ` Gerd Hoffmann
2019-01-25 15:44   ` Noralf Trønnes
2019-01-25 15:44     ` Noralf Trønnes
2019-01-25 15:44   ` Noralf Trønnes
2019-01-18 12:19 ` Gerd Hoffmann
2019-01-18 12:19 ` [PATCH v3 02/23] drm/qxl: drop unused qxl_fb_virtual_address Gerd Hoffmann
2019-01-18 12:19   ` Gerd Hoffmann
2019-01-25 15:44   ` Noralf Trønnes
2019-01-25 15:44   ` Noralf Trønnes
2019-01-25 15:44     ` Noralf Trønnes
2019-01-18 12:19 ` Gerd Hoffmann
2019-01-18 12:20 ` [PATCH v3 03/23] drm/qxl: simplify slot management Gerd Hoffmann
2019-01-18 12:20   ` Gerd Hoffmann
2019-01-25 15:52   ` Noralf Trønnes
2019-01-25 15:52   ` Noralf Trønnes
2019-01-25 15:52     ` Noralf Trønnes
2019-01-18 12:20 ` Gerd Hoffmann
2019-01-18 12:20 ` [PATCH v3 04/23] drm/qxl: change the way slot is detected Gerd Hoffmann
2019-01-18 12:20   ` Gerd Hoffmann
2019-01-25 15:52   ` Noralf Trønnes
2019-01-25 15:52     ` Noralf Trønnes
2019-01-25 15:52   ` Noralf Trønnes
2019-01-18 12:20 ` [PATCH v3 05/23] drm/qxl: drop unused fields from struct qxl_device Gerd Hoffmann
2019-01-18 12:20 ` Gerd Hoffmann
2019-01-18 12:20   ` Gerd Hoffmann
2019-01-25 15:53   ` Noralf Trønnes
2019-01-25 15:53   ` Noralf Trønnes
2019-01-25 15:53     ` Noralf Trønnes
2019-01-18 12:20 ` [PATCH v3 06/23] drm/qxl: use separate offset spaces for the two slots / ttm memory types Gerd Hoffmann
2019-01-18 12:20   ` Gerd Hoffmann
2019-01-25 15:57   ` Noralf Trønnes
2019-01-25 15:57     ` Noralf Trønnes
2019-01-25 15:57   ` Noralf Trønnes
2019-01-18 12:20 ` Gerd Hoffmann
2019-01-18 12:20 ` [PATCH v3 07/23] drm/qxl: allow both PRIV and VRAM placement for QXL_GEM_DOMAIN_SURFACE Gerd Hoffmann
2019-01-18 12:20   ` Gerd Hoffmann
2019-01-25 15:58   ` Noralf Trønnes
2019-01-25 15:58   ` Noralf Trønnes
2019-01-25 15:58     ` Noralf Trønnes
2019-01-18 12:20 ` Gerd Hoffmann
2019-01-18 12:20 ` [PATCH v3 08/23] drm/qxl: use QXL_GEM_DOMAIN_SURFACE for shadow bo Gerd Hoffmann
2019-01-18 12:20 ` Gerd Hoffmann
2019-01-18 12:20   ` Gerd Hoffmann
2019-01-25 15:58   ` Noralf Trønnes
2019-01-25 15:58   ` Noralf Trønnes
2019-01-25 15:58     ` Noralf Trønnes
2019-01-18 12:20 ` [PATCH v3 09/23] drm/qxl: use QXL_GEM_DOMAIN_SURFACE for dumb gem objects Gerd Hoffmann
2019-01-18 12:20   ` Gerd Hoffmann
2019-01-25 15:59   ` Noralf Trønnes
2019-01-25 15:59     ` Noralf Trønnes
2019-01-25 15:59   ` Noralf Trønnes
2019-01-18 12:20 ` Gerd Hoffmann
2019-01-18 12:20 ` [PATCH v3 10/23] drm/qxl: move qxl_primary_apply_cursor to correct place Gerd Hoffmann
2019-01-18 12:20   ` Gerd Hoffmann
2019-01-25 16:09   ` Noralf Trønnes
2019-01-25 16:09     ` Noralf Trønnes
2019-01-28  8:10     ` Gerd Hoffmann [this message]
2019-01-28  8:10       ` Gerd Hoffmann
2019-01-28 10:38       ` Noralf Trønnes
2019-01-28 10:38       ` Noralf Trønnes
2019-01-28 10:38         ` Noralf Trønnes
2019-01-28 11:40         ` Gerd Hoffmann
2019-01-28 11:40           ` Gerd Hoffmann
2019-01-28 11:40         ` Gerd Hoffmann
2019-01-28  8:10     ` Gerd Hoffmann
2019-01-25 16:09   ` Noralf Trønnes
2019-01-18 12:20 ` Gerd Hoffmann
2019-01-18 12:20 ` [PATCH v3 11/23] drm/qxl: drop unused offset parameter from qxl_io_create_primary() Gerd Hoffmann
2019-01-18 12:20   ` Gerd Hoffmann
2019-01-25 16:10   ` Noralf Trønnes
2019-01-25 16:10   ` Noralf Trønnes
2019-01-25 16:10     ` Noralf Trønnes
2019-01-18 12:20 ` Gerd Hoffmann
2019-01-18 12:20 ` [PATCH v3 12/23] drm/qxl: track primary bo Gerd Hoffmann
2019-01-18 12:20 ` Gerd Hoffmann
2019-01-18 12:20   ` Gerd Hoffmann
2019-01-25 16:11   ` Noralf Trønnes
2019-01-25 16:11     ` Noralf Trønnes
2019-01-25 16:11   ` Noralf Trønnes
2019-01-18 12:20 ` [PATCH v3 13/23] drm/qxl: use shadow bo directly Gerd Hoffmann
2019-01-18 12:20   ` Gerd Hoffmann
2019-01-25 16:59   ` Noralf Trønnes
2019-01-25 16:59   ` Noralf Trønnes
2019-01-25 16:59     ` Noralf Trønnes
2019-01-18 12:20 ` Gerd Hoffmann
2019-01-18 12:20 ` [PATCH v3 14/23] drm/qxl: cover all crtcs in shadow bo Gerd Hoffmann
2019-01-18 12:20   ` Gerd Hoffmann
2019-01-25 17:08   ` Noralf Trønnes
2019-01-25 17:08   ` Noralf Trønnes
2019-01-25 17:08     ` Noralf Trønnes
2019-01-18 12:20 ` Gerd Hoffmann
2019-01-18 12:20 ` [PATCH v3 15/23] drm/qxl: use qxl_num_crtc directly Gerd Hoffmann
2019-01-18 12:20   ` Gerd Hoffmann
2019-01-25 17:12   ` Noralf Trønnes
2019-01-25 17:12     ` Noralf Trønnes
2019-01-25 17:12   ` Noralf Trønnes
2019-01-18 12:20 ` Gerd Hoffmann
2019-01-18 12:20 ` [PATCH v3 16/23] drm/qxl: implement prime kmap/kunmap Gerd Hoffmann
2019-01-18 12:20 ` Gerd Hoffmann
2019-01-18 12:20   ` Gerd Hoffmann
2019-01-25 17:19   ` Noralf Trønnes
2019-01-25 17:19     ` Noralf Trønnes
2019-01-25 17:19   ` Noralf Trønnes
2019-01-18 12:20 ` [PATCH v3 17/23] drm/qxl: use generic fbdev emulation Gerd Hoffmann
2019-01-18 12:20   ` Gerd Hoffmann
2019-01-25 17:25   ` Noralf Trønnes
2019-01-25 17:25     ` Noralf Trønnes
2019-01-28  8:59     ` Gerd Hoffmann
2019-01-28  8:59     ` Gerd Hoffmann
2019-01-28  8:59       ` Gerd Hoffmann
2019-01-28 10:39       ` Noralf Trønnes
2019-01-28 10:39         ` Noralf Trønnes
2019-01-28 10:39       ` Noralf Trønnes
2019-01-25 17:25   ` Noralf Trønnes
2019-01-18 12:20 ` Gerd Hoffmann
2019-01-18 12:20 ` [PATCH v3 18/23] drm/qxl: remove dead qxl fbdev emulation code Gerd Hoffmann
2019-01-18 12:20   ` Gerd Hoffmann
2019-01-25 17:25   ` Noralf Trønnes
2019-01-25 17:25     ` Noralf Trønnes
2019-01-25 18:10     ` Sam Ravnborg
2019-01-25 18:10     ` Sam Ravnborg
2019-01-25 18:10       ` Sam Ravnborg
2019-01-25 18:44       ` Noralf Trønnes
2019-01-25 18:44         ` Noralf Trønnes
2019-01-25 18:44       ` Noralf Trønnes
2019-01-25 17:25   ` Noralf Trønnes
2019-01-18 12:20 ` Gerd Hoffmann
2019-01-18 12:20 ` [PATCH v3 19/23] drm/qxl: implement qxl_gem_prime_(un)pin Gerd Hoffmann
2019-01-18 12:20   ` Gerd Hoffmann
2019-01-25 17:26   ` Noralf Trønnes
2019-01-25 17:26   ` Noralf Trønnes
2019-01-25 17:26     ` Noralf Trønnes
2019-01-18 12:20 ` Gerd Hoffmann
2019-01-18 12:20 ` [PATCH v3 20/23] drm/qxl: add mode/framebuffer check functions Gerd Hoffmann
2019-01-18 12:20 ` Gerd Hoffmann
2019-01-18 12:20   ` Gerd Hoffmann
2019-01-25 17:30   ` Noralf Trønnes
2019-01-25 17:30   ` Noralf Trønnes
2019-01-25 17:30     ` Noralf Trønnes
2019-01-18 12:20 ` [PATCH v3 21/23] drm/qxl: add qxl_add_mode helper function Gerd Hoffmann
2019-01-18 12:20   ` Gerd Hoffmann
2019-01-25 17:34   ` Noralf Trønnes
2019-01-25 17:34   ` Noralf Trønnes
2019-01-25 17:34     ` Noralf Trønnes
2019-01-18 12:20 ` Gerd Hoffmann
2019-01-18 12:20 ` [PATCH v3 22/23] drm/qxl: use kernel mode db Gerd Hoffmann
2019-01-18 12:20   ` Gerd Hoffmann
2019-01-25 17:35   ` Noralf Trønnes
2019-01-25 17:35     ` Noralf Trønnes
2019-01-25 17:35   ` Noralf Trønnes
2019-01-18 12:20 ` Gerd Hoffmann
2019-01-18 12:20 ` [PATCH v3 23/23] drm/qxl: add overflow checks to qxl_mode_dumb_create() Gerd Hoffmann
2019-01-18 12:20 ` Gerd Hoffmann
2019-01-18 12:20   ` Gerd Hoffmann
2019-01-18 15:49   ` Daniel Vetter
2019-01-18 15:49   ` Daniel Vetter
2019-01-18 15:49     ` Daniel Vetter
2019-01-18 16:32     ` Ville Syrjälä
2019-01-18 16:32     ` Ville Syrjälä
2019-01-18 16:32       ` Ville Syrjälä
2019-01-18 17:15       ` Daniel Vetter
2019-01-18 17:15         ` Daniel Vetter
2019-01-18 17:15       ` Daniel Vetter

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=20190128081005.j6z2ecnytuocfidh@sirius.home.kraxel.org \
    --to=kraxel@redhat.com \
    --cc=airlied@linux.ie \
    --cc=airlied@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=noralf@tronnes.org \
    --cc=spice-devel@lists.freedesktop.org \
    --cc=virtualization@lists.linux-foundation.org \
    /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.