http://qa.mandrakesoft.com/show_bug.cgi?id=5290
[EMAIL PROTECTED] changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |[EMAIL PROTECTED]
AssignedTo|[EMAIL PROTECTED]|[EMAIL PROTECTED]
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
------- Additional Comments From [EMAIL PROTECTED] 2003-05-09 20:51 -------
Hmm, apparently, this bug is fixed in Xrender CVS differently :
revision 1.18
date: 2003/06/23 21:12:08; author: keithp; state: Exp; lines: +83 -3
Make Xrender depth checks work with broken Xinerama code
--- Xrender.c 8 Jun 2003 17:56:37 -0000 1.17
+++ Xrender.c 23 Jun 2003 21:12:08 -0000 1.18
@@ -80,6 +80,33 @@
DEPTH_MASK(24) | \
DEPTH_MASK(32))
+typedef struct _DepthCheckRec {
+ struct _DepthCheckRec *next;
+ Display *dpy;
+ CARD32 missing;
+ unsigned long serial;
+} DepthCheckRec, *DepthCheckPtr;
+
+static DepthCheckPtr depthChecks;
+
+static int
+XRenderDepthCheckErrorHandler (Display *dpy, XErrorEvent *evt)
+{
+ if (evt->request_code == X_CreatePixmap && evt->error_code == BadValue)
+ {
+ DepthCheckPtr d;
+ _XLockMutex(_Xglobal_lock);
+ for (d = depthChecks; d; d = d->next)
+ if (d->dpy == dpy)
+ {
+ if ((long) (evt->serial - d->serial) >= 0)
+ d->missing |= DEPTH_MASK(evt->resourceid);
+ break;
+ }
+ _XUnlockMutex (_Xglobal_lock);
+ }
+}
+
static Bool
XRenderHasDepths (Display *dpy)
{
@@ -88,13 +115,66 @@
for (s = 0; s < ScreenCount (dpy); s++)
{
CARD32 depths = 0;
+ CARD32 missing;
Screen *scr = ScreenOfDisplay (dpy, s);
int d;
for (d = 0; d < scr->ndepths; d++)
depths |= DEPTH_MASK(scr->depths[d].depth);
- if (~depths & REQUIRED_DEPTHS)
- return False;
+ missing = ~depths & REQUIRED_DEPTHS;
+ if (missing)
+ {
+ DepthCheckRec dc, **dp;
+ XErrorHandler previousHandler;
+
+ /*
+ * Ok, this is ugly. It should be sufficient at this
+ * point to just return False, but Xinerama is broken at
+ * this point and only advertises depths which have an
+ * associated visual. Of course, the other depths still
+ * work, but the only way to find out is to try them.
+ */
+ dc.dpy = dpy;
+ dc.missing = 0;
+ dc.serial = XNextRequest (dpy);
+ _XLockMutex(_Xglobal_lock);
+ dc.next = depthChecks;
+ depthChecks = &dc;
+ _XUnlockMutex (_Xglobal_lock);
+ /*
+ * I suspect this is not really thread safe, but Xlib doesn't
+ * provide a lot of options here
+ */
+ previousHandler = XSetErrorHandler (XRenderDepthCheckErrorHandler);
+ /*
+ * Try each missing depth and see if pixmap creation succeeds
+ */
+ for (d = 1; d <= 32; d++)
+ /* don't check depth 1 == Xcursor recurses... */
+ if ((missing & DEPTH_MASK(d)) && d != 1)
+ {
+ Pixmap p;
+ p = XCreatePixmap (dpy, RootWindow (dpy, s), 1, 1, d);
+ XFreePixmap (dpy, p);
+ }
+ XSync (dpy, False);
+ XSetErrorHandler (previousHandler);
+ /*
+ * Unhook from the list of depth check records
+ */
+ _XLockMutex(_Xglobal_lock);
+ for (dp = &depthChecks; *dp; dp = &(*dp)->next)
+ {
+ if (*dp == &dc)
+ {
+ *dp = dc.next;
+ break;
+ }
+ }
+ _XUnlockMutex (_Xglobal_lock);
+ if (dc.missing)
+ return False;
+ }
}
return True;
}
Anyway, I'll use keith patch and fix XFree86
--
Configure bugmail: http://qa.mandrakesoft.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
------- Reminder: -------
assigned_to: [EMAIL PROTECTED]
status: NEW
creation_date:
description:
Xrender library does not initialize unless all possible depths
are available on the screen (1, 4, 8, 24, 32) because the code
that checks it in xc/lib/Xrender/Xrender.c has line:
if (~depths & REQUIRED_DEPTHS)
return False
The line is coming from XFree86.spec Patch7.
According to comments, any of the depths should be enough, so
the condition should be changed to
if ((depths & REQUIRED_DEPTHS) == 0)
return False
I noticed this because I just upgraded one 9.1 machine to cooker few days
ago and QT no longer anti-aliased and the system and especially konqueror
was very unstable. With this one line change, anti aliasing started
working and konqueror no longer freezes. This machine has just 24 bit
depth available on the screen (Matrox G550 dual with Xinerama).