Nouveau Archive on lore.kernel.org
 help / color / Atom feed
From: Ilia Mirkin <imirkin@alum.mit.edu>
To: Alex Riesen <alexander.riesen@cetitec.com>,
	Simon Ser <contact@emersion.fr>
Cc: nouveau <nouveau@lists.freedesktop.org>,
	Ben Skeggs <bskeggs@redhat.com>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	Dave Airlie <airlied@redhat.com>
Subject: Re: [Nouveau] [PATCH 2/3] drm/nouveau/kms/nv50-: Report max cursor size to userspace
Date: Wed, 24 Feb 2021 10:10:57 -0500
Message-ID: <CAKb7UvgQXXThAfqJo+FEfUbgLtGzb2kvg9aSFXZn_XWivsv48Q@mail.gmail.com> (raw)
In-Reply-To: <YDYXiTm7MDXgYT7H@pflmari>

[+emersion, -various people and lists who definitely don't care]

On Wed, Feb 24, 2021 at 4:09 AM Alex Riesen
<alexander.riesen@cetitec.com> wrote:
>
> Ilia Mirkin, Tue, Feb 23, 2021 19:13:59 +0100:
> > On Tue, Feb 23, 2021 at 11:23 AM Alex Riesen <alexander.riesen@cetitec.com> wrote:
> > >
> > >     $ xrandr  --listproviders
> > >     Providers: number : 1
> > >     Provider 0: id: 0x68 cap: 0x7, Source Output, Sink Output, Source Offload crtcs: 4 outputs: 5 associated providers: 0 name:nouveau
> > >
> > > And yes, the cursor looks good in v5.11 even without reverting the commit.
> >
> > FWIW it's not immediately apparent to me what grave error modesetting
> > is committing in setting the cursor. The logic looks perfectly
> > reasonable. It's not trying to be fancy with rendering the cursor/etc.
> >
> > The one thing is that it's using drmModeSetCursor2 which sets the
> > hotspot at the same time. But internally inside nouveau I think it
> > should work out to the same thing. Perhaps setting the hotspot, or
> > something in that path, doesn't quite work for 256x256? [Again, no
> > clue what that might be.]
> >
> > It might also be worthwhile just testing if the 256x256 cursor works
> > quite the way one would want. If you're interested, grab libdrm,
> > there's a test called 'modetest', which has an option to enable a
> > moving cursor (-c iirc). It's hard-coded to 64x64, so you'll have to
> > modify it there too (and probably change the pattern from plain gray
> > to any one of the other ones).
>
> I am interested, so I did.
>
> If I start the test without X running, the sprite of 256x256 cursor always
> contained horizontal lines across it, both with commit reverted and vanilla
> v5.11. Similarly, the 64x64 cursor has no lines across it in both kernels.
>
> The test does not seem to work at all if there is an X server running (using
> modesetting driver): modetest complained about permission denied to set the
> mode, and just sits there, drawing nothing on the displays.
> So I could not run the test in the environment of original problem.
> Am I starting it correctly? Is the change in modetest.c correct?

Looks right. Although TBH I'd just start it on a single display (I
forgot you could even do multiple displays). You should be able to
start it with the X server running if you switch to a vt (and run it
as root). If you can't, that means the modesetting driver is
forgetting to do something in the LeaveVT function.

The fact that you're getting lines with modetest means there's
something wrong with 256x256. What if you do 128x128 -- does that work
OK?

Simon, you tested on a GK208, that has a slightly later display
controller than the GK104 -- can you try to reproduce Alex's results?
Perhaps there was a problem with the GK10x's and it starts working OK
with the GK110 disp.

I don't have any GK10x's in my posession (I have nearly every other
iteration of the display controller), but hopefully someone on the
nouveau team will be able to dig one up and reproduce.

Thanks for testing, Alex!

>
>     $ ./modetest -c |grep '^[0-9]\|preferred'
>     85  86      connected       LVDS-1          340x190         13      86
>       #0 1920x1080 60.01 1920 2010 2070 2226 1080 1086 1095 1142 152540 flags: phsync, nvsync; type: preferred, driver
>     87  89      connected       DP-1            470x300         18      88, 89
>       #0 1680x1050 59.88 1680 1728 1760 1840 1050 1053 1059 1080 119000 flags: phsync, nvsync; type: preferred, driver
>     90  0       disconnected    DP-2            0x0             0       91, 92
>     93  95      connected       DP-3            520x320         10      94, 95
>       #0 1920x1200 59.95 1920 1968 2000 2080 1200 1203 1209 1235 154000 flags: phsync, nvsync; type: preferred, driver
>     96  0       disconnected    VGA-1           0x0             0       97
>
>     $ ./modetest -s 85:1920x1080 -s 93:1920x1200 -s 87:1680x1050  -C
>     trying to open device 'i915'...failed
>     trying to open device 'amdgpu'...failed
>     trying to open device 'radeon'...failed
>     trying to open device 'nouveau'...done
>     setting mode 1920x1080-60.01Hz on connectors 85, crtc 50
>     starting cursor
>
>     cursor stopped
>
> This is the change on top of 1225171b (master):
>
> diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c
> index fc75383a..cdba7b4e 100644
> --- a/tests/modetest/modetest.c
> +++ b/tests/modetest/modetest.c
> @@ -1730,14 +1730,14 @@ static void set_cursors(struct device *dev, struct pipe_arg *pipes, unsigned int
>         int ret;
>
>         /* maybe make cursor width/height configurable some day */
> -       uint32_t cw = 64;
> -       uint32_t ch = 64;
> +       uint32_t cw = 256;
> +       uint32_t ch = 256;
>
>         /* create cursor bo.. just using PATTERN_PLAIN as it has
>          * translucent alpha
>          */
>         bo = bo_create(dev->fd, DRM_FORMAT_ARGB8888, cw, ch, handles, pitches,
> -                      offsets, UTIL_PATTERN_PLAIN);
> +                      offsets, UTIL_PATTERN_SMPTE);
>         if (bo == NULL)
>                 return;
>
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau

  reply index

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-19  1:54 [PATCH 1/3] drivers/nouveau/kms/nv50-: Reject format modifiers for cursor planes Lyude Paul
     [not found] ` <20210119015415.2511028-1-lyude-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2021-01-19  1:54   ` [PATCH 2/3] drm/nouveau/kms/nv50-: Report max cursor size to userspace Lyude Paul
     [not found]     ` <20210119015415.2511028-2-lyude-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2021-01-19 10:22       ` Simon Ser
2021-02-23 14:15     ` [Nouveau] " Alex Riesen
2021-02-23 14:56       ` Ilia Mirkin
2021-02-23 15:36         ` Alex Riesen
2021-02-23 15:46           ` Ilia Mirkin
2021-02-23 15:51             ` Alex Riesen
2021-02-23 16:22               ` Alex Riesen
2021-02-23 18:13                 ` Ilia Mirkin
2021-02-24  9:08                   ` Alex Riesen
2021-02-24 15:10                     ` Ilia Mirkin [this message]
2021-02-24 16:35                       ` Alex Riesen
2021-02-24 16:48                         ` Ilia Mirkin
2021-02-24 16:53                           ` Alex Riesen
2021-02-24 16:57                             ` Ilia Mirkin
2021-02-24 17:02                               ` Alex Riesen
2021-02-24 17:47                                 ` Ilia Mirkin
2021-02-27 12:28                                   ` Uwe Sauter
2021-02-27 21:26                                     ` Ilia Mirkin
2021-02-28 15:10                                       ` Uwe Sauter
2021-02-28 17:02                                         ` Ilia Mirkin
2021-02-28 17:59                                           ` Uwe Sauter
2021-02-28 19:10                                             ` Ilia Mirkin
2021-02-28 19:24                                               ` Uwe Sauter
2021-02-28 20:38                                                 ` Ilia Mirkin
2021-03-03 12:41                                       ` Alex Riesen
2021-03-03 13:12                                         ` Ilia Mirkin
2021-03-03 13:25                                           ` Uwe Sauter
2021-03-03 13:33                                             ` Ilia Mirkin
2021-03-03 17:02                                               ` Uwe Sauter
2021-03-03 17:11                                                 ` Lyude Paul
2021-03-03 16:51                                           ` Lyude Paul
2021-03-03 17:05                                             ` James Jones
2021-01-19  1:54   ` [PATCH 3/3] drm/nouveau/kms/nve4-nv138: Fix > 64x64 cursors Lyude Paul
2021-01-19 10:18   ` [PATCH 1/3] drivers/nouveau/kms/nv50-: Reject format modifiers for cursor planes Simon Ser
2021-01-19 15:50   ` Ville Syrjälä
2021-01-19 15:52   ` James Jones

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=CAKb7UvgQXXThAfqJo+FEfUbgLtGzb2kvg9aSFXZn_XWivsv48Q@mail.gmail.com \
    --to=imirkin@alum.mit.edu \
    --cc=airlied@redhat.com \
    --cc=alexander.riesen@cetitec.com \
    --cc=bskeggs@redhat.com \
    --cc=contact@emersion.fr \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=nouveau@lists.freedesktop.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

Nouveau Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/nouveau/0 nouveau/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 nouveau nouveau/ https://lore.kernel.org/nouveau \
		nouveau@lists.freedesktop.org
	public-inbox-index nouveau

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.freedesktop.lists.nouveau


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git