egl: Drop backwards compat for missing __DRI_ATTRIB_*_SHIFT.

The only implementation supports it.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20171>
This commit is contained in:
Emma Anholt 2022-11-30 15:56:17 -08:00 committed by Marge Bot
parent a145a8301e
commit 433c6f5d3a

View file

@ -339,24 +339,10 @@ dri2_get_shifts_and_sizes(const __DRIcoreExtension *core,
const __DRIconfig *config, int *shifts,
unsigned int *sizes)
{
unsigned int mask;
if (core->getConfigAttrib(config, __DRI_ATTRIB_RED_SHIFT, (unsigned int *)&shifts[0])) {
core->getConfigAttrib(config, __DRI_ATTRIB_GREEN_SHIFT, (unsigned int *)&shifts[1]);
core->getConfigAttrib(config, __DRI_ATTRIB_BLUE_SHIFT, (unsigned int *)&shifts[2]);
core->getConfigAttrib(config, __DRI_ATTRIB_ALPHA_SHIFT, (unsigned int *)&shifts[3]);
} else {
/* Driver isn't exposing shifts, so convert masks to shifts */
core->getConfigAttrib(config, __DRI_ATTRIB_RED_MASK, &mask);
shifts[0] = ffs(mask) - 1;
core->getConfigAttrib(config, __DRI_ATTRIB_GREEN_MASK, &mask);
shifts[1] = ffs(mask) - 1;
core->getConfigAttrib(config, __DRI_ATTRIB_BLUE_MASK, &mask);
shifts[2] = ffs(mask) - 1;
core->getConfigAttrib(config, __DRI_ATTRIB_ALPHA_MASK, &mask);
shifts[3] = ffs(mask) - 1;
}
core->getConfigAttrib(config, __DRI_ATTRIB_RED_SHIFT, (unsigned int *)&shifts[0]);
core->getConfigAttrib(config, __DRI_ATTRIB_GREEN_SHIFT, (unsigned int *)&shifts[1]);
core->getConfigAttrib(config, __DRI_ATTRIB_BLUE_SHIFT, (unsigned int *)&shifts[2]);
core->getConfigAttrib(config, __DRI_ATTRIB_ALPHA_SHIFT, (unsigned int *)&shifts[3]);
core->getConfigAttrib(config, __DRI_ATTRIB_RED_SIZE, &sizes[0]);
core->getConfigAttrib(config, __DRI_ATTRIB_GREEN_SIZE, &sizes[1]);
core->getConfigAttrib(config, __DRI_ATTRIB_BLUE_SIZE, &sizes[2]);