On 09/07/2017 04:27 PM, Emil Velikov wrote:
Hi Mario,

On 5 September 2017 at 06:01, Mario Kleiner <mario.kleiner...@gmail.com> wrote:
Expose formats which are supported at least back to Gen 5 Ironlake,
possibly further. Allow creation of 10 bpc winsys buffers for drawables.

glxinfo now lists new RGBA 10 10 10 2/0 formats.
Works correctly under DRI2 without compositing.

In all fairness I did not expect apps to _not_ get confused by the
extra config(s).
Barring g-s (workaround in 8/10), have you seen any other apps that
exhibit problems?

So far not. DE's work, glxgears/es2gears, weston demos, my app, glmark are fine.

Say any steam games or SDL based apps?

I don't have access to any Steam games. neverball/neverputt is Opengl SDL-2 based and those work, both on X11 and Weston. I can nicely see color gradients in neverputt becoming smooth in 30 bit mode when they have some steps in 24 bit mode.


Signed-off-by: Mario Kleiner <mario.kleiner...@gmail.com>
---
  src/mesa/drivers/dri/i965/intel_screen.c | 12 +++++++++++-
  1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/intel_screen.c 
b/src/mesa/drivers/dri/i965/intel_screen.c
index d39509b..47008b5 100644
--- a/src/mesa/drivers/dri/i965/intel_screen.c
+++ b/src/mesa/drivers/dri/i965/intel_screen.c
@@ -1486,7 +1486,13 @@ intelCreateBuffer(__DRIscreen *dri_screen,
        fb->Visual.samples = num_samples;
     }

-   if (mesaVis->redBits == 5) {
+   if (mesaVis->redBits == 10 && mesaVis->alphaBits > 0) {
+      rgbFormat = mesaVis->redMask == 0x3ff00000 ? 
MESA_FORMAT_B10G10R10A2_UNORM
+                                                 : 
MESA_FORMAT_R10G10B10A2_UNORM;
+   } else if (mesaVis->redBits == 10) {
+      rgbFormat = mesaVis->redMask == 0x3ff00000 ? 
MESA_FORMAT_B10G10R10X2_UNORM
+                                                 : 
MESA_FORMAT_R10G10B10X2_UNORM;
+   } else if (mesaVis->redBits == 5) {
        rgbFormat = mesaVis->redMask == 0x1f ? MESA_FORMAT_R5G6B5_UNORM
                                             : MESA_FORMAT_B5G6R5_UNORM;
Unrelated: At some point we should flesh this out to a helper.


     } else if (mesaVis->sRGBCapable) {
@@ -1874,6 +1880,10 @@ intel_screen_make_configs(__DRIscreen *dri_screen)

        /* Required by Android, for HAL_PIXEL_FORMAT_RGBX_8888. */
        MESA_FORMAT_R8G8B8X8_UNORM,
+
+      /* For 10 bpc, 30 bit depth framebuffers */
+      MESA_FORMAT_B10G10R10A2_UNORM,
+      MESA_FORMAT_B10G10R10X2_UNORM,
Please make sure these are before the Android RGB* ones. The

Fixed.

ARRAY_SIZE() further down, will need a tweak.

This i don't understand? ARRAY_SIZE seems to be generic enough to not need tweaks based on the arrays content?

-mario


-Emil

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to