glxtest incorrectly creates the backing pixmap and causes X errors

RESOLVED FIXED in mozilla12

Status

()

Core
Graphics
RESOLVED FIXED
6 years ago
5 years ago

People

(Reporter: Nicholas Miell, Assigned: Nicholas Miell)

Tracking

Trunk
mozilla12
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

6 years ago
Created attachment 586472 [details] [diff] [review]
Fix glxtest pixmap creation

The call to XCreatePixmap() at http://mxr.mozilla.org/mozilla-central/source/toolkit/xre/glxtest.cpp#205 hardcodes the depth to be 32, while the call to glXCreatePixmap() on the next line uses the first GLXFBConfig returned by the previous glXChooseFBConfig() which doesn't necessarily have a depth of 32. 

This appears to work without error with Mesa hardware rendering, but it will cause a BadMatch error when glMakeCurrent(dpy, None, NULL) is called on line 246 with Mesa software rendering as Mesa attempts to XPutImage() a 24-bit pixmap created internally on the 32-bit pixmap supplied by Firefox. Not surprisingly, the first GLXFBConfig returned by glXChooseFBConfig() with Mesa software rendering has a depth of 24.

This has a very easy fix, change the 32 in the call to XCreatePixmap to vInfo->depth. I've tested it on Firefox 9.0.1 on a 64-bit Fedora 16 system, and Firefox now works with Mesa software rendering.

Comment 1

6 years ago
Moving over to Toolkit -> General for further triage.
Status: UNCONFIRMED → NEW
Component: General → General
Ever confirmed: true
Product: Firefox → Toolkit
QA Contact: general → general
Version: unspecified → Trunk

Updated

6 years ago
Attachment #586472 - Flags: review?(bjacob)
Component: General → Graphics
Product: Toolkit → Core
QA Contact: general → thebes
Comment on attachment 586472 [details] [diff] [review]
Fix glxtest pixmap creation

Review of attachment 586472 [details] [diff] [review]:
-----------------------------------------------------------------

Many thanks for the debugging and the patch!
Attachment #586472 - Flags: review?(bjacob) → review+
Also, support for Mesa software rendering is very important as it's the only way to make WebGL support ubiquitous without involving proprietary software (Mesa seems to be the only competitive open source software OpenGL implementation).
http://hg.mozilla.org/integration/mozilla-inbound/rev/23d71e342b3e
Assignee: nobody → nmiell
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla12

Updated

6 years ago
Whiteboard: [needs landing]
Whiteboard: [needs landing]

Comment 5

6 years ago
https://hg.mozilla.org/mozilla-central/rev/23d71e342b3e
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.