From: Melissa Wen <melissa.srw@gmail.com>
To: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Daniel Vetter <daniel.vetter@intel.com>,
Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>,
DRI Development <dri-devel@lists.freedesktop.org>,
Haneen Mohammed <hamohammed.sa@gmail.com>
Subject: Re: [PATCH 1/3] drm/vkms: Set preferred depth correctly
Date: Sat, 17 Oct 2020 05:39:40 -0300 [thread overview]
Message-ID: <20201017083940.xlq6g3visn2gojuu@smtp.gmail.com> (raw)
In-Reply-To: <CAKMK7uGm6tiQmn34PeJC=0r7NUmHpYtTbXVcOfDdQ=vwJiqMRw@mail.gmail.com>
On 10/16, Daniel Vetter wrote:
> On Fri, Oct 16, 2020 at 7:02 PM Melissa Wen <melissa.srw@gmail.com> wrote:
> >
> > On 10/16, Daniel Vetter wrote:
> > > On Fri, Oct 16, 2020 at 12:38 PM Simon Ser <contact@emersion.fr> wrote:
> > > >
> > > > > The only thing we support is xrgb8888.
> > > > >
> > > > > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> > > > > Cc: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
> > > > > Cc: Melissa Wen <melissa.srw@gmail.com>
> > > > > Cc: Haneen Mohammed <hamohammed.sa@gmail.com>
> > > > > Cc: Daniel Vetter <daniel@ffwll.ch>
> > > > > ---
> > > > > drivers/gpu/drm/vkms/vkms_drv.c | 2 +-
> > > > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > > > >
> > > > > diff --git a/drivers/gpu/drm/vkms/vkms_drv.c b/drivers/gpu/drm/vkms/vkms_drv.c
> > > > > index 726801ab44d4..eb4007443706 100644
> > > > > --- a/drivers/gpu/drm/vkms/vkms_drv.c
> > > > > +++ b/drivers/gpu/drm/vkms/vkms_drv.c
> > > > > @@ -124,7 +124,7 @@ static int vkms_modeset_init(struct vkms_device *vkmsdev)
> > > > > dev->mode_config.max_height = YRES_MAX;
> > > > > dev->mode_config.cursor_width = 512;
> > > > > dev->mode_config.cursor_height = 512;
> > > > > - dev->mode_config.preferred_depth = 24;
> > > > > + dev->mode_config.preferred_depth = 32;
> > > >
> > > > Are you sure xrgb8888's depth is 32 and not 24? Looking at drmdb [1], *all*
> > > > drivers set it to 24.
> > >
> > > Uh there's a problem I think. Depth should indeed stay at 24, the
> > > problem is that fb helpers directly take that to be the bpp parameter,
> > > which is a different thing. And if you look at how most drivers set up
> > > that, they pick 32.
> > >
> > > I guess I need to revert this here, and unconfuse the fb helpers about
> > > depth vs bpp.
> >
> > Hi guys,
> >
> > Perhaps it deserves to be pointed out: the documentation says
> > "preferred_depth: preferred RBG(sic) pixel depth, used by fb helpers",
> > and looking to fb helpers, preferred_depth is only used by
> > generic_setup, as bits by pixel (if I didn't miss something there).
> >
> > In fact, the alpha channel is not used for final display (perhaps in the
> > future); however, I saw another driver with a change similar to this
> > here and, possibly like me, following the same misunderstanding.
>
> Yeah the problem is that preferred_depth is depth, and that means 24
> bit for XRGB8888. But bpp as used by fb helpers would be 32 bit for
> XRGB8888.
>
> I think the real fix here is to switch this entire mess over to using
> drm_fourcc codes directly, at least for atomic drivers. Which nowadays
> are most. Interim I'm not sure whether we should revert my patch (it
> breaks fbdev) or switch preferred_depth to 0, which means we get the
> default every, and that means both fbdev helpers and userspace will
> pick XRGB8888.
hmm... but why not keep preferred_depth = 24 and pass 32 as the
preferred_bpp parameter of fbdev_generic_setup?
> -Daniel
>
> > Melissa
> > >
> > > Maybe best would be to just switch over to preferred drm_fourcc format
> > > code, or maybe just pick this up from the first format the primary
> > > plane supports.
> > >
> > > This is all getting slightly tricky and a lot more work :-/
> > > -Daniel
> > > --
> > > Daniel Vetter
> > > Software Engineer, Intel Corporation
> > > http://blog.ffwll.ch
>
>
>
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2020-10-17 8:39 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-09 23:21 [PATCH 1/3] drm/vkms: Set preferred depth correctly Daniel Vetter
2020-10-09 23:21 ` [PATCH 2/3] drm/vkms: Switch to shmem helpers Daniel Vetter
2020-10-12 10:59 ` Chris Wilson
2020-10-12 11:20 ` Thomas Zimmermann
2020-10-12 11:22 ` Thomas Zimmermann
2020-10-12 12:41 ` Melissa Wen
2020-10-13 11:10 ` [PATCH] " Daniel Vetter
2020-10-09 23:21 ` [PATCH 3/3] drm/vkms: fbdev emulation support Daniel Vetter
2020-10-12 11:24 ` Thomas Zimmermann
2020-10-12 12:40 ` Neil Armstrong
2020-10-12 14:23 ` Daniel Vetter
2020-10-13 6:14 ` Pekka Paalanen
2020-10-13 7:53 ` Daniel Vetter
2020-10-13 10:19 ` Pekka Paalanen
2020-10-13 11:03 ` Daniel Vetter
2020-10-16 10:10 ` Melissa Wen
2020-10-20 8:34 ` Daniel Vetter
2020-10-12 11:08 ` [PATCH 1/3] drm/vkms: Set preferred depth correctly Thomas Zimmermann
2020-10-12 12:59 ` Melissa Wen
2020-10-15 21:39 ` Daniel Vetter
2020-10-16 10:18 ` Melissa Wen
2020-10-16 10:38 ` Simon Ser
2020-10-16 11:35 ` Daniel Vetter
2020-10-16 17:02 ` Melissa Wen
2020-10-16 17:05 ` Daniel Vetter
2020-10-17 8:39 ` Melissa Wen [this message]
2020-10-17 15:23 ` Daniel Vetter
2020-10-27 10:13 ` Thomas Zimmermann
2020-10-27 10:18 ` 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=20201017083940.xlq6g3visn2gojuu@smtp.gmail.com \
--to=melissa.srw@gmail.com \
--cc=daniel.vetter@ffwll.ch \
--cc=daniel.vetter@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=hamohammed.sa@gmail.com \
--cc=rodrigosiqueiramelo@gmail.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;
as well as URLs for NNTP newsgroup(s).