i965: Set modifier for imported and duplicated images
authorDaniel Stone <daniels@collabora.com>
Wed, 3 May 2017 08:38:13 +0000 (09:38 +0100)
committerDaniel Stone <daniels@collabora.com>
Fri, 5 May 2017 16:34:10 +0000 (17:34 +0100)
commit8b8af19065a5bfd06fd0d97b891cfff807704935
treebf7a67b309da04cb20c9c931e66d10ca878b241f
parent467332a0ab2a2328a37ad302dedd81a654e36313
i965: Set modifier for imported and duplicated images

When a buffer is being created from FD or GEM flink import, the current
API makes no provision for passing modifier information along with this.
Set the modifier for such images to DRM_FORMAT_MOD_INVALID.

Also preserve the modifier when duplicating an image, as will be done by
GBM when importing from a wl_buffer.

This doubly tripped up Wayland, as the images would first have been
created (as wl_buffers) with a 0 modifier, and then lost what modifier
they would've had when being duplicated into gbm_bos.

Fixes: d78a36ea624 ("i965/dri: Handle the linear fb modifier")
Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
src/mesa/drivers/dri/i965/intel_screen.c