drm/i915: cache number of MOCS entries
authorLucas De Marchi <lucas.demarchi@intel.com>
Thu, 24 Jan 2019 00:06:03 +0000 (16:06 -0800)
committerLucas De Marchi <lucas.demarchi@intel.com>
Fri, 25 Jan 2019 03:34:34 +0000 (19:34 -0800)
commit5029537f4fbb30d2640d0cda86e35b6316e7464e
tree5ac3fdfc4204c4705b5dd4e82727b57dad407f52
parent1878fce8de256dd0d263c670ae86b96b82cac735
drm/i915: cache number of MOCS entries

Instead of checking the gen number every time we need to know the max
number of entries, just save it into the table struct so we don't need
extra branches throughout the code. This will be useful for Ice Lake
that has 64 rather than 62 defined entries. Ice Lake changes will be
added in a follow up.

v2: make size and n_entries `unsigned int` and introduce changes as a
    pre-work for the Ice Lake changes (Tvrtko)

Suggested-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Tomasz Lis <tomasz.lis@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190124000604.18861-7-lucas.demarchi@intel.com
drivers/gpu/drm/i915/intel_mocs.c