[Mesa-dev] st/dri: Add support for PIPE_FORMAT_RGBX8888_UNORM

Submitted by Lepton Wu on June 19, 2017, 5:51 p.m.

Details

Message ID 20170619175150.113633-1-lepton@chromium.org
State New
Headers show
Series "st/dri: Add support for PIPE_FORMAT_RGBX8888_UNORM" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Lepton Wu June 19, 2017, 5:51 p.m.
The original dri2_format_to_pipe_format function just misses case branch
for __DRI_IMAGE_FORMAT_XBGR8888. I discovered this when debugging one google
map crash inside emulator.

Signed-off-by: Lepton Wu <lepton@chromium.org>
---
 src/gallium/state_trackers/dri/dri2.c | 3 +++
 1 file changed, 3 insertions(+)

Patch hide | download patch | download mbox

diff --git a/src/gallium/state_trackers/dri/dri2.c b/src/gallium/state_trackers/dri/dri2.c
index c5e69d639b..f02ef30dd7 100644
--- a/src/gallium/state_trackers/dri/dri2.c
+++ b/src/gallium/state_trackers/dri/dri2.c
@@ -186,6 +186,9 @@  static enum pipe_format dri2_format_to_pipe_format (int format)
    case __DRI_IMAGE_FORMAT_ARGB8888:
       pf = PIPE_FORMAT_BGRA8888_UNORM;
       break;
+   case __DRI_IMAGE_FORMAT_XBGR8888:
+      pf = PIPE_FORMAT_RGBX8888_UNORM;
+      break;
    case __DRI_IMAGE_FORMAT_ABGR8888:
       pf = PIPE_FORMAT_RGBA8888_UNORM;
       break;

Comments

On Mon, Jun 19, 2017 at 11:21 PM, Lepton Wu <lepton@google.com> wrote:
> The original dri2_format_to_pipe_format function just misses case branch
> for __DRI_IMAGE_FORMAT_XBGR8888. I discovered this when debugging one google
> map crash inside emulator.
>
> Signed-off-by: Lepton Wu <lepton@chromium.org>
> ---
>  src/gallium/state_trackers/dri/dri2.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/src/gallium/state_trackers/dri/dri2.c b/src/gallium/state_trackers/dri/dri2.c
> index c5e69d639b..f02ef30dd7 100644
> --- a/src/gallium/state_trackers/dri/dri2.c
> +++ b/src/gallium/state_trackers/dri/dri2.c
> @@ -186,6 +186,9 @@ static enum pipe_format dri2_format_to_pipe_format (int format)
>     case __DRI_IMAGE_FORMAT_ARGB8888:
>        pf = PIPE_FORMAT_BGRA8888_UNORM;
>        break;
> +   case __DRI_IMAGE_FORMAT_XBGR8888:
> +      pf = PIPE_FORMAT_RGBX8888_UNORM;
> +      break;
>     case __DRI_IMAGE_FORMAT_ABGR8888:
>        pf = PIPE_FORMAT_RGBA8888_UNORM;
>        break;

Reviewed-by: Varad Gautam <varadgautam@gmail.com>

> --
> 2.13.1.518.g3df882009-goog
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
On 19 June 2017 at 18:51, Lepton Wu <lepton@google.com> wrote:
> The original dri2_format_to_pipe_format function just misses case branch
> for __DRI_IMAGE_FORMAT_XBGR8888. I discovered this when debugging one google
> map crash inside emulator.
>
> Signed-off-by: Lepton Wu <lepton@chromium.org>
> ---
>  src/gallium/state_trackers/dri/dri2.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/src/gallium/state_trackers/dri/dri2.c b/src/gallium/state_trackers/dri/dri2.c
> index c5e69d639b..f02ef30dd7 100644
> --- a/src/gallium/state_trackers/dri/dri2.c
> +++ b/src/gallium/state_trackers/dri/dri2.c
> @@ -186,6 +186,9 @@ static enum pipe_format dri2_format_to_pipe_format (int format)
>     case __DRI_IMAGE_FORMAT_ARGB8888:
>        pf = PIPE_FORMAT_BGRA8888_UNORM;
>        break;
> +   case __DRI_IMAGE_FORMAT_XBGR8888:
> +      pf = PIPE_FORMAT_RGBX8888_UNORM;
> +      break;




>     case __DRI_IMAGE_FORMAT_ABGR8888:
>        pf = PIPE_FORMAT_RGBA8888_UNORM;
>        break;
> --
> 2.13.1.518.g3df882009-goog
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Hi Lepton,

On 19 June 2017 at 18:51, Lepton Wu <lepton@google.com> wrote:
> The original dri2_format_to_pipe_format function just misses case branch
> for __DRI_IMAGE_FORMAT_XBGR8888. I discovered this when debugging one google
> map crash inside emulator.
>
> Signed-off-by: Lepton Wu <lepton@chromium.org>
> ---
>  src/gallium/state_trackers/dri/dri2.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/src/gallium/state_trackers/dri/dri2.c b/src/gallium/state_trackers/dri/dri2.c
> index c5e69d639b..f02ef30dd7 100644
> --- a/src/gallium/state_trackers/dri/dri2.c
> +++ b/src/gallium/state_trackers/dri/dri2.c
> @@ -186,6 +186,9 @@ static enum pipe_format dri2_format_to_pipe_format (int format)
>     case __DRI_IMAGE_FORMAT_ARGB8888:
>        pf = PIPE_FORMAT_BGRA8888_UNORM;
>        break;
> +   case __DRI_IMAGE_FORMAT_XBGR8888:
> +      pf = PIPE_FORMAT_RGBX8888_UNORM;
> +      break;

Can you provide some additional information here:
 - How did you get here - a backtrace will be appreciated.
 - Do you have additional patches that you apply on top of Mesa - can
you share a link to them.

I'm asking all this information since the commit looks deceptively
close to an earlier one ccdcf91104a, which caused issues and had to be
reverted see c0c6ca40a25.

Thanks
Emil
Hi All,

So it turns out someone else have a much complete fix for this issue and I
think I can wait that CL to land in mesa.

Feel free to drop this CL. Thanks all for your review.

On Tue, Jun 20, 2017 at 2:06 AM, Emil Velikov <emil.l.velikov@gmail.com>
wrote:

> Hi Lepton,
>
> On 19 June 2017 at 18:51, Lepton Wu <lepton@google.com> wrote:
> > The original dri2_format_to_pipe_format function just misses case branch
> > for __DRI_IMAGE_FORMAT_XBGR8888. I discovered this when debugging one
> google
> > map crash inside emulator.
> >
> > Signed-off-by: Lepton Wu <lepton@chromium.org>
> > ---
> >  src/gallium/state_trackers/dri/dri2.c | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/src/gallium/state_trackers/dri/dri2.c
> b/src/gallium/state_trackers/dri/dri2.c
> > index c5e69d639b..f02ef30dd7 100644
> > --- a/src/gallium/state_trackers/dri/dri2.c
> > +++ b/src/gallium/state_trackers/dri/dri2.c
> > @@ -186,6 +186,9 @@ static enum pipe_format dri2_format_to_pipe_format
> (int format)
> >     case __DRI_IMAGE_FORMAT_ARGB8888:
> >        pf = PIPE_FORMAT_BGRA8888_UNORM;
> >        break;
> > +   case __DRI_IMAGE_FORMAT_XBGR8888:
> > +      pf = PIPE_FORMAT_RGBX8888_UNORM;
> > +      break;
>
> Can you provide some additional information here:
>  - How did you get here - a backtrace will be appreciated.
>  - Do you have additional patches that you apply on top of Mesa - can
> you share a link to them.
>
> I'm asking all this information since the commit looks deceptively
> close to an earlier one ccdcf91104a, which caused issues and had to be
> reverted see c0c6ca40a25.
>
> Thanks
> Emil
>