While the compilation script was updated, for some reason, the source
code did not get the update.
Signed-off-by: Kevin Brace <kevinbrace@gmx.com>
Reviewed-by: Connor Behan <connor.behan@gmail.com>
This patch is still untested, but it sounds like a lot of people need
it. Assuming that there are no monitors when DDC fails (which causes X
to abort with UMS) does not make sense. Some people will always have DDC
fail. For example, the pins are not connected on an iMac G3. For another
example, some RAGE128TF cards are known to lie that there is no VGA port
in the connector table.
Signed-off-by: Connor Behan <connor.behan@gmail.com>
A RAGE128TR chipset with a VGA port uses different i2c clock bits than
the VGA cards previously tested. It seems reasonable to assume that
other Pro2 cards are set up this way as well. In case this is incorrect,
a newly added xf86I2CProbeAddress() should still allow a monitor to be
detected.
Signed-off-by: Connor Behan <connor.behan@gmail.com>
Tested-by: Tobias Powalowski <tobias.powalowski@googlemail.com>
It appears that not all r128 chipsets marked as DFP capable have DVI
ports. Some have VGA which we should detect. The old driver "detected"
this by attempting a DVI based probe for monitors. Anything that failed
this was assumed to be VGA.
Signed-off-by: Connor Behan <connor.behan@gmail.com>
Tested-by: Tobias Powalowski <tobias.powalowski@googlemail.com>
In the past, pR128Ent was only used for Xinerama-style dualhead and
therefore only allocated for cards with two outputs. However, recent
patches have repurposed pR128Ent as a general struct for things that are
card-specific instead of instance-specific. It therefore needs to be
allocated for all cards.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=89236
Signed-off-by: Connor Behan <connor.behan@gmail.com>
Tested-by: Tobias Powalowski <tobias.powalowski@googlemail.com>
Apparently, the text mode driver can use either register to store the
pixel clock. The assumption made previously was apparently corrupting
the console on PowerPC systems. Thanks to Michael Lorenz for the patch.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=32606
Signed-off-by: Connor Behan <connor.behan@gmail.com>
As of commit e31564e1a21e73f4d20d6471da4fc7a9b63e4062, the xserver is
more picky about the order in which headers are included. We need to
account for this in order for the compile time exa.h check to succeed.
Signed-off-by: Connor Behan <connor.behan@gmail.com>
Some declarations of pScrn are only there for debugging purposes. This
should make gcc quieter on most systems.
Signed-off-by: Connor Behan <connor.behan@gmail.com>
Since the driver uses PanelXRes and PanelYRes to calculate stretch
ratios, it should try harder to set them. For LVDS, we need to move the
xorg.conf check so that it executes before the BIOS check. For DVI, we
should read them from the mode that the X server has identified as being
the native one. Even then, PanelXRes and PanelYRes are not guaranteed to
be positive, so the driver should verify this before dividing by them.
Another problem with the old panel code was that PanelPwrDly had no sane
default. It was also missing the check for Rage Pro 2 which lacks RMX.
Signed-off-by: Connor Behan <connor.behan@gmail.com>
I have yet to see a use for the DGA code included in the driver.
According to radeon commits, it should be safe to replace it with DiDGA.
Signed-off-by: Connor Behan <connor.behan@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
There are probably no reasons left to use Xinerama over xrandr. This
removes the screen based dualhead code and the BIOS Display option in
xorg.conf. Additionally, R128ValidMode() is wrapped so that it can be
aware of multiple displays.
Even though some Crtc functions refer to them, PanelXRes and PanelYRes
should be properties of the Output. If this change to the code seems
awkward, see http://marc.info/?t=107222330700001 for more information.
Signed-off-by: Connor Behan <connor.behan@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Checking for OUTPUT_DVI is not the same as checking for MT_DFP. There
might be r128 cards with a DVI-I connector. These have the capability of
driving an MT_CRT so we now check the monitor type before programming
DAC or TMDS registers.
This patch also removes R128ConnectorType and R128BIOSConnector because
they were not doing much. These data structures are more useful for the
radeon driver where there is a much wider range of cards.
Signed-off-by: Connor Behan <connor.behan@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
The cursor loading function was using a lot of code to swap bytes for
big endian systems. For awhile now, the solid picture support for EXA
has had a more optimized function that does the same thing.
Signed-off-by: Connor Behan <connor.behan@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
RandR and Xv were using almost the same code to grab offscreen memory
from EXA and XAA.
Signed-off-by: Connor Behan <connor.behan@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
To fix another warning, we need to be consistent about when we use
CARD32 an when we use uint32_t. Xorg developers have decided on the
latter as a convention.
Signed-off-by: Connor Behan <connor.behan@gmail.com>
This removes a debug line to fix a compiler warning and make the
crtc1 and crtc2 code more symmetric. The number of bits per pixel is
easy to find out anyway.
Signed-off-by: Connor Behan <connor.behan@gmail.com>
This removes some dead code from info. It also fixes some indentation
errors that were likely caused by sed.
Signed-off-by: Connor Behan <connor.behan@gmail.com>
This moves HasCRTC2 into the entity to make it more similar to radeon.
It also removes IsDRIEnabled for being dead code.
Signed-off-by: Connor Behan <connor.behan@gmail.com>
This ensures that DAC, TMDS and LVDS enable bits are properly saved and
only set in the dpms hook.
Signed-off-by: Connor Behan <connor.behan@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
The old code was writing registers more often than it needed to. TMDS
writes were triggered by changing the mode for an LVDS panel and RMX
writes were triggered by changing the mode for the second crtc. This
splits TMDS, LVDS, DAC and RMX calls into their own functions.
Also note that routing bits have been specified. R128_FP_SEL_CRTC2 and
R128_LVDS_SEL_CRTC2 are always unset to make the panels use the first
crtc. R128_DAC_CRT_SEL_CRTC2 is unset unless LVDS is already using the
first crtc.
Signed-off-by: Connor Behan <connor.behan@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Now that the MMIO stays mapped during several function calls, we need to
remember to unmap it if any of them fail. This also fixes a PowerPC code
path that was not updated to work with the longer lived MMIO.
Signed-off-by: Connor Behan <connor.behan@gmail.com>
This rearranges the r128 code to use the Crtc and Output interfaces
which should make the driver easier to maintain in the long run. User
visible changes include DDC detection working in more cases and the
ability to have multiple monitors with DRI.
Some choices have been made to conserve memory. Modes can be switched up
to the highest resolution in xorg.conf. If this is 1024x768 for example,
the front buffer will be 1024x768 instead of 1024x1024. This means 90
and 270 degree rotations will not work. However, scalings, reflection
and 180 degree rotations can be set with the xrandr client program.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=75629
Signed-off-by: Connor Behan <connor.behan@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
COMPOSITE_SETUP() involves expensive register writes so
R128EnterServer() should call it once when there are 3D windows and 0
times when there are no 3D windows.
Instead the code was calling it once when there were no 3D windows and
arbitrarily many times when there were 3D windows.
Signed-off-by: Connor Behan <connor.behan@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
If libpciaccess is available, we do not need to declare the deprecated
PciTag member because it will not be used.
Signed-off-by: Connor Behan <connor.behan@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
The EXA Composite hooks should not overwrite any register values
expected by DRI. Initial testing of the EXA support revealed that
R128_WINDOW_XY_OFFSET is one register where we have to be careful.
However, it was mostly tested using glxgears which does not stress the
driver very much. Going through the various 3D screensavers one by one
reveals a bug where certain models turn green if compositing is enabled.
It seems that if we slightly alter the values passed to R128_SETUP_CNTL
and R128_PM4_VC_FPU_SETUP, the 3D driver will be happy and compositing
will still work. The proper way would be to constantly save and restore
register values but this showed poor performance when dragging 3D
windows across the screen.
Signed-off-by: Connor Behan <connor.behan@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Some PowerPC users were reporting color errors that only happened with
EXA+DRI. This implements a recent bugfix in the Radeon driver which will
solve at least one of these problems.
Signed-off-by: Connor Behan <connor.behan@gmail.com>
Definition was deleted from Xorg during 1.14 merge window, but has been
a no-op since 1.10 merge window.
Signed-off-by: Connor Behan <connor.behan@gmail.com>
If we are using a resolution lower than the native resolution of the
flat panel, the video overlay needs to know this. Otherwise a black bar
appears beneath the video. This is essentially Conn's patch from the bug
tracker except it doesn't always rely on info->PanelYRes. ACPI events
can change this without the driver's knowledge.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=6493
Signed-off-by: Connor Behan <connor.behan@gmail.com>