From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/5] DRM: Armada: Add support for ARGB 32x64 or 64x32 hardware cursors
Date: Mon, 7 Oct 2013 13:50:34 +0100 [thread overview]
Message-ID: <20131007125034.GO12758@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <20131007152915.352cc4b2@i7>
On Mon, Oct 07, 2013 at 03:29:15PM +0300, Siarhei Siamashka wrote:
> On Mon, 7 Oct 2013 11:32:50 +0100
> Russell King - ARM Linux <linux@arm.linux.org.uk> wrote:
> > However, what you're suggesting is dangerous. What do you do when you're
> > presented with a cursor which is 64x64 ? Do you:
> >
> > (a) not display it
> > (b) crash the X server
> >
> > There isn't a fallback to using software cursors available in the X server
> > because there's no error reporting for a failed hardware cursor update.
>
> Hmm, maybe I'm missing something, but doesn't returning FALSE from
> UseHWCursorARGB just make the X server fallback to using a software
> cursor?
>
> https://github.com/ssvb/xf86-video-fbturbo/blob/689c08256555/src/sunxi_disp_hwcursor.c#L72
>
> I'm just doing this. And also have hooks to notify the DRI2 code about
> the status of the cursor. In the case if the hardware cursor is not
> enabled, hardware overlays can't be safely used with the software
> cursor and we need to fallback to CPU/GPU copy instead of zero-copy
> buffers swapping.
>
> And I fully agree that it is the responsibility of the kernel to expose
> as much of the hardware capabilities as possible (without compromising
> reliability and/or security).
If you wish to go in below the level presented by
hw/xfree86/modes/xf86Cursors.c (as you are doing), then yes you can do
this, and it's something which maybe should be looked into. You have a
good reason to do this (due to your hardware cursor being incompatible
with overlays).
We have no such restriction - the only issue here is the "odd" size of
cursors. Practically, choosing one or other of 64x32 or 32x64 works
fine for the cases I've seen. I haven't seen any cursors which are
64x64 yet. I'm not saying they don't exist though! I can imagine that
some accessibility options might want to display a large cursor.
Now, the way I handle this is that the kernel allows _either_ a
(1 to 32)x(1 to 64) or (1 to 64)x(1 to 32) cursor. Both width and
height larger than 32 gets rejected with -EINVAL:
+ /* maximum size is 64x32 or 32x64 */
+ if (w > 64 || h > 64 || (w > 32 && h > 32))
+ return -ENOMEM;
which is quite reasonable for this hardware. However, there is no way
to export this from DRM - adding maximum cursor size properties wouldn't
really represent this.
The only question is whether DRM should export some capabilities to
indicate what's possible with the cursor, so that X knows about this
quirk of this hardware. Overall, I suspect that it's just rare and
not worth the effort. I think it's just easier to pick one of these
and stick with it, and if we happen to encounter a cursor larger than
our chosen dimentions, XFree86 will already automatically fall back
to s/w cursor.
next prev parent reply other threads:[~2013-10-07 12:50 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-06 22:07 [PATCH 0/5] Armada DRM stuff Russell King - ARM Linux
2013-10-06 22:07 ` [PATCH 1/5] drm/i2c: tda998x: set VIF for full range, underscanned display Russell King
2013-10-07 8:59 ` Jean-Francois Moine
2013-10-18 15:00 ` Rob Clark
2013-10-06 22:08 ` [PATCH 2/5] DRM: Armada: Add Armada DRM driver Russell King
2013-10-10 21:25 ` Rob Clark
2013-10-10 21:59 ` Russell King - ARM Linux
2013-10-10 22:23 ` Rob Clark
2013-10-10 22:53 ` Russell King - ARM Linux
2013-10-11 0:10 ` Rob Clark
2013-10-06 22:09 ` [PATCH 3/5] DRM: Armada: Add support for ARGB 32x64 or 64x32 hardware cursors Russell King
2013-10-07 9:01 ` Jean-Francois Moine
2013-10-07 9:40 ` Russell King - ARM Linux
2013-10-07 10:09 ` Jean-Francois Moine
2013-10-07 10:32 ` Russell King - ARM Linux
2013-10-07 12:29 ` Siarhei Siamashka
2013-10-07 12:50 ` Russell King - ARM Linux [this message]
2013-10-17 23:58 ` Rob Clark
2013-10-18 14:31 ` Alex Deucher
2013-10-06 22:10 ` [PATCH 4/5] DRM: Armada: start of MMP2/MMP3 support Russell King
2013-10-18 0:11 ` Rob Clark
2013-10-06 22:11 ` [PATCH 5/5] DRM: Armada: add support for drm tda19988 driver Russell King
2013-10-07 9:18 ` Jean-Francois Moine
2013-10-07 9:44 ` Russell King - ARM Linux
2013-10-07 10:48 ` Jean-Francois Moine
2013-10-07 11:09 ` Russell King - ARM Linux
2013-10-07 11:29 ` Sebastian Hesselbarth
2013-10-07 15:53 ` Mark Brown
2013-10-07 16:08 ` Sebastian Hesselbarth
2013-10-07 17:05 ` Mark Brown
2013-10-07 12:03 ` Jean-Francois Moine
2013-10-07 12:36 ` Russell King - ARM Linux
2013-10-07 14:59 ` Rob Clark
2013-10-08 9:19 ` Jean-Francois Moine
2013-10-08 9:49 ` Russell King - ARM Linux
2013-10-08 15:34 ` Jean-Francois Moine
2013-10-18 0:20 ` Rob Clark
2013-10-08 12:07 ` Rob Clark
2013-10-07 21:47 ` [PATCH 0/5] Armada DRM stuff Sebastian Hesselbarth
2013-10-09 14:31 ` Russell King - ARM Linux
2013-10-09 14:48 ` Rob Clark
2013-10-18 15:15 ` [GIT PULL] Armada DRM support Russell King - ARM Linux
2013-10-22 13:36 ` Russell King - ARM Linux
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=20131007125034.GO12758@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).