Bug 27499 - [855GM i915] GL_LINE_STIPPLE displays incorrect colors
[855GM i915] GL_LINE_STIPPLE displays incorrect colors
Status: RESOLVED FIXED
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i915
unspecified
x86 (IA32) Linux (All)
: medium normal
Assigned To: Default DRI bug account
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-04-06 13:40 UTC by nick
Modified: 2014-04-24 14:35 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Improper output. Lines should be purple. (46.46 KB, application/octet-stream)
2010-04-06 13:40 UTC, nick
Details
Makefile for test case (860 bytes, text/plain)
2010-04-06 13:41 UTC, nick
Details
Test case to demonstrate line stipple (6.86 KB, text/plain)
2010-04-06 13:41 UTC, nick
Details
Improper output Screenshot. Lines should both be purple. (24.74 KB, image/png)
2010-04-06 13:44 UTC, nick
Details
Xorg Log (11.58 KB, text/plain)
2010-04-06 13:50 UTC, nick
Details
Proposed patch to resolve issue (641 bytes, patch)
2011-09-09 14:40 UTC, nick
Details | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description nick 2010-04-06 13:40:37 UTC
Created attachment 34725 [details]
Improper output.  Lines should be purple.

Kernel Gentoo 2.6.31-gentoo-r10
Intel_drv.so module version 2.11.0
Xorg X Server 1.7.6

OpenGL renderer string: Mesa DRI Intel(R) 852GM/855GM GEM 20091221 2009Q4 x86/MMX/SSE2
OpenGL version string: 1.3 Mesa 7.7.1

Trying to resolve an issue with stippled line drawing on an embedded x86 855GM platform. Rendering seems to fallback to calls to the software rasterizer, but the current line color is ignored.  Disabling direct rendering resolves the issue.  Use of Intel specific Mesa environment variables does not resolve the issue.

Will attach a simple test case to demonstrate.  

This behavior was also present on Xorg Server 1.6 and Mesa 7.5.
Comment 1 nick 2010-04-06 13:41:04 UTC
Created attachment 34726 [details]
Makefile for test case
Comment 2 nick 2010-04-06 13:41:40 UTC
Created attachment 34727 [details]
Test case to demonstrate line stipple
Comment 3 nick 2010-04-06 13:44:37 UTC
Created attachment 34728 [details]
Improper output Screenshot.  Lines should both be purple.
Comment 4 nick 2010-04-06 13:50:10 UTC
Created attachment 34729 [details]
Xorg Log
Comment 5 nick 2010-06-28 15:31:19 UTC
This change in the swrast_setup seems to fix the issue.  The color data is being incorrectly loaded from a position attribute.

File: 		mesa/swrast_setup/ss_context.c
Function: 	void _swsetup_Translate(GLcontext *ctx, const void *vertex, SWvertex *dest)

Replace
_tnl_get_attr( ctx, vertex, _TNL_ATTRIB_COLOR0,
                  dest->attrib[FRAG_ATTRIB_COL0] );
UNCLAMPED_FLOAT_TO_RGBA_CHAN( dest->color, tmp );
_tnl_get_attr( ctx, vertex, _TNL_ATTRIB_COLOR1,
                  dest->attrib[FRAG_ATTRIB_COL1]);

With:

tnl_get_attr( ctx, vertex, _TNL_ATTRIB_COLOR0,
                  dest->attrib[FRAG_ATTRIB_COL0] );
UNCLAMPED_FLOAT_TO_RGBA_CHAN( dest->color, 
                  dest->attrib[FRAG_ATTRIB_COL0] );
_tnl_get_attr( ctx, vertex, _TNL_ATTRIB_COLOR1,
                  dest->attrib[FRAG_ATTRIB_COL1]);
Comment 6 Eugeni Dodonov 2011-09-08 15:56:26 UTC
This issue is affecting a hardware component which is not being actively worked on anymore.

Moving the assignee to the dri-devel list as contact, to give this issue a better coverage.
Comment 7 nick 2011-09-09 14:40:53 UTC
Created attachment 51022 [details] [review]
Proposed patch to resolve issue

Straightforward fix to properly load dest->color with color data, as opposed to position data as previously implemented.
Comment 8 Brian Paul 2014-04-24 14:35:18 UTC
Fixed w/ commit 15c92464df07c5c0bb23a007358c560faeab76a8.