All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: Max Reitz <mreitz@redhat.com>
Cc: qemu-devel@nongnu.org, Anthony Liguori <aliguori@amazon.com>
Subject: Re: [Qemu-devel] [PATCH 2/4] console: add opengl rendering helper functions
Date: Fri, 16 Jan 2015 10:21:17 +0100	[thread overview]
Message-ID: <1421400077.21318.31.camel@nilsson.home.kraxel.org> (raw)
In-Reply-To: <54B8270A.8050007@redhat.com>

  Hi,

> > +bool console_gl_check_format(DisplayChangeListener *dcl,
> > +                             pixman_format_code_t format)
> > +{
> > +    switch (format) {
> > +    case PIXMAN_x8r8g8b8:
> > +    case PIXMAN_a8r8g8b8:
> > +    case PIXMAN_r5g6b5:
> > +        return true;
> > +    default:
> > +        return false;
> > +    }
> > +}
> 
> What is this function supposed to be used for?

Inflight change, there is a patch series on the list adding a
check_format callback to DisplayChangeListenerOps, for format
negotiation.

> > +
> > +void surface_gl_create_texture(DisplaySurface *surface)
> > +{
> > +    switch (surface->format) {
> > +    case PIXMAN_x8r8g8b8:
> > +    case PIXMAN_a8r8g8b8:
> > +        surface->glformat = GL_BGRA;
> 
> Why does the format code seem to imply ARGB order but you're using the 
> exact opposite? I could imagine something like endianness being the 
> reason, but you're using RGB below where the format code says exactly that.

endianness indeed.  pixman formats are native endian, so this actually
is bgra ordering in memory.  While looking at it:  I guess GL_BGRA is
fixed byte ordering?  So this probably needs fixing to work correctly on
bigendian machines ...

> Discarding the alpha channel is intentional, I suppose?

Yes.

> 
> > +                 surface_width(surface),
> > +                 surface_height(surface),
> > +                 0, surface->glformat, surface->gltype,
> > +                 surface_data(surface));
> 
> Is surface_stride(surface) specified to be surface_width(surface) * 
> bytes_per_pixel (I don't know pixman so I don't know)?

Usually this is the case, but there can be exceptions.  Hmm, can I
explicitly pass the stride?

thanks,
  Gerd

  reply	other threads:[~2015-01-16  9:21 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-12 12:35 [Qemu-devel] [PATCH 0/4] sdl2: add opengl rendering support Gerd Hoffmann
2015-01-12 12:35 ` [Qemu-devel] [PATCH 1/4] configure: opengl overhaul Gerd Hoffmann
2015-01-12 12:55   ` Paolo Bonzini
2015-01-12 13:11     ` Gerd Hoffmann
2015-01-15 19:55   ` Max Reitz
2015-01-16  9:11     ` Gerd Hoffmann
2015-01-12 12:35 ` [Qemu-devel] [PATCH 2/4] console: add opengl rendering helper functions Gerd Hoffmann
2015-01-12 13:04   ` Paolo Bonzini
2015-01-12 13:13     ` Gerd Hoffmann
2015-01-15 20:46   ` Max Reitz
2015-01-16  9:21     ` Gerd Hoffmann [this message]
2015-01-16 15:05       ` Max Reitz
2015-01-12 12:35 ` [Qemu-devel] [PATCH 3/4] sdl2: add support for display rendering using opengl Gerd Hoffmann
2015-01-15 22:14   ` Max Reitz
2015-01-12 12:35 ` [Qemu-devel] [PATCH 4/4] sdl2: move SDL_* includes to sdl2.h Gerd Hoffmann
2015-01-15 22:21   ` Max Reitz

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=1421400077.21318.31.camel@nilsson.home.kraxel.org \
    --to=kraxel@redhat.com \
    --cc=aliguori@amazon.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-devel@nongnu.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.