Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1628238

Re: [PATCH] drm: fourcc byteorder: brings header file comments in line with reality.

From Gerd Hoffmann <kraxel@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH] drm: fourcc byteorder: brings header file comments in line with reality.
Date 2017-04-21 15:20 +0200
Message-ID <tyGDE-6gr-5@gated-at.bofh.it> (permalink)
References <tyBDY-39t-21@gated-at.bofh.it> <tyD34-45V-21@gated-at.bofh.it> <tyDw5-4fF-9@gated-at.bofh.it> <tyEBQ-55T-21@gated-at.bofh.it> <tyGDE-6gr-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


  Hi,

> > "native" to me feels more like "native to the GPU" since these things
> > really are tied to the GPU not the CPU. That's also why I went with the
> > explicit endianness originally so that the driver could properly declare
> > what the GPU supports.
> And to be honest I would really prefer to stick with that approach for 
> exactly that reason.
> 
> The proposed change would require that drivers have different code path 
> for different CPU byte order. Those code path tend to be not tested very 
> well and are additional complexity we probably don't want inside the driver.

We can add fixed-endian #defines without too much effort, at least for
the 8 bits per color formats.  In qemu we have the same problem, only
with pixman.  Those formats are native endian too, but often we have to
handle a fixed format, so we did this:

/*
 * pixman image formats are defined to be native endian,
 * that means host byte order on qemu.  So we go define
 * fixed formats here for cases where it is needed, like
 * feeding libjpeg / libpng and writing screenshots.
 */

#ifdef HOST_WORDS_BIGENDIAN
# define PIXMAN_BE_r8g8b8     PIXMAN_r8g8b8
# define PIXMAN_BE_x8r8g8b8   PIXMAN_x8r8g8b8
# define PIXMAN_BE_a8r8g8b8   PIXMAN_a8r8g8b8
# define PIXMAN_BE_b8g8r8x8   PIXMAN_b8g8r8x8
# define PIXMAN_BE_b8g8r8a8   PIXMAN_b8g8r8a8
# define PIXMAN_BE_r8g8b8x8   PIXMAN_r8g8b8x8
# define PIXMAN_BE_r8g8b8a8   PIXMAN_r8g8b8a8
# define PIXMAN_BE_x8b8g8r8   PIXMAN_x8b8g8r8
# define PIXMAN_BE_a8b8g8r8   PIXMAN_a8b8g8r8
# define PIXMAN_LE_x8r8g8b8   PIXMAN_b8g8r8x8
#else
# define PIXMAN_BE_r8g8b8     PIXMAN_b8g8r8
# define PIXMAN_BE_x8r8g8b8   PIXMAN_b8g8r8x8
# define PIXMAN_BE_a8r8g8b8   PIXMAN_b8g8r8a8
# define PIXMAN_BE_b8g8r8x8   PIXMAN_x8r8g8b8
# define PIXMAN_BE_b8g8r8a8   PIXMAN_a8r8g8b8
# define PIXMAN_BE_r8g8b8x8   PIXMAN_x8b8g8r8
# define PIXMAN_BE_r8g8b8a8   PIXMAN_a8b8g8r8
# define PIXMAN_BE_x8b8g8r8   PIXMAN_r8g8b8x8
# define PIXMAN_BE_a8b8g8r8   PIXMAN_r8g8b8a8
# define PIXMAN_LE_x8r8g8b8   PIXMAN_x8r8g8b8
#endif

> My personal opinion is that formats in drm_fourcc.h should be 
> independent of the CPU byte order and the function 
> drm_mode_legacy_fb_format() and drivers depending on that incorrect 
> assumption be fixed instead.

The problem is this isn't a kernel-internal thing any more.  With the
addition of the ADDFB2 ioctl the fourcc codes became part of the
kernel/userspace abi ...

cheers,
  Gerd

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] drm: fourcc byteorder: brings header file comments in line with reality. Gerd Hoffmann <kraxel@redhat.com> - 2017-04-21 10:00 +0200
  Re: [PATCH] drm: fourcc byteorder: brings header file comments in  line with reality. Pekka Paalanen <ppaalanen@gmail.com> - 2017-04-21 10:10 +0200
    Re: [PATCH] drm: fourcc byteorder: brings header file comments in  line with reality. Gerd Hoffmann <kraxel@redhat.com> - 2017-04-21 11:40 +0200
      Re: [PATCH] drm: fourcc byteorder: brings header file comments in  line with reality. Ville Syrjälä <ville.syrjala@linux.intel.com> - 2017-04-21 11:50 +0200
  Re: [PATCH] drm: fourcc byteorder: brings header file comments in  line with reality. Ville Syrjälä <ville.syrjala@linux.intel.com> - 2017-04-21 11:30 +0200
    Re: [PATCH] drm: fourcc byteorder: brings header file comments in  line with reality. Gerd Hoffmann <kraxel@redhat.com> - 2017-04-21 12:00 +0200
      Re: [PATCH] drm: fourcc byteorder: brings header file comments in  line with reality. Ville Syrjälä <ville.syrjala@linux.intel.com> - 2017-04-21 13:10 +0200
        Re: [PATCH] drm: fourcc byteorder: brings header file comments in  line with reality. Gerd Hoffmann <kraxel@redhat.com> - 2017-04-21 13:50 +0200
        Re: [PATCH] drm: fourcc byteorder: brings header file comments in  line with reality. Pekka Paalanen <ppaalanen@gmail.com> - 2017-04-21 13:50 +0200
          Re: [PATCH] drm: fourcc byteorder: brings header file comments in  line with reality. Ville Syrjälä <ville.syrjala@linux.intel.com> - 2017-04-21 13:50 +0200
        Re: [PATCH] drm: fourcc byteorder: brings header file comments in  line with reality. Gerd Hoffmann <kraxel@redhat.com> - 2017-04-21 15:20 +0200
          Re: [PATCH] drm: fourcc byteorder: brings header file comments in  line with reality. Christian König <deathsimple@vodafone.de> - 2017-04-21 15:30 +0200
          Re: [PATCH] drm: fourcc byteorder: brings header file comments in  line with reality. Gerd Hoffmann <kraxel@redhat.com> - 2017-04-21 23:40 +0200
            Re: [PATCH] drm: fourcc byteorder: brings header file comments in  line with reality. Ville Syrjälä <ville.syrjala@linux.intel.com> - 2017-04-22 12:10 +0200
              Re: [PATCH] drm: fourcc byteorder: brings header file comments in  line with reality. Gerd Hoffmann <kraxel@redhat.com> - 2017-04-23 00:00 +0200
              Re: [PATCH] drm: fourcc byteorder: brings header file comments in  line with reality. Michel Dänzer <michel@daenzer.net> - 2017-04-24 09:00 +0200
                Re: [PATCH] drm: fourcc byteorder: brings header file comments in  line with reality. Ville Syrjälä <ville.syrjala@linux.intel.com> - 2017-04-24 15:10 +0200
      Re: [PATCH] drm: fourcc byteorder: brings header file comments in  line with reality. Ville Syrjälä <ville.syrjala@linux.intel.com> - 2017-04-21 13:10 +0200
  Re: [PATCH] drm: fourcc byteorder: brings header file comments in  line with reality. Ilia Mirkin <imirkin@alum.mit.edu> - 2017-04-21 17:30 +0200
    Re: [PATCH] drm: fourcc byteorder: brings header file comments in  line with reality. Ville Syrjälä <ville.syrjala@linux.intel.com> - 2017-04-21 20:20 +0200
      Re: [PATCH] drm: fourcc byteorder: brings header file comments in  line with reality. Ilia Mirkin <imirkin@alum.mit.edu> - 2017-04-22 07:10 +0200
        Re: [PATCH] drm: fourcc byteorder: brings header file comments in  line with reality. Ville Syrjälä <ville.syrjala@linux.intel.com> - 2017-04-22 12:00 +0200
          Re: [PATCH] drm: fourcc byteorder: brings header file comments in  line with reality. Ilia Mirkin <imirkin@alum.mit.edu> - 2017-04-22 15:50 +0200
            Re: [PATCH] drm: fourcc byteorder: brings header file comments in  line with reality. Ilia Mirkin <imirkin@alum.mit.edu> - 2017-04-22 15:50 +0200
              Re: [PATCH] drm: fourcc byteorder: brings header file comments in  line with reality. Ilia Mirkin <imirkin@alum.mit.edu> - 2017-04-22 21:30 +0200
                Re: [PATCH] drm: fourcc byteorder: brings header file comments in  line with reality. Michel Dänzer <michel@daenzer.net> - 2017-04-24 08:40 +0200

csiph-web