]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915/dmabuf: fix sg_table handling in map_dma_buf
authorMatthew Auld <matthew.auld@intel.com>
Fri, 28 Oct 2022 15:50:26 +0000 (16:50 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 Nov 2022 16:42:09 +0000 (17:42 +0100)
commit1a654b8443b3b965b097e88c7d0b29cb99f32c26
tree252ddf47d3b4476c4f9e84dd384a2a74a520fbdf
parent3f2057d6d3441c77ee205b5f1d5ed34d50a9aef7
drm/i915/dmabuf: fix sg_table handling in map_dma_buf

commit 09d32a37287baa3820734dec9381d0caa8db7958 upstream.

We need to iterate over the original entries here for the sg_table,
pulling out the struct page for each one, to be remapped. However
currently this incorrectly iterates over the final dma mapped entries,
which is likely just one gigantic sg entry if the iommu is enabled,
leading to us only mapping the first struct page (and any physically
contiguous pages following it), even if there is potentially lots more
data to follow.

Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/7306
Fixes: f1978cdea40b ("i915: add dmabuf/prime buffer sharing support.")
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Michael J. Ruhl <michael.j.ruhl@intel.com>
Cc: <stable@vger.kernel.org> # v3.5+
Reviewed-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221028155029.494736-1-matthew.auld@intel.com
(cherry picked from commit c6a14769e537afec9d969ad02b982a7c957360f7)
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c