diff options
author | Mario Kleiner <mario.kleiner.de@gmail.com> | 2017-12-15 23:04:53 +0100 |
---|---|---|
committer | Marek Olšák <marek.olsak@amd.com> | 2018-01-03 22:57:56 +0100 |
commit | 9e63cbacb6bc10b4426fc2af4989fbdc86ec4167 (patch) | |
tree | 327f5f9fc10714d69b554cb43b13039d71108b6d /src | |
parent | 87faa8b1e844cab92c6e9c83233bb156c02f734f (diff) |
i965/screen: Add basic support for rendering 10 bpc/depth 30 framebuffers. (v3)
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.
v2: Move the BGRA/BGRX1010102 formats before the RGBA/RGBX8888
32 bit formats, as the code comments require. Thanks Emil!
Update num_formats from 3 to 5, to keep the special Android
handling intact.
v3: Use num_formats = ARRAY_SIZE(formats) - 2 as suggested by Tapani,
to only exclude the last 2 Android formats, add Tapani's r-b.
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/i965/intel_screen.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c index 7c2690a92fd..746c568de27 100644 --- a/src/mesa/drivers/dri/i965/intel_screen.c +++ b/src/mesa/drivers/dri/i965/intel_screen.c @@ -1602,7 +1602,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; } else if (mesaVis->sRGBCapable) { @@ -2012,6 +2018,10 @@ intel_screen_make_configs(__DRIscreen *dri_screen) MESA_FORMAT_B8G8R8A8_SRGB, + /* For 10 bpc, 30 bit depth framebuffers. */ + MESA_FORMAT_B10G10R10A2_UNORM, + MESA_FORMAT_B10G10R10X2_UNORM, + /* The 32-bit RGBA format must not precede the 32-bit BGRA format. * Likewise for RGBX and BGRX. Otherwise, the GLX client and the GLX * server may disagree on which format the GLXFBConfig represents, |