Bug 45414 - loading a texture of 2049 on gen2 (max 3d texture 2048) leads to X crash due to assert in kgem
Summary: loading a texture of 2049 on gen2 (max 3d texture 2048) leads to X crash due ...
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/intel (show other bugs)
Version: git
Hardware: x86 (IA32) Linux (All)
: medium normal
Assignee: Chris Wilson
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-30 15:34 UTC by Alban Browaeys
Modified: 2012-01-31 02:31 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
workaround for texture bigger than 3d max texture and tiling enabled (1.10 KB, application/octet-stream)
2012-01-30 15:34 UTC, Alban Browaeys
no flags Details
sample test (cogl/clutter) (4.90 KB, text/plain)
2012-01-30 15:38 UTC, Alban Browaeys
no flags Details
workaround for texture bigger than 3d max texture and tiling enabled (v2) (1.12 KB, patch)
2012-01-30 15:57 UTC, Alban Browaeys
no flags Details | Splinter Review

Description Alban Browaeys 2012-01-30 15:34:17 UTC
Created attachment 56346 [details]
workaround for texture bigger than 3d max texture and tiling enabled

kgem_create_2d assert due to size behing zero. This comes from kgem_surface_size returning 0 if pitch is greater than 8192 and tiling is enabled.

As it was working before (I guess tiling was disabled when loading too big a texture) I make up this fix.

This is only tested against the sample code that triggered the previous crash (attached). But it works (ie it load a white texture).
Comment 1 Alban Browaeys 2012-01-30 15:38:17 UTC
Created attachment 56347 [details]
sample test (cogl/clutter)

Sample that triggered the bug on gen2 (change MAX_RECT_LOCAL to 3d max texture + 1). At least on gen2 i865g using 2049 leads to crash with xf86 video intel to commit ed1c1a7468d78e99cb4f9a4a8b8a6b00c3257a75 .
Comment 2 Alban Browaeys 2012-01-30 15:57:39 UTC
Created attachment 56350 [details] [review]
workaround for texture bigger than 3d max texture and tiling enabled (v2)

Avoid calling kgem_surface_size if size is not zero with tiling on.
Comment 3 Chris Wilson 2012-01-31 02:11:56 UTC
The assertion is there to tell you the caller is being idiotic. Fix the caller.
Comment 4 Chris Wilson 2012-01-31 02:31:54 UTC
commit e872c1011fc7b67683703fd891234f07dd7acd04
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Jan 31 10:21:05 2012 +0000

    sna/dri: We need to reduce tiling on older gen if we cannot fence
    
    Only apply the architectural limits to enable bo creation for DRI buffers.
    
    Reported-by: Alban Browaeys <prahal@yahoo.com>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45414
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.