Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] drm/i915; Protect intel_gen4_compute_offset_xtiled() against unknown pixel format
@ 2012-12-18 22:13 Chris Wilson
  2012-12-18 22:13 ` [PATCH 2/3] drm/i915: The sprite scaler on Ironlake also support YUV planes Chris Wilson
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Chris Wilson @ 2012-12-18 22:13 UTC (permalink / raw)
  To: intel-gfx

If the pixel format is not known to the core helpers, it fills in the
fb->bits_per_pixel field as 0. This causes a fatal divide-by-zero OOPS
when we then try to calculate the tiled offset. This would not be a
problem, but that the core helpers do not know about the YUV planar
formats we use for sprites.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/intel_display.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 8986172..de09f47 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -2019,6 +2019,9 @@ unsigned long intel_gen4_compute_offset_xtiled(int *x, int *y,
 {
 	int tile_rows, tiles;
 
+	if (bpp == 0) /* XXX unknown pixel format! */
+		return 0;
+
 	tile_rows = *y / 8;
 	*y %= 8;
 	tiles = *x / (512/bpp);
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2013-01-08 11:31 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-18 22:13 [PATCH 1/3] drm/i915; Protect intel_gen4_compute_offset_xtiled() against unknown pixel format Chris Wilson
2012-12-18 22:13 ` [PATCH 2/3] drm/i915: The sprite scaler on Ironlake also support YUV planes Chris Wilson
2012-12-19 12:00   ` Ville Syrjälä
2013-01-08 11:09     ` Daniel Vetter
2012-12-18 22:13 ` [PATCH 3/3] drm/i915: Add DEBUG messages to all intel_create_user_framebuffer error paths Chris Wilson
2012-12-19 11:47   ` Ville Syrjälä
2012-12-19 11:52     ` Chris Wilson
2012-12-19 11:58       ` Ville Syrjälä
2013-01-08 11:14   ` Daniel Vetter
2013-01-08 11:13 ` [PATCH 1/3] drm/i915; Protect intel_gen4_compute_offset_xtiled() against unknown pixel format Daniel Vetter
2013-01-08 11:31   ` Chris Wilson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox