Bug 271140 - In opengltest.cpp, handle change in Mesa GL_RENDERER string for Intel chips as of Mesa-7.10.1
Summary: In opengltest.cpp, handle change in Mesa GL_RENDERER string for Intel chips a...
Status: RESOLVED DUPLICATE of bug 270942
Alias: None
Product: kwin
Classification: Unclassified
Component: scene-opengl (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR wishlist (vote)
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-17 01:05 UTC by John Stanley
Modified: 2011-04-20 23:09 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Stanley 2011-04-17 01:05:20 UTC
Version:           unspecified (using KDE 4.6.2) 
OS:                Linux

It appears that as of Mesa-7.10.1, "GEM"+'driver date' is no longer included in Intel card gl_renderer strings.  For example, an Intel 865G now gives the string: Mesa DRI Intel(R) 865G  x86/MMX/SSE2

For reference, see intel_context.c in the Mesa-7.10.{1,2} drivers/dri source tree.

As "GEM" no longer is present, erroneous opengltest failures result for these cards. As a simple fix I have used the following simple patch to opengltest.cpp:

--- kdebase-workspace-4.6.2.old/kwin/opengltest/opengltest.cpp  2011-02-25 16:54:49.000000000 -0500
+++ kdebase-workspace-4.6.2.new/kwin/opengltest/opengltest.cpp  2011-04-16 17:59:45.949998443 -0400
@@ -86,10 +86,15 @@
     if (strstr((const char *)renderer, "DRI2"))
         return 0;
 
-    // The Intel driver doesn't have DRI2 in the renderer string
+    // The Intel driver doesn't have DRI2 in the renderer string (Mesa-7.10.1 and earlier)
     if (strstr((const char *)renderer, "GEM"))
         return 0;
 
+    // As of Mesa-7.10.1, "GEM"+'driver date' is no longer included in Intel card gl_renderer
+    // strings, eg, an Intel 865G now gives the string: Mesa DRI Intel(R) 865G  x86/MMX/SSE2
+    if (strstr((const char *)renderer, "Intel") && strstr((const char *)renderer, "DRI"))
+        return 0;
+
     if (strstr((const char *)renderer, "Gallium"))
         return 0;
 


Reproducible: Always

Steps to Reproduce:
Start kde

Actual Results:  
As of Mesa-7.10.1, Intel cards result in opengltest fails 

Expected Results:  
opengltest should pass for these cards
Comment 1 John Stanley 2011-04-17 01:13:48 UTC
In the patch above the comment line:

+    // The Intel driver doesn't have DRI2 in the renderer string (Mesa-7.10.1
and earlier)

should read:

+    // The Intel driver doesn't have DRI2 in the renderer string (Mesa-7.10
and earlier)

John
Comment 2 John Stanley 2011-04-17 01:28:34 UTC
In the patch above, the comment:

+    // The Intel driver doesn't have DRI2 in the renderer string (Mesa-7.10.1
and earlier)

should read:

+    // The Intel driver doesn't have DRI2 in the renderer string (Mesa-7.10
and earlier)

Sorry about that,
John
Comment 3 Martin Flöser 2011-04-17 15:09:32 UTC
Sorry but the patch is unacceptable for 4.6 as it might cause a regression. I am not willing to change that code. I am sick of the external breakage and the change in the driver is completly unacceptable. This has to be reverted in the driver!

I have prepared a rant to be published on planetkde as soon as my laptop finds some wifi.
Comment 4 John Stanley 2011-04-18 00:12:28 UTC
(In reply to comment #3)
> Sorry but the patch is unacceptable for 4.6 as it might cause a regression. I
> am not willing to change that code. I am sick of the external breakage and the
> change in the driver is completly unacceptable. This has to be reverted in the
> driver!
> 
> I have prepared a rant to be published on planetkde as soon as my laptop finds
> some wifi.

I tend to agree. I'll post to Mesa devel to try to get an explanation for the change.
Comment 5 Ian Romanick 2011-04-20 01:49:29 UTC
(In reply to comment #3)
> Sorry but the patch is unacceptable for 4.6 as it might cause a regression. I
> am not willing to change that code. I am sick of the external breakage and the
> change in the driver is completly unacceptable. This has to be reverted in the
> driver!

Using undocumented "interfaces" that are not part of the driver ABI is completely unacceptable.  KDE is using the existence of the string "GEM" in the GL_RENDERER string to determine if the driver is using DRI2.  This is completely bogus.  "GEM" was exported in the GL_RENDERER string long before work was even started on DRI2.

Applications should instead use DRI2QueryVersion to detect DRI2 support.  This function is documented and is part of the ABI.  Random text in the GL_RENDERER string is neither.
Comment 6 Antonis K 2011-04-20 16:33:41 UTC
This bug report is a duplicate of https://bugs.kde.org/show_bug.cgi?id=270942
Comment 7 Thomas Lübking 2011-04-20 17:33:54 UTC
correct

*** This bug has been marked as a duplicate of bug 270942 ***
Comment 8 Thomas Lübking 2011-04-20 17:53:03 UTC
@Ian
Since you changed the string and out of curiosity:
why exactly was the string changed(and please don't reply "because it's ok to do that" - i'm not debating but asking because the commit message is a bit "vague"
Comment 9 Ian Romanick 2011-04-20 23:09:04 UTC
(In reply to comment #8)
> @Ian
> Since you changed the string and out of curiosity:
> why exactly was the string changed(and please don't reply "because it's ok to
> do that" - i'm not debating but asking because the commit message is a bit
> "vague"

The information in the GL_RENDERER string is information that we put there to help us debug problems on user's machines.  There are two bits of information that we put there for that purpose:

1. Information to help us know exactly what version of the driver is being used.

2. Information to help us know how the user's software / hardware is configured.

The information that was removed was information that was either incorrect or useless for those purposes.