From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?Michel_D=c3=a4nzer?= Subject: Re: [PATCH v2] drm: support hotspot for universal plane cursors Date: Wed, 18 Nov 2015 17:59:19 +0900 Message-ID: <564C3DE7.3040502@daenzer.net> References: <1447762218-11017-1-git-send-email-john@metanate.com> <1447772734-6480-1-git-send-email-john@metanate.com> <20151117153932.GU4437@intel.com> <20151117155943.1e83b053.john@metanate.com> <20151117162935.GK16848@phenom.ffwll.local> <564C394B.8070408@daenzer.net> <20151118085151.GB20799@phenom.ffwll.local> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Return-path: Received: from mail.gna.ch (darkcity.gna.ch [195.226.6.51]) by gabe.freedesktop.org (Postfix) with ESMTP id 7A5F16E644 for ; Wed, 18 Nov 2015 00:59:24 -0800 (PST) In-Reply-To: <20151118085151.GB20799@phenom.ffwll.local> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: John Keeping , =?UTF-8?B?VmlsbGUgU3lyasOkbMOk?= , Alex Deucher , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org T24gMTguMTEuMjAxNSAxNzo1MSwgRGFuaWVsIFZldHRlciB3cm90ZToKPiBPbiBXZWQsIE5vdiAx OCwgMjAxNSBhdCAwNTozOTozOVBNICswOTAwLCBNaWNoZWwgRMOkbnplciB3cm90ZToKPj4gT24g MTguMTEuMjAxNSAwMToyOSwgRGFuaWVsIFZldHRlciB3cm90ZToKPj4+Cj4+PiBBbmQgbm8sIEkg aGF2ZSBhYnNvbHV0ZWx5IG5vIGlkZWEgd2h5IHJhZGVvbiBpcyBwdWxsaW5nIHNvbWUgdHJpY2tz IGhlcmUsCj4+PiB3aGljaCBoYXZlIGJlZW4gYWRkZWQgaW4KPj4+Cj4+PiBjb21taXQgNzhiMWE2 MDEwYjQ2YTY5Y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: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933016AbbKRI7a (ORCPT ); Wed, 18 Nov 2015 03:59:30 -0500 Received: from darkcity.gna.ch ([195.226.6.51]:39598 "EHLO mail.gna.ch" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932845AbbKRI7Z (ORCPT ); Wed, 18 Nov 2015 03:59:25 -0500 Subject: Re: [PATCH v2] drm: support hotspot for universal plane cursors To: John Keeping , =?UTF-8?B?VmlsbGUgU3lyasOkbMOk?= , Alex Deucher , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org References: <1447762218-11017-1-git-send-email-john@metanate.com> <1447772734-6480-1-git-send-email-john@metanate.com> <20151117153932.GU4437@intel.com> <20151117155943.1e83b053.john@metanate.com> <20151117162935.GK16848@phenom.ffwll.local> <564C394B.8070408@daenzer.net> <20151118085151.GB20799@phenom.ffwll.local> From: =?UTF-8?Q?Michel_D=c3=a4nzer?= X-Enigmail-Draft-Status: N1110 Message-ID: <564C3DE7.3040502@daenzer.net> Date: Wed, 18 Nov 2015 17:59:19 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.3.0 MIME-Version: 1.0 In-Reply-To: <20151118085151.GB20799@phenom.ffwll.local> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 18.11.2015 17:51, Daniel Vetter wrote: > On Wed, Nov 18, 2015 at 05:39:39PM +0900, Michel Dänzer wrote: >> On 18.11.2015 01:29, Daniel Vetter wrote: >>> >>> And no, I have absolutely no idea why radeon is pulling some tricks here, >>> which have been added in >>> >>> commit 78b1a6010b46a69bcd47b723a80f92693f26d17b >>> Author: Michel Dänzer >>> Date: Tue Nov 18 18:00:08 2014 +0900 >>> >>> drm/radeon: Use cursor_set2 hook for enabling / disabling the HW cursor >>> >>> Michel/Alex, can you please shed some light onto this? >> >> As described in the rest of the commit log, the intention was to avoid >> the cursor intermittently appearing in the wrong location with existing >> userspace which sets the cursor BO in one ioctl call and the new >> position in another ioctl call. >> >> >>> radeon is the only driver doing this, making this interface inconsistent. >> >> It's only inconsistent in the case that userspace updates the cursor >> position to account for the new hotspot position in one ioctl call >> first, and only then sets the new BO in another ioctl call. In all other >> cases, the cursor position passed in by userspace is preserved. >> >> Anyway, in the meantime it has become apparent that this change didn't >> fully fix the problem, so feel free to revert it. > > Yeah I read the commit message but didn't understand what it's doing. > After some discussion with Alex on irc I realized that the fixup is only > applied in when updating the cursor bo and changing the hotspot to avoid > that kind of flickering. That problem is solved though on the kernel side > with universal planes (where we don't artificially split up the cursor > update into a move + bo-update for the driver interface any more). And > it's fixable in userspace even with legacy cursor interfaces since the > ioctl allows you to move + update at the same time too. It's just that X > doesn't provide that interface to the driver in a useful way. Well, the legacy cursor interfaces currently don't allow the driver to prevent the hardware from updating the cursor between the cursor_set / cursor_move calls. Anyway, I tried adding a cursor_lock hook for that purpose and adapting userspace accordingly, but it still doesn't seem to fully fix the problem. So I'm leaving it to somebody else / another day. :) -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer