From: Chia-I Wu Date: Fri, 11 Jan 2019 18:03:51 +0000 (-0800) Subject: turnip: use msm_drm.h from inc_freedreno X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=91232c52fe49848aa622a31e38e5ba0d008d08e0;p=mesa.git turnip: use msm_drm.h from inc_freedreno The recent change to msm_drm.h changed the APIs in an incompatible way. --- diff --git a/src/freedreno/vulkan/tu_device.c b/src/freedreno/vulkan/tu_device.c index 6a46786fda3..c7550ae03de 100644 --- a/src/freedreno/vulkan/tu_device.c +++ b/src/freedreno/vulkan/tu_device.c @@ -28,7 +28,6 @@ #include "tu_private.h" #include -#include #include #include #include @@ -42,6 +41,8 @@ #include "vk_format.h" #include "vk_util.h" +#include "drm/msm_drm.h" + static int tu_device_get_cache_uuid(uint16_t family, void *uuid) { diff --git a/src/freedreno/vulkan/tu_drm.c b/src/freedreno/vulkan/tu_drm.c index 88baf82adf2..d0d1cd8d4f6 100644 --- a/src/freedreno/vulkan/tu_drm.c +++ b/src/freedreno/vulkan/tu_drm.c @@ -24,11 +24,12 @@ #include "tu_private.h" -#include "xf86drm.h" #include -#include #include #include +#include + +#include "drm/msm_drm.h" /** * Return gem handle on success. Return 0 on failure. @@ -61,11 +62,11 @@ tu_gem_close(struct tu_device *dev, uint32_t gem_handle) /** Return UINT64_MAX on error. */ static uint64_t -tu_gem_info(struct tu_device *dev, uint32_t gem_handle, uint32_t flags) +tu_gem_info(struct tu_device *dev, uint32_t gem_handle, uint32_t info) { struct drm_msm_gem_info req = { .handle = gem_handle, - .flags = flags, + .info = info, }; int ret = drmCommandWriteRead(dev->physical_device->local_fd, @@ -73,21 +74,21 @@ tu_gem_info(struct tu_device *dev, uint32_t gem_handle, uint32_t flags) if (ret == -1) return UINT64_MAX; - return req.offset; + return req.value; } /** Return UINT64_MAX on error. */ uint64_t tu_gem_info_offset(struct tu_device *dev, uint32_t gem_handle) { - return tu_gem_info(dev, gem_handle, 0); + return tu_gem_info(dev, gem_handle, MSM_INFO_GET_OFFSET); } /** Return UINT64_MAX on error. */ uint64_t tu_gem_info_iova(struct tu_device *dev, uint32_t gem_handle) { - return tu_gem_info(dev, gem_handle, MSM_INFO_IOVA); + return tu_gem_info(dev, gem_handle, MSM_INFO_GET_IOVA); } int