summaryrefslogtreecommitdiff
path: root/src/smi_driver.c
AgeCommit message (Collapse)Author
2015-05-09Fix a couple const-ness warningsJulien Cristau
smi_accel.c: In function 'SMI_GEReset': smi_accel.c:51:1: warning: passing argument 4 of 'SMI_GEReset' discards 'const' qualifier from pointer target type WaitIdle(); ^ smi_accel.c:38:1: note: expected 'char *' but argument is of type 'const char *' SMI_GEReset(ScrnInfoPtr pScrn, int from_timeout, int line, char *file) ^ [...] smi_driver.c: In function 'SMI_DetectPanelSize': smi_driver.c:1011:12: warning: assignment discards 'const' qualifier from pointer target type if ((s = xf86GetOptValString(pSmi->Options, OPTION_PANEL_SIZE)) != NULL) { ^ Signed-off-by: Julien Cristau <jcristau@debian.org>
2015-05-09Fix SwitchMode and AdjustFrame hooksJulien Cristau
smi_driver.c: In function 'SMI_Probe': smi_driver.c:360:24: warning: assignment from incompatible pointer type pScrn->SwitchMode = SMI_SwitchMode; ^ smi_driver.c:361:24: warning: assignment from incompatible pointer type pScrn->AdjustFrame = SMI_AdjustFrame; ^ Signed-off-by: Julien Cristau <jcristau@debian.org>
2013-01-09Remove miInitializeBackingStore()Adam Jackson
Signed-off-by: Adam Jackson <ajax@redhat.com>
2012-07-17smi: convert to new X server screen conversion apis.Dave Airlie
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-07-17smi: port to compat-api for new server.Dave Airlie
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-07-17smi: fix build against XAA-less serverDave Airlie
2011-12-19Fix for new vgaHW ABIAdam Jackson
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-12-19Make failure to XAA non-fatalAdam Jackson
No shadowfb support in this driver yet. Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-11-17Check ABI major not encoded ABIAdam Jackson
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-11-16Adapt to missing PIOOffset in videoabi 12Adam Jackson
Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-02-27Replace calls to xalloc/xcalloc/xfree with malloc/calloc/freeJulien Cristau
Also don't check for NULL before calling free(). Signed-off-by: Julien Cristau <jcristau@debian.org>
2011-02-27Fix compiler warning on 64bitJulien Cristau
src/smi_driver.c: In function ‘SMI_MapMem’: src/smi_driver.c:1498: warning: format ‘%08lX’ expects type ‘long unsigned int’, but argument 6 has type ‘CARD32’ Signed-off-by: Julien Cristau <jcristau@debian.org>
2011-02-27Fix build with xserver 1.10Julien Cristau
ScrnInfo->pixmapPrivate is gone Signed-off-by: Julien Cristau <jcristau@debian.org>
2009-08-05fix build after headers movedxf86-video-siliconmotion-1.7.3Dave Airlie
2009-07-28siliconmotion: change to using ABI version checkDave Airlie
2009-07-28siliconmotion: update for resources/RAC API removalDave Airlie
2009-07-16Update to xextproto 7.1 support.Peter Hutterer
DPMS header was split into dpms.h (client) and dpmsconst.h (server). Drivers need to include dpmsconst.h if xextproto 7.1 is available. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-05-28Remove useless loader symbol lists.Adam Jackson
2009-05-27Program MCLK/MXCLK on startup for a secondary SM502.Francisco Jerez
This should allow using a SM502 as secondary display device (bug 21810).
2009-05-05Fail gracefully when the specified virtual screen doesn't fit in RAM.Francisco Jerez
2009-05-05Probe the amount of installed memory by trial and error on SM712.Francisco Jerez
In some cases the BIOS hasn't filled in the "scratchpad registers" (SR71) with the right amount of memory installed (e.g. MIPS platform). There seems to be no other way to do it than to test it. This should fix bug 21528.
2009-04-21Increase the maximum clock value to 200MHz on SM712.Francisco Jerez
The default MCLK setting was higher than the clock limit, and it failed.
2009-02-11siliconmotion: Fix disabling of debugging if SMI501_CLI_DEBUG is set to 0Niels de Vos
Due to checking if SMI501_CLI_DEBUG is defined, some debugging will be enabled if SMI501_CLI_DEBUG is set to 0. A single #if should be used instead. Some debugging code already does this. Signed-off-by: Niels de Vos <niels.devos@wincor-nixdorf.com> Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2009-02-04Set dualhead to on by default on SM72x chipsets.Francisco Jerez
2008-12-29Use util-macros XORG_CHANGELOG and XORG_CWARNFLAGS.Paulo Cesar Pereira de Andrade
Also correct only compilation warning about possibly uninitialized variable.
2008-12-29Some more quirks for the SM712.Francisco Jerez
* Program the MCLK to 157MHz on startup. * Adjust the requested pixel clock if it's near one of the known stable frequencies. * Prefer the clock alternative with post scalar turned on when the denominator is even.
2008-12-19Enable the SMI 501/502 command list interpreter in a "debug" build.Paulo Cesar Pereira de Andrade
To enable it, set SMI501_CLI_DEBUG to 1 in smi.h, and use Option "AcellMethod "EXA" in the Device section of /etc/X11/xorg.conf This code is enabled mainly for debug purposes. To make if have an actual performance gain (like when using a sm50x with a "low profile" "main" processor") it should be required to actually do busy loops in kernel mode (and hope the costs of context switch will pay it). In kernel mode it is possible to wait for an interrupt being triggered when the command list is processed, or when the 2d engine is idle. This commit should be functional, but, mainly due to debug messages, should be significantly slower then a build with MI501_CLI_DEBUG defined to 0.
2008-12-18Add definitions for the SMI 501/502 "command list interpreter".Paulo Cesar Pereira de Andrade
This also changes some bit operations to use a "bitfield" equivalent one, with named fields, that should make it easier to understand what is being tested. The enum smi_cli_cmd_code in smi_501.h is code that was added to a experimental smi_drm.h, but the hardware only supports basic 2d accel, and to compensate for the extra overhead for maintaining a command list (assuming it worked correctly) it would be required to have a special handling, like calling an ioctl to do the "busy loop" in the kernel (that is, should wait for an irq or a timeout). The problem is that even if waiting for a idle engine before crafting a command, and waiting again after submitting the command, there would be corruption on screen after some time. So, the "busy loop" in the kernel would only be useful if still using direct writes to mmio registers.
2008-12-17Fix crashes when switching VTs with EXA enabled.Francisco Jerez
Call ModifyPixmapHeader on SMI_EnterVT to update the screen pixmap address tracked by EXA. Set memoryBase in the ExaDriverRec to NULL when switching out: some pixmap could get allocated near the former aperture address and it could be erroneously considered as being in offscreen memory.
2008-12-17Enable linear memory mode on SMI_MapMmio.Francisco Jerez
Set UseBIOS to off by default for SM720. Some improvements on the debugging output.
2008-12-17Fall back to UseBIOS off when VBEInit fails.Francisco Jerez
2008-12-13Janitor/maintenance patches.Paulo Cesar Pereira de Andrade
o Define HAVE_XMODES in config.h. o Correct the LEAVE() macro declaration when SMI_DEBUG is defined. o Remove prototype for SMI_DGAInit() if HAVE_XMODES is not defined. o Properly scale value read from sm501 CURRENT_CLOCK register, to print an appropriate message on startup.
2008-12-12Unless there is a xorg.conf option, don't modify mclck neither mxclck.Paulo Cesar Pereira de Andrade
The option set_mclck was renamed to just MCLK, and a new MXCLCK option was added for smi501/502 chips. Note that previously, on MSOC chips, the set_mclck option actually changed mxclck, what is now done by the MXCLK option. The manpage was also update to reflect the options usage. A new SMI501_FindMemClock() function was added, as a possible placeholder for choosing alternate clocks when programming MMIO 0x68. But it should be noted that the smi 501 databook says: Miscellaneous Timing Read/Write MMIO_base + 0x000068 Power-on Default 0x00000000 [...] 5:4 Divider Output Frequency Selection for Second PLL. 00: 336 MHz. 01: 288 MHz. 10: 240 MHz. 11: 192 MHz. while the 502 databook says: Miscellaneous Timing Read/Write MMIO_base + 0x000068 Power-on Default 0b0000.00xx.0000.1001.0000.1001.0000.0000 [...] 5:4 Reserved These bits are reserved. but still tells to refer to those bits.
2008-11-28DGA is dependent on HAVE_XMODES.Paulo Cesar Pereira de Andrade
2008-11-25Remove smi_dga.c and polylines code from smi_xaa.c.Paulo Cesar Pereira de Andrade
DGA was also not being properly test to not enable the pSmi fields, but since the dga implementation is very basic, it is better to just remove it (if compiling the sources on pre 1.4 X Server, DGA will be disabled). The polylines code in xmi_xaa.c was already if 0'ed for some time, but it may be reinstantiated to accelerate (back) xaa rotated modes. Currently only randr+exa accelerates rotated modes.
2008-11-25Ensure the engine is idle before switching to a virtual terminal.Paulo Cesar Pereira de Andrade
At least in the smi501/502, it may even completely lock in some special cases (like when there is a browser playing some youtube video). The code in SMI_CloseScreen() was almost identical to SMI_LeaveVT(), so it now just call SMI_Leave() if required.
2008-11-24Use a single debug macro for leaving functions.Paulo Cesar Pereira de Andrade
The LEAVE() macro, when debug is disabled, now is defined as: <hash>define LEAVE(...) return __VA_ARGS__ This avoids the requirement of a return statement after the LEAVE() macro call, what can be confusing.
2008-11-14Don't explicitly call the cursor routines.Paulo Cesar Pereira de Andrade
On the MSOC, the hardware cursor was remaining on screen, when using EXA and a randr rotated mode.
2008-11-14Only compile smi_dga.c when xf86DiDGAInit is not available.Paulo Cesar Pereira de Andrade
Besides reducing driver size, this should make DGA+EXA accelerated.
2008-11-13Enable gamma correction on the MSOC.Paulo Cesar Pereira de Andrade
2008-11-11Implement an argb cursor using the alpha layer.Paulo Cesar Pereira de Andrade
The code is <hash>ifdef'ed out by <hash>if SMI_CURSOR_ALPHA_PLANE because the smi 502 hardware is buggy, but it appears to have worked for some older hardware revisions (by looking at code available at ftp.siliconmotion.com.tw). Keeping it at least for now, as it serves as a simple way to reproduce the problems described in smi.h.
2008-11-08Remove unused fifo_* options.Francisco Jerez
2008-11-08Remove the ZoomOnLCD option and update manpage for PCIRetry.Paulo Cesar Pereira de Andrade
ZoomOnLCD controlled if Ctrl/Alt/+ or Ctrl/Alt/- could be used to reprogram the mode on the panel. The option was not used, and now, if different resolutions could be used, it should be advertised by randr. PCIBurst and PCIRetry options are now enabled by default. The fifo_xxx options need a review, as they appear to be associated with the older WaitQueue macro, that did ignore its argument. But these options are not used, and may be removed or reimplemented at some time.
2008-11-04Add CSCVideo option to smi 501/502.Paulo Cesar Pereira de Andrade
This code is an adaptation of SMI sample implementation. CSCVideo is an alternate way to render video, that should reduce memory bandwidth usage, and uses the color space conversion hardware to render video directly to the framebuffer memory. When using randr dual head mode, currently only XAA is supported. As it has a fixed format framebuffer (when using the Virtual xorg.conf option). This patch also ensures that pScrn->displayWidth, pScrn->virtualX and pScrn->virtualY are only changed by the driver when using EXA.
2008-10-30 Update memory detection for MSOC.Paulo Cesar Pereira de Andrade
Use "local memory" field of mmio 0x010 and not "system memory", as it uses system memory values whenever there is a choice (just sets bits to zero).
2008-10-30 Disable HW cursor in dualhead mode in smi 501/502Paulo Cesar Pereira de Andrade
Other chipsets are doing the same. But this apparently is to circumvent a problem in randr/cursor implementation, that appears to not work very well with hardware that supports two hw cursors, but not argb cursors.
2008-10-29 SMI501/502 cursor fixes.Paulo Cesar Pereira de Andrade
Use separate buffers for crt and panel hw cursors. Describe, and workaround a problem with Dualhead and hw cursor enabled. It still has the inconvenient of having a blinking X when exiting the server or switching to a VT; maybe should also save the image currently configured also (and restore on exit), or just disable hw cursor on dual head mode. Also revert change to not initialize video on dualhead. Better to have fully functional video only on panel, that can be resized, then non resizable video..
2008-10-28Update msoc to use randr cursor routinesPaulo Cesar Pereira de Andrade
pSmi->IsSecondary was not used, and there should not exist two instances of the driver managing the same card. Macro CHECK_SECONDARY() was dependant on a second instance of the driver for the same card, and also removed. Some rework should still be done in the cursor code, as it sometimes, when displaying different data, will leave the hw cursor visible, while using an argb cursor.
2008-10-28Remove shadowfb based rotation support.Francisco Jerez
Also done some clean up, like removing unused/redundant members of the screen private structure, and removing now unused configuration file options.
2008-10-28Lynx hardware cursor code adapted to the CRTC interfaces.Francisco Jerez