OSDN Git Service

iris: try to set the specified tiling when importing a dmabuf
authorJames Xiong <james.xiong@intel.com>
Thu, 4 Apr 2019 15:27:33 +0000 (08:27 -0700)
committerDylan Baker <dylan@pnwbakers.com>
Wed, 11 Dec 2019 23:49:35 +0000 (15:49 -0800)
commitae06960627d5e7ac98fca320ad7d7e4f6c9621a1
treebe3dacdfdb6e8902cc70c740b98c9dcf024f7aff
parent7b2ef16086c07bd282ba4905b68d88ba640fb79b
iris: try to set the specified tiling when importing a dmabuf

When importing a dmabuf with a specified tiling, the dmabuf user
should always try to set the tiling mode because: 1) the exporter
can set tiling AFTER exporting/importing. 2) a dmabuf could be
exported from a kernel driver other than i915, in this case the
dmabuf user and exporter need to set tiling separately.

This patch fixes a problem when running vkmark under weston with
iris on ICL, it crashed to console with the following assert. i965
doesn't have this problem as it always tries to set the specified
tiling mode.

weston: ../src/gallium/drivers/iris/iris_resource.c:990: iris_resource_from_handle: Assertion `res->bo->tiling_mode == isl_tiling_to_i915_tiling(res->surf.tiling)' failed.

Signed-off-by: James Xiong <james.xiong@intel.com>
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
(cherry picked from commit b6d45e7f748e9ff7e198391f5ce5d1253101fedb)
src/gallium/drivers/iris/iris_bufmgr.c
src/gallium/drivers/iris/iris_bufmgr.h
src/gallium/drivers/iris/iris_resource.c