OSDN Git Service

drm/i915: Replace some PAGE_SHIFTs with I915_GTT_PAGE_SIZE
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Mon, 17 Sep 2018 17:14:14 +0000 (20:14 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 18 Sep 2018 14:05:08 +0000 (17:05 +0300)
commit21c62a9d16252725ec1f26707bf7db6b8ec59c7f
tree79136e19b51db43c88e54bdfc69845f759bf75b7
parent8e3ffa8d027554b5ba41131a31fcd96d248d1991
drm/i915: Replace some PAGE_SHIFTs with I915_GTT_PAGE_SIZE

Clean up some cases where we're dealing with GTT pages instead of
system pages to use I915_GTT_PAGE_SIZE instead of PAGE_SHIT. So
just replace the the shifts with mul/div as appropriate. These
are the easy ones, the rest probably need some actual thought.

No real changes in the generated asm. Only gen8_ppgtt_insert_4lvl()
was affected as gcc decided to do the following change:
-     be9:       89 d9                   mov    %ebx,%ecx
-     beb:       c1 e1 0c                shl    $0xc,%ecx
-     bee:       48 63 c9                movslq %ecx,%rcx
+     be9:       48 63 cb                movslq %ebx,%rcx
+     bec:       48 c1 e1 0c             shl    $0xc,%rcx
and that then shifted a bunch of the offset by one byte. I presume
the sign extensions in the asm are due to integer promotions from
u16 etc. Hopefully someone has confirmed that those don't end up
doing the wrong thing for us.

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