]> git.baikalelectronics.ru Git - kernel.git/commit
i915: Fix obj size vs. alignment for drm_pci_alloc()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 7 Sep 2017 14:32:03 +0000 (17:32 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 7 Sep 2017 17:12:36 +0000 (20:12 +0300)
commit6ca77bf39c63b1e71173e5abe51dfc86309e35a8
tree5eec6e3bdfc996a15c5965b3e0d7c73421435a4e
parentad291733af827c304ecc6188d95d0fe6e9fcd2a7
i915: Fix obj size vs. alignment for drm_pci_alloc()

drm_pci_alloc() refuses to cooperate if the passed alignment exceeds the
object size. So round up the obj size to the next power of two as well
to make this actually work.

Obviously things work just fine as long as the size was a power of two
to begin with. However kms_cursor_crc doesn't always use power of two
sizes so we hit a failure when we try to allocate the phys memory.

Testcase: igt/kms_cursor_crc
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20170907143203.13055-1-ville.syrjala@linux.intel.com
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
drivers/gpu/drm/i915/i915_gem.c