gallium: dri2: Use index as plane number.
authorLepton Wu <lepton@chromium.org>
Sat, 2 Nov 2019 06:41:29 +0000 (23:41 -0700)
committerLepton Wu <lepton@chromium.org>
Wed, 6 Nov 2019 21:58:28 +0000 (21:58 +0000)
This fix wrong color when playing video under Android + virgl
configuration.

Fixes: 2decad495f3 ("gallium/dri2: Support images with multiple planes for modifiers")
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Lepton Wu <lepton@chromium.org>
src/gallium/state_trackers/dri/dri2.c

index 38b7c3f8b36129e58023882338c825a3ee4d8b78..2a8ba40c36a20796ef5a3520beeb77e6d637337b 100644 (file)
@@ -940,7 +940,7 @@ dri2_create_image_from_fd(__DRIscreen *_screen,
       whandles[i].stride = (unsigned)strides[index];
       whandles[i].offset = (unsigned)offsets[index];
       whandles[i].modifier = modifier;
-      whandles[i].plane = i;
+      whandles[i].plane = index;
    }
 
    img = dri2_create_image_from_winsys(_screen, width, height, use, map,