diff options
| -rw-r--r-- | meta/recipes-graphics/xorg-driver/xf86-video-intel/sna-Protect-against-ABI-breakage-in-recent-versions-.patch | 70 | ||||
| -rw-r--r-- | meta/recipes-graphics/xorg-driver/xf86-video-intel_2.99.917.bb | 1 |
2 files changed, 71 insertions, 0 deletions
diff --git a/meta/recipes-graphics/xorg-driver/xf86-video-intel/sna-Protect-against-ABI-breakage-in-recent-versions-.patch b/meta/recipes-graphics/xorg-driver/xf86-video-intel/sna-Protect-against-ABI-breakage-in-recent-versions-.patch new file mode 100644 index 0000000000..589d52e0f0 --- /dev/null +++ b/meta/recipes-graphics/xorg-driver/xf86-video-intel/sna-Protect-against-ABI-breakage-in-recent-versions-.patch | |||
| @@ -0,0 +1,70 @@ | |||
| 1 | From 7fe2b2948652443ff43d907855bd7a051d54d309 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Chris Wilson <chris@chris-wilson.co.uk> | ||
| 3 | Date: Thu, 19 Mar 2015 23:14:17 +0000 | ||
| 4 | Subject: [PATCH] sna: Protect against ABI breakage in recent versions of | ||
| 5 | libdrm | ||
| 6 | |||
| 7 | commit 7fe2b2948652443ff43d907855bd7a051d54d309 upstream. | ||
| 8 | |||
| 9 | Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> | ||
| 10 | Upstream-Status: Backport | ||
| 11 | Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> | ||
| 12 | |||
| 13 | diff --git a/src/sna/kgem.c b/src/sna/kgem.c | ||
| 14 | index 11f0828f2bbc..6f16cbac87f2 100644 | ||
| 15 | --- a/src/sna/kgem.c | ||
| 16 | +++ b/src/sna/kgem.c | ||
| 17 | @@ -182,6 +182,15 @@ struct local_i915_gem_caching { | ||
| 18 | #define LOCAL_IOCTL_I915_GEM_SET_CACHING DRM_IOW(DRM_COMMAND_BASE + LOCAL_I915_GEM_SET_CACHING, struct local_i915_gem_caching) | ||
| 19 | #define LOCAL_IOCTL_I915_GEM_GET_CACHING DRM_IOW(DRM_COMMAND_BASE + LOCAL_I915_GEM_GET_CACHING, struct local_i915_gem_caching) | ||
| 20 | |||
| 21 | +struct local_i915_gem_mmap { | ||
| 22 | + uint32_t handle; | ||
| 23 | + uint32_t pad; | ||
| 24 | + uint64_t offset; | ||
| 25 | + uint64_t size; | ||
| 26 | + uint64_t addr_ptr; | ||
| 27 | +}; | ||
| 28 | +#define LOCAL_IOCTL_I915_GEM_MMAP DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MMAP, struct local_i915_gem_mmap) | ||
| 29 | + | ||
| 30 | struct local_i915_gem_mmap2 { | ||
| 31 | uint32_t handle; | ||
| 32 | uint32_t pad; | ||
| 33 | @@ -514,15 +523,15 @@ retry_wc: | ||
| 34 | |||
| 35 | static void *__kgem_bo_map__cpu(struct kgem *kgem, struct kgem_bo *bo) | ||
| 36 | { | ||
| 37 | - struct drm_i915_gem_mmap mmap_arg; | ||
| 38 | + struct local_i915_gem_mmap arg; | ||
| 39 | int err; | ||
| 40 | |||
| 41 | retry: | ||
| 42 | - VG_CLEAR(mmap_arg); | ||
| 43 | - mmap_arg.handle = bo->handle; | ||
| 44 | - mmap_arg.offset = 0; | ||
| 45 | - mmap_arg.size = bytes(bo); | ||
| 46 | - if ((err = do_ioctl(kgem->fd, DRM_IOCTL_I915_GEM_MMAP, &mmap_arg))) { | ||
| 47 | + VG_CLEAR(arg); | ||
| 48 | + arg.handle = bo->handle; | ||
| 49 | + arg.offset = 0; | ||
| 50 | + arg.size = bytes(bo); | ||
| 51 | + if ((err = do_ioctl(kgem->fd, LOCAL_IOCTL_I915_GEM_MMAP, &arg))) { | ||
| 52 | assert(err != EINVAL); | ||
| 53 | |||
| 54 | if (__kgem_throttle_retire(kgem, 0)) | ||
| 55 | @@ -536,10 +545,10 @@ retry: | ||
| 56 | return NULL; | ||
| 57 | } | ||
| 58 | |||
| 59 | - VG(VALGRIND_MAKE_MEM_DEFINED(mmap_arg.addr_ptr, bytes(bo))); | ||
| 60 | + VG(VALGRIND_MAKE_MEM_DEFINED(arg.addr_ptr, bytes(bo))); | ||
| 61 | |||
| 62 | DBG(("%s: caching CPU vma for %d\n", __FUNCTION__, bo->handle)); | ||
| 63 | - return bo->map__cpu = (void *)(uintptr_t)mmap_arg.addr_ptr; | ||
| 64 | + return bo->map__cpu = (void *)(uintptr_t)arg.addr_ptr; | ||
| 65 | } | ||
| 66 | |||
| 67 | static int gem_write(int fd, uint32_t handle, | ||
| 68 | -- | ||
| 69 | 2.4.4 | ||
| 70 | |||
diff --git a/meta/recipes-graphics/xorg-driver/xf86-video-intel_2.99.917.bb b/meta/recipes-graphics/xorg-driver/xf86-video-intel_2.99.917.bb index 26b68b461c..0ab7380506 100644 --- a/meta/recipes-graphics/xorg-driver/xf86-video-intel_2.99.917.bb +++ b/meta/recipes-graphics/xorg-driver/xf86-video-intel_2.99.917.bb | |||
| @@ -11,6 +11,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=8730ad58d11c7bbad9a7066d69f7808e" | |||
| 11 | 11 | ||
| 12 | SRC_URI += "file://disable-x11-dri3.patch \ | 12 | SRC_URI += "file://disable-x11-dri3.patch \ |
| 13 | file://always_include_xorg_server.h.patch \ | 13 | file://always_include_xorg_server.h.patch \ |
| 14 | file://sna-Protect-against-ABI-breakage-in-recent-versions-.patch \ | ||
| 14 | " | 15 | " |
| 15 | 16 | ||
| 16 | SRC_URI[md5sum] = "fa196a66e52c0c624fe5d350af7a5e7b" | 17 | SRC_URI[md5sum] = "fa196a66e52c0c624fe5d350af7a5e7b" |
