Ville Syrjälä 2b94c23eaf drm/i915: Avoid div-by-zero on gen2
commit 4819d16d91145966ce03818a95169df1fd56b299 upstream.

Gen2 tiles are 2KiB in size so i915_gem_object_get_tile_row_size()
can in fact return <4KiB, which leads to div-by-zero here.
Avoid that.

Not sure i915_gem_object_get_tile_row_size() is entirely
sane anyway since it doesn't account for the different tile
layouts on i8xx/i915...

I'm not able to hit this before commit 6846895fde05 ("drm/i915:
Replace PIN_NONFAULT with calls to PIN_NOEVICT") and it looks
like I also need to run recent version of Mesa. With those in
place xonotic trips on this quite easily on my 85x.

Cc: stable@vger.kernel.org
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210421153401.13847-2-ville.syrjala@linux.intel.com
(cherry picked from commit ed52c62d386f764194e0184fdb905d5f24194cae)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-19 10:08:29 +02:00
..
2019-08-14 18:31:10 +02:00
2019-09-19 16:24:24 -07:00
2019-08-14 18:30:52 +02:00
2019-12-13 08:42:56 +01:00
2021-05-19 10:08:29 +02:00
2019-09-19 16:24:24 -07:00
2019-06-30 09:48:05 +02:00
2020-10-29 09:57:40 +01:00
2019-08-09 09:15:05 +02:00
2021-05-11 14:04:08 +02:00
2019-07-17 12:52:55 +02:00
2020-06-30 15:37:11 -04:00
2019-06-05 20:31:04 +02:00
2019-07-15 18:11:31 +02:00
2019-06-05 20:29:57 +02:00
2019-07-17 12:52:55 +02:00
2019-07-17 12:52:55 +02:00
2021-05-11 14:04:10 +02:00
2019-07-22 21:24:10 +02:00
2019-06-19 12:07:29 +02:00
2019-06-19 12:07:29 +02:00
2020-02-11 04:35:36 -08:00
2019-06-19 12:07:29 +02:00
2021-01-27 11:47:42 +01:00
2021-03-30 14:35:22 +02:00