summaryrefslogtreecommitdiff
path: root/src/smi_video.c
AgeCommit message (Collapse)Author
2024-05-22drop obsolete check for REGION_NULLHEADmasterEnrico Weigelt, metux IT consult
Since we're relying on at least xserver 1.18, we know that symbol exists. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-video-siliconmotion/-/merge_requests/6>
2024-05-18Raise minimum supported Xserver version to 1.18 (ABI_VIDEODRV_VERSION 20.0)Alan Coopersmith
Already effectively required by use of XNFcallocarray() introduced in xorg/xserver@b96dc999 - xserver-1.18.0, released in Nov. 2015. Allows dropping remnants of code for XAA and pre-pciaccess X servers Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-video-siliconmotion/-/merge_requests/7>
2022-12-15Replace malloc()+memset() with calloc()Alan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-12-15Replace malloc()+snprintf() with Xasprintf()Alan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-12-15Quiet -Wempty-body warningAlan Coopersmith
smi_video.c: In function ‘SetAttrSAA7111’: smi_video.c:802:33: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body] if ((j&7) == 7) DEBUG("\n"); ^ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-12-15constify some char * declarationsAlan Coopersmith
Clears 6 of 17 -Wdiscarded-qualifiers warnings from gcc Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-01-28Fix spelling/wording issuesAlan Coopersmith
Found by using: codespell --builtin clear,rare,usage,informal,code,names Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2015-05-08Fix shadow compiler warningJulien Cristau
smi_video.c: In function 'SetAttrSAA7111': smi_video.c:795:6: warning: declaration of 'i' shadows a parameter [-Wshadow] int i; ^ smi_video.c:723:39: warning: shadowed declaration is here [-Wshadow] SetAttrSAA7111(ScrnInfoPtr pScrn, int i, int value) ^ Signed-off-by: Julien Cristau <jcristau@debian.org>
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>
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>
2010-06-22xv: Make sure we have a CRTC before setting up the overlay.Francisco Jerez
Fixes a segfault when the destination area is off screen. Signed-off-by: Francisco Jerez <currojerez@riseup.net> Tested-by: Krzysztof Halasa <khc@pm.waw.pl>
2010-02-08Fix lack of precision in video resizing. #26443Cedric Cellier
On some videos the last displayed line was wrong. This can be fixed using LynxEM+ VPR68. Code borrowed from siliconmotion's in-house driver. Also fix a typo. Signed-off-by: Cedric Cellier <rixed@happyleptic.org> Signed-off-by: Francisco Jerez <currojerez@riseup.net>
2009-02-04Dynamically switch virtual refresh mode.Francisco Jerez
Probably this makes dualhead mode more useful because it makes possible displaying video on the LCD as long as the CRT output is disabled or cloned.
2008-12-29Simplification and redundancy removal in video code.Paulo Cesar Pereira de Andrade
FOURCC_YV12 and FOURCC_I420 handling also was buggy. First it was doing a noop by swapping offset2 and offset3 values twice, and second, swap is not required when using smi 501/502 CSC video. Changed SMI_DisplayVideo0501_CSC() to not set static values to registers in a possible loop, if there is clipping.
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-17Enable XAA and randr rotated modes.Paulo Cesar Pereira de Andrade
Use the same logic for offscreen memory management as used in smi_video.c. This also makes the functions SMI_AllocateMemory and SMI_FreeMemory no longer static in smi_video.c.
2008-11-14Correct regressions in CSCVideoPaulo Cesar Pereira de Andrade
Commit 0870d46718fe4e01953efd63cec46c54140b20f9 broke the clipping code. That has been corrected in this patch. Anyway, the hardware color space conversion should not be hidden down in the driver code, instead it should be usable by external programs as well, instead of having some applications doing it by software.
2008-11-11Correct a problem in CSC video on the smi 501/502.Paulo Cesar Pereira de Andrade
This significantly simplify the function SMI_DisplayVideo0501_CSC(), but the real cause of the problem that this patch corrects is that whenever MMIO 0x1000fc bit 24 (Vertical Linear Filter Control) is set, the last line of the rendered video will display only noisy, regardless of video being rendered 1x1, or scaled up or down.
2008-11-07Bit twelve on CPR00 bitfield is not bit eleven...Nathael Pajani
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-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-28Changes in the video overlay clipping code.Francisco Jerez
Clip the video to the CRTC viewport by using xf86_crtc_clip_video_helper, and allow XV in dual head mode.
2008-10-03Simplify regsmi.h by removing most unused SMI501 defines.Paulo Cesar Pereira de Andrade
The values that should be used, should also have a more meaningful name, as something like: doesn't help much, and the fact that these "ports" can be accessed from several "bases" may be confusing also, as there is SCRBase, DCRBase, FPRBase, DPRBase, CPRBase (and IOBase). The 501 code should probably be changed to just use IOBase, as currently it uses SCRBase, that happens to be at pSmi->MapBase + 0x0000. This patch also completely transforms the WaitQueue macro in a noop for the MSOC. In SMI sample code it is almost the current code, just that the macro body is commented out. Hopefully this will be addressed soon.
2008-10-02Remove the IN_SEQ and OUT_SEQ macros.Paulo Cesar Pereira de Andrade
These macros access vga registers, but don't make it clear in their name.
2008-09-22Rework/simplify debug macros.Paulo Cesar Pereira de Andrade
Instead of cut&paste of the name of the current function everywhere, just use cpp's __FUNCTION__ predefined macro. Create two macros to exit a function, named LEAVE() and RETURN(). Functions returning void should call LEAVE() and then explicitly return for now. "Logged" function calls are indented, so a review was done to ensure functions with a ENTER() also have the proper exit macro. The DEBUG macro was changed to have variadic arguments, and this way it is no longer required to prefix arguments with VERBLEV, but now it also is not possible to use another "verbosity value", but it wasn't used in any of the DEBUG macro calls.
2008-09-18Correct video offscreen memory allocation routines.Paulo Cesar Pereira de Andrade
It was always failing in the first allocation, if using XAA, what caused some players to not work correct. This is a major problem for the MSOC as it still only supports XAA. Also add a workaround for a hardware problem, as described in "SM501 Rev.AA engineering addendum v0.1.pdf" "A-27 PIXELS TOO BRIGHT ON VIDEO SHRINK".
2008-09-02Correct all compiler warning messages.Paulo Cesar Pereira de Andrade
Code compiled with: gcc -Wall -Wbad-function-cast -Wdeclaration-after-statement \ -Wmissing-prototypes -Wmissing-declarations -Wnested-externs \ -fno-strict-aliasing -Wold-style-definition -Wpointer-arith \ -Wstrict-prototypes This patch also makes most smi_501.c functions static, as they are not called from anywhere else. Also removed prototypes for non existent functions in smi_501.h.
2008-09-02Correct xv video problems on MSOC.Paulo Cesar Pereira de Andrade
Set VIDEO_CLIP_TO_VIEWPORT as it is used in MSI sources, and also add proper code to detect panel size, as this information is used to manage offscreen memory (but shouldn't it be using pScrn->virtualY, etc?)
2008-09-01Don't pretend this driver compiles on XFree86.Paulo Cesar Pereira de Andrade
Either remove check for XF86_VERSION_CURRENT or at least add the implementation of RegionsEqual() to smi_video.c.
2008-08-29Correct a problem when handling i420 format.Arnaud Patard
The problem was that the driver was converting i420->YV12 2 times instead of only once.
2008-08-29Update MSOC video interface.Paulo Cesar Pereira de Andrade
This synchronizes smi_video.c with smi 2.2.5 sources.
2008-08-29MSOC doesn't access VGA registers or VBE/INT10Paulo Cesar Pereira de Andrade
This should be the biggest patch in the "merge". Done in a single chunk to have it compilable at all stages.
2008-08-29Fix build for removal of xf86Version.hPaulo Cesar Pereira de Andrade
This is the first patch of series to merge code from the version 2.2.5 from SiliconMotion and code from http://cgit.freedesktop.org/~agd5f/xf86-video-smi501 After the merge, work will continue, to correct some extra problems, and make it work with EXA at least (as only the Xorg version has EXA support).
2008-08-16Allow using XV and RandR rotation simultaneously.Francisco Jerez
As it doesn't seem feasible to rotate the video, I did some modifications at SMI_PutImage and SMI_ClipVideo to make PutImage work (incorrectly) with rotation enabled. The image is displayed unrotated. Signed-off-by: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
2008-08-15Dead code removal.Adam Jackson
2008-03-19Death to RCS tags.Adam Jackson
2007-03-13Initial import of EXA supportDennis De Winter
Based on Dennis' code from bug 8721 with some minor changes by me.
2007-03-13Whitespace and formatting changesAlex Deucher
2006-04-07Add a DrawablePtr argument to the XV functions to pave the way forAaron Plattner
redirected video.
2005-07-11Prep for modular builds by adding guarded #include "config.h" everywhere.XORG-6_8_99_903XORG-6_8_99_902XORG-6_8_99_901XORG-6_8_99_900XORG-6_8_99_16XORG-6_8_99_15accelerated_indirect-0-0-1Adam Jackson
2005-07-01Change all misc.h and os.h references to <X11/foo.h>.XORG-6_8_99_14Daniel Stone
2004-07-31Rename some COMPOSITE macros and enums to avoid conflicting with theXORG-6_7_99_2XORG-6_7_99_1Eric Anholt
COMPOSITE extension's new macro. These appear to only be used internally.
2004-06-16DRI XFree86-4_3_99_12-merge importDRI-trunk-20040721DRI-trunk-20040613DRI-XFree86-4_3_99_12-mergeEric Anholt
2004-04-23Merging XORG-CURRENT into trunkXACE-SELINUX-MERGEEgbert Eich
2004-03-14Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004xf86-4_4_99_1Egbert Eich
2004-03-03Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004xf86-4_4_0STSF-CURRENTEgbert Eich
2004-02-26readding XFree86's cvs IDsxf86-4_3_99_903Egbert Eich
2004-02-26Importing vendor version xf86-4_3_99_903 on Wed Feb 26 01:21:00 PST 2004Egbert Eich