From: Keith Packard <keithp@keithp.com>
To: "Kristian Høgsberg" <hoegsberg@gmail.com>,
"Daniel Vetter" <daniel@ffwll.ch>
Cc: Linux Fbdev development list <linux-fbdev@vger.kernel.org>,
intel-gfx <intel-gfx@lists.freedesktop.org>,
dri-devel <dri-devel@lists.freedesktop.org>,
"linaro-mm-sig@lists.linaro.org" <linaro-mm-sig@lists.linaro.org>,
Mesa Dev <mesa-dev@lists.freedesktop.org>,
"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>
Subject: Re: [Intel-gfx] [Mesa-dev] [PATCH] dri3, i915, i965: Add __DRI_IMAGE_FOURCC_SARGB8888
Date: Fri, 22 Nov 2013 23:36:43 +0000 [thread overview]
Message-ID: <86siuovwj8.fsf@miki.keithp.com> (raw)
In-Reply-To: <20131122221213.GA3234@tokamak.local>
[-- Attachment #1: Type: text/plain, Size: 1653 bytes --]
Kristian Høgsberg <hoegsberg@gmail.com> writes:
> I already explained to Keith why we use different sets of format codes
> in the DRI interface, but it's always fun to slam other peoples code.
As we discussed, my complaint isn't so much about __DRI_IMAGE_FOURCC,
but the fact that the __DRIimage interfaces use *both*
__DRI_IMAGE_FOURCC and __DRI_IMAGE_FORMAT at different times.
Ok, here's a fine thing we can actually fix -- the pattern that mesa
uses all over the place in converting formats looks like this (not to
pick on anyone, it's repeated everywhere, this is just the first one I
found in gbm_dri.c):
static uint32_t
gbm_dri_to_gbm_format(uint32_t dri_format)
{
uint32_t ret = 0;
switch (dri_format) {
case __DRI_IMAGE_FORMAT_RGB565:
ret = GBM_FORMAT_RGB565;
break;
case __DRI_IMAGE_FORMAT_XRGB8888:
ret = GBM_FORMAT_XRGB8888;
break;
case __DRI_IMAGE_FORMAT_ARGB8888:
ret = GBM_FORMAT_ARGB8888;
break;
case __DRI_IMAGE_FORMAT_ABGR8888:
ret = GBM_FORMAT_ABGR8888;
break;
default:
ret = 0;
break;
}
return ret;
}
The problem here is that any unknown incoming formats get translated to
garbage (0) outgoing. With fourcc codes, there is the slight advantage
that 0 is never a legal value, but it sure would be nice to print a
warning or even abort if you get a format code you don't understand as
there's no way 0 is ever going to do what you want.
Anyone have a preference? Abort? Print an error? Silently continue to do
the wrong thing?
--
keith.packard@intel.com
[-- Attachment #2: Type: application/pgp-signature, Size: 827 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: Keith Packard <keithp@keithp.com>
To: "Kristian Høgsberg" <hoegsberg@gmail.com>,
"Daniel Vetter" <daniel@ffwll.ch>
Cc: Linux Fbdev development list <linux-fbdev@vger.kernel.org>,
intel-gfx <intel-gfx@lists.freedesktop.org>,
dri-devel <dri-devel@lists.freedesktop.org>,
"linaro-mm-sig@lists.linaro.org" <linaro-mm-sig@lists.linaro.org>,
Mesa Dev <mesa-dev@lists.freedesktop.org>,
"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>
Subject: Re: [Intel-gfx] [PATCH] dri3, i915, i965: Add __DRI_IMAGE_FOURCC_SARGB8888
Date: Fri, 22 Nov 2013 15:36:43 -0800 [thread overview]
Message-ID: <86siuovwj8.fsf@miki.keithp.com> (raw)
In-Reply-To: <20131122221213.GA3234@tokamak.local>
[-- Attachment #1.1: Type: text/plain, Size: 1653 bytes --]
Kristian Høgsberg <hoegsberg@gmail.com> writes:
> I already explained to Keith why we use different sets of format codes
> in the DRI interface, but it's always fun to slam other peoples code.
As we discussed, my complaint isn't so much about __DRI_IMAGE_FOURCC,
but the fact that the __DRIimage interfaces use *both*
__DRI_IMAGE_FOURCC and __DRI_IMAGE_FORMAT at different times.
Ok, here's a fine thing we can actually fix -- the pattern that mesa
uses all over the place in converting formats looks like this (not to
pick on anyone, it's repeated everywhere, this is just the first one I
found in gbm_dri.c):
static uint32_t
gbm_dri_to_gbm_format(uint32_t dri_format)
{
uint32_t ret = 0;
switch (dri_format) {
case __DRI_IMAGE_FORMAT_RGB565:
ret = GBM_FORMAT_RGB565;
break;
case __DRI_IMAGE_FORMAT_XRGB8888:
ret = GBM_FORMAT_XRGB8888;
break;
case __DRI_IMAGE_FORMAT_ARGB8888:
ret = GBM_FORMAT_ARGB8888;
break;
case __DRI_IMAGE_FORMAT_ABGR8888:
ret = GBM_FORMAT_ABGR8888;
break;
default:
ret = 0;
break;
}
return ret;
}
The problem here is that any unknown incoming formats get translated to
garbage (0) outgoing. With fourcc codes, there is the slight advantage
that 0 is never a legal value, but it sure would be nice to print a
warning or even abort if you get a format code you don't understand as
there's no way 0 is ever going to do what you want.
Anyone have a preference? Abort? Print an error? Silently continue to do
the wrong thing?
--
keith.packard@intel.com
[-- Attachment #1.2: Type: application/pgp-signature, Size: 827 bytes --]
[-- Attachment #2: Type: text/plain, Size: 156 bytes --]
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev
WARNING: multiple messages have this Message-ID (diff)
From: Keith Packard <keithp@keithp.com>
To: "Kristian Høgsberg" <hoegsberg@gmail.com>,
"Daniel Vetter" <daniel@ffwll.ch>
Cc: Linux Fbdev development list <linux-fbdev@vger.kernel.org>,
intel-gfx <intel-gfx@lists.freedesktop.org>,
dri-devel <dri-devel@lists.freedesktop.org>,
"linaro-mm-sig\@lists.linaro.org"
<linaro-mm-sig@lists.linaro.org>,
Mesa Dev <mesa-dev@lists.freedesktop.org>,
"linux-media\@vger.kernel.org" <linux-media@vger.kernel.org>
Subject: Re: [Intel-gfx] [Mesa-dev] [PATCH] dri3, i915, i965: Add __DRI_IMAGE_FOURCC_SARGB8888
Date: Fri, 22 Nov 2013 15:36:43 -0800 [thread overview]
Message-ID: <86siuovwj8.fsf@miki.keithp.com> (raw)
In-Reply-To: <20131122221213.GA3234@tokamak.local>
[-- Attachment #1: Type: text/plain, Size: 1653 bytes --]
Kristian Høgsberg <hoegsberg@gmail.com> writes:
> I already explained to Keith why we use different sets of format codes
> in the DRI interface, but it's always fun to slam other peoples code.
As we discussed, my complaint isn't so much about __DRI_IMAGE_FOURCC,
but the fact that the __DRIimage interfaces use *both*
__DRI_IMAGE_FOURCC and __DRI_IMAGE_FORMAT at different times.
Ok, here's a fine thing we can actually fix -- the pattern that mesa
uses all over the place in converting formats looks like this (not to
pick on anyone, it's repeated everywhere, this is just the first one I
found in gbm_dri.c):
static uint32_t
gbm_dri_to_gbm_format(uint32_t dri_format)
{
uint32_t ret = 0;
switch (dri_format) {
case __DRI_IMAGE_FORMAT_RGB565:
ret = GBM_FORMAT_RGB565;
break;
case __DRI_IMAGE_FORMAT_XRGB8888:
ret = GBM_FORMAT_XRGB8888;
break;
case __DRI_IMAGE_FORMAT_ARGB8888:
ret = GBM_FORMAT_ARGB8888;
break;
case __DRI_IMAGE_FORMAT_ABGR8888:
ret = GBM_FORMAT_ABGR8888;
break;
default:
ret = 0;
break;
}
return ret;
}
The problem here is that any unknown incoming formats get translated to
garbage (0) outgoing. With fourcc codes, there is the slight advantage
that 0 is never a legal value, but it sure would be nice to print a
warning or even abort if you get a format code you don't understand as
there's no way 0 is ever going to do what you want.
Anyone have a preference? Abort? Print an error? Silently continue to do
the wrong thing?
--
keith.packard@intel.com
[-- Attachment #2: Type: application/pgp-signature, Size: 827 bytes --]
next prev parent reply other threads:[~2013-11-22 23:36 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-22 4:12 [PATCH] dri3, i915, i965: Add __DRI_IMAGE_FOURCC_SARGB8888 Keith Packard
2013-11-22 10:26 ` Daniel Vetter
2013-11-22 11:01 ` [Mesa-dev] " Keith Packard
2013-11-22 16:17 ` Daniel Vetter
2013-11-22 16:17 ` Daniel Vetter
2013-11-22 16:17 ` Daniel Vetter
2013-11-22 17:46 ` Ville Syrjälä
2013-11-22 17:46 ` Ville Syrjälä
2013-11-22 22:12 ` [Intel-gfx] " Kristian Høgsberg
2013-11-22 22:12 ` Kristian Høgsberg
2013-11-22 23:05 ` Ville Syrjälä
2013-11-22 23:05 ` Ville Syrjälä
2013-11-22 23:43 ` Keith Packard
2013-11-22 23:43 ` Keith Packard
2013-11-22 23:43 ` Keith Packard
2013-11-23 1:10 ` Ville Syrjälä
2013-11-23 1:10 ` Ville Syrjälä
2013-11-25 14:57 ` Geert Uytterhoeven
2013-11-25 14:57 ` Geert Uytterhoeven
2013-11-25 14:57 ` Geert Uytterhoeven
2013-11-22 23:36 ` Keith Packard [this message]
2013-11-22 23:36 ` [Intel-gfx] " Keith Packard
2013-11-22 23:36 ` [Intel-gfx] " Keith Packard
2013-11-25 8:57 ` [Intel-gfx] [Mesa-dev] " Daniel Vetter
2013-11-25 8:57 ` Daniel Vetter
2013-11-25 8:57 ` Daniel Vetter
2013-11-25 14:15 ` [Intel-gfx] " Ville Syrjälä
2013-11-25 14:15 ` Ville Syrjälä
2013-11-25 14:15 ` Ville Syrjälä
[not found] ` <16967_1385369810_529310D2_16967_15891_1_20131125085723.GW27344@phenom.ffwll.local>
2013-11-25 15:14 ` i830 watermark problems - status? Thomas Richter
2013-11-25 15:23 ` Daniel Vetter
[not found] ` <26487_1385392973_52936B4D_26487_126_1_20131125152331.GB27344@phenom.ffwll.local>
2013-11-25 15:55 ` Thomas Richter
2013-11-25 20:30 ` Daniel Vetter
[not found] ` <26487_1385411456_5293B380_26487_2367_1_CAKMK7uFFZcf92XbzA9Mj2c0fdhDWZMKkZVNK9yy8Shc8pcLygg@mail.gmail.com>
2013-11-30 20:11 ` Thomas Richter
2013-12-19 14:01 ` intel-drm-nightly: hang and black screen on i830 Thomas Richter
2013-11-25 22:08 ` [PATCH] dri3, i915, i965: Add __DRI_IMAGE_FOURCC_SARGB8888 Eric Anholt
2013-12-13 22:58 ` Kenneth Graunke
2013-12-14 0:37 ` [Mesa-dev] " Keith Packard
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=86siuovwj8.fsf@miki.keithp.com \
--to=keithp@keithp.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=hoegsberg@gmail.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mesa-dev@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
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.