Opened 19 years ago
Closed 19 years ago
#2103 closed task (fixed)
The view is shifted 50% to the left in many OpenGL apps on ati video cards
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | normal | Milestone: | 6.2.0 |
Component: | BOOK | Version: | SVN |
Severity: | major | Keywords: | |
Cc: |
Description ¶
This is a duplicate of https://bugs.freedesktop.org/show_bug.cgi?id=6046
The patch attached there fixes the problem only for r300 cards, and is thus incomplete. A workaround that works for all cards is to change the "make linux-dri" command in Mesa instructions to:
make OPT_FLAGS="-O2 -pipe -fno-strict-aliasing" linux-dri-x86
The important part is -fno-strict-aliasing.
Change History (5)
comment:1 by , 19 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:2 by , 19 years ago
That's even the workaround recommended by Mesa developers: "That said, there are still potential aliasing problems in the code, I'd suggest you compile with -fno-strict-aliasing for the time being."
comment:3 by , 19 years ago
If you were asking about "-fno-strict-aliasing for everything, not just Mesa", +1. The LiveCD already does this, because there were too many issues without this flag. Slirp (both standalone and as a part of qemu), MySQL, and Mesa come to mind, and the breakage is at runtime in all such cases.
comment:4 by , 19 years ago
Going to add -fno-strict-aliasing. I do agree with the use of linux-dri-x86 since the book only supports x86 and it adds a few nice things on top of the linux-dri target. Plus, anyone using a different arch following the book should be able to figure out how to substitute the correct config file. Here's the linux-dri-x86 config file:
# -*-makefile-*- # Configuration for linux-dri: Linux DRI hardware drivers for XFree86 & others include $(TOP)/configs/linux-dri CONFIG_NAME = linux-dri-x86 # Unnecessary on x86, generally. PIC_FLAGS = # Add -m32 to CFLAGS: ARCH_FLAGS = -m32 ASM_FLAGS = -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM ASM_SOURCES = $(X86_SOURCES) ASM_API = $(X86_API)
However, although '-O2 -pipe' are very safe CFLAGS, we don't set the optimization flags anywhere else in the book (that I know of). Instead, I'm plan to add this sed:
sed -i 's/^OPT_FLAGS =.*/& -fno-strict-aliasing/' configs/linux-dri
Anyone who knows what they're doing can always override OPT_FLAGS at build time.
Comments on the change from the linux-dri target to the linux-dri-x86 target and the above sed?
comment:5 by , 19 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Changed my mind on both things. I'm passing OPT_FLAGS="-O2 -fno-strict-aliasing" to the make command. This is the correct way to do things with make. And there are a couple other places in the book where we do things like this.
And I changed the target to linux-dri-x86. It adds a few nice flags that would probably added if a typical configure script is used. I mentioned the location to look for other targets if the arch isn't x86.
Fixed in r6324.
I haven't given this much thought as I have an r200 card and these things work fine for me.
Alexander, do you think it's fine to add -fno-strict-aliasing for everything? Surely it can't hurt. This seems like an easy workaround.