summaryrefslogtreecommitdiffstats
path: root/drivers/video/fbdev/sis
Commit message (Collapse)AuthorAgeFilesLines
* video: fbdev: sis: avoid mismatched prototypesArnd Bergmann2018-03-126-513/+508
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Building with LTO enabled reveals some functions whose prototypes in the header are different from the definition: drivers/video/fbdev/sis/sis_main.h:765:0: error: type of 'SiS_SetCH70xxANDOR' does not match original declaration [-Werror=lto-type-mismatch] extern void SiS_SetCH70xxANDOR(struct SiS_Private *SiS_Pr, unsigned short reg, drivers/video/fbdev/sis/init301.c:8937:0: note: type mismatch in parameter 4 SiS_SetCH70xxANDOR(struct SiS_Private *SiS_Pr, unsigned short reg, drivers/video/fbdev/sis/init301.c:8937:0: note: type 'short unsigned int' should match type 'unsigned char' drivers/video/fbdev/sis/init301.c:8937:0: note: 'SiS_SetCH70xxANDOR' was previously declared here The root cause appears to be the way that header files are used in this driver, where they contain both static variable and declarations for symbols in other files. To clean that up, I'm changing all mixed headers to only contain declarations the way we normally do in C, or contain only static variables, and move the rest to a more appropriate place. Once that is done, the headers can be included in the other files as well, and guarantee that the prototypes match. There are a few headers that now only contain static variables, and I'm leaving those alone here as the patch is already too big. These could be trivially moved into the respective .c files. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Cc: Thomas Winischhofer <thomas@winischhofer.net> Cc: Nicolas Pitre <nico@linaro.org> Cc: Andi Kleen <ak@linux.intel.com> Cc: "Gustavo A. R. Silva" <gustavo@embeddedor.com>, Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
* video: fbdev: sis_main: mark expected switch fall-throughsGustavo A. R. Silva2017-11-091-0/+4
| | | | | | | | | | | | | In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 115025 Addresses-Coverity-ID: 115026 Addresses-Coverity-ID: 115027 Addresses-Coverity-ID: 115028 Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com> Cc: Thomas Winischhofer <thomas@winischhofer.net> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
* video: fbdev: sis: make const array specialtv static, reduces object code sizeColin Ian King2017-10-121-1/+1
| | | | | | | | | | | | | | | | | | | Don't populate the const array specialtv on the stack, instead make it static. Makes the object code smaller by over 1100 bytes: Before: text data bss dec hex filename 179899 7504 0 187403 2dc0b drivers/video/fbdev/sis/init301.o After: text data bss dec hex filename 178720 7568 0 186288 2d7b0 drivers/video/fbdev/sis/init301.o (gcc version 7.2.0, x86_64) Signed-off-by: Colin Ian King <colin.king@canonical.com> Cc: Thomas Winischhofer <thomas@winischhofer.net> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
* video: fbdev: sis: fix duplicated code for different branchesGustavo A. R. Silva2017-09-041-12/+3
| | | | | | | | | | | Refactor code in order to avoid identical code for different branches. This issue was detected with the help of Coccinelle. Addresses-Coverity-ID: 1226761 Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Cc: Thomas Winischhofer <thomas@winischhofer.net> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
* video: fbdev: sis: remove unused variableSudip Mukherjee2016-03-031-8/+2
| | | | | | | | The variables modeflag and resinfo were only assigned some value but were never used. Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
* video: fbdev: sisfb: use arch_phys_wc_add() and ioremap_wc()Luis R. Rodriguez2015-06-032-22/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This driver uses the same area for MTRR as for the ioremap(). Convert the driver from using the x86 specific MTRR code to the architecture agnostic arch_phys_wc_add(). arch_phys_wc_add() will avoid MTRR if write-combining is available, in order to take advantage of that also ensure the ioremap'd area is requested as write-combining. There are a few motivations for this: a) Take advantage of PAT when available b) Help bury MTRR code away, MTRR is architecture specific and on x86 its replaced by PAT c) Help with the goal of eventually using _PAGE_CACHE_UC over _PAGE_CACHE_UC_MINUS on x86 on ioremap_nocache() (see commit de33c442e titled "x86 PAT: fix performance drop for glx, use UC minus for ioremap(), ioremap_nocache() and pci_mmap_page_range()") The conversion done is expressed by the following Coccinelle SmPL patch, it additionally required manual intervention to address all the #ifdery and removal of redundant things which arch_phys_wc_add() already addresses such as verbose message about when MTRR fails and doing nothing when we didn't get an MTRR. @ mtrr_found @ expression index, base, size; @@ -index = mtrr_add(base, size, MTRR_TYPE_WRCOMB, 1); +index = arch_phys_wc_add(base, size); @ mtrr_rm depends on mtrr_found @ expression mtrr_found.index, mtrr_found.base, mtrr_found.size; @@ -mtrr_del(index, base, size); +arch_phys_wc_del(index); @ mtrr_rm_zero_arg depends on mtrr_found @ expression mtrr_found.index; @@ -mtrr_del(index, 0, 0); +arch_phys_wc_del(index); @ mtrr_rm_fb_info depends on mtrr_found @ struct fb_info *info; expression mtrr_found.index; @@ -mtrr_del(index, info->fix.smem_start, info->fix.smem_len); +arch_phys_wc_del(index); @ ioremap_replace_nocache depends on mtrr_found @ struct fb_info *info; expression base, size; @@ -info->screen_base = ioremap_nocache(base, size); +info->screen_base = ioremap_wc(base, size); @ ioremap_replace_default depends on mtrr_found @ struct fb_info *info; expression base, size; @@ -info->screen_base = ioremap(base, size); +info->screen_base = ioremap_wc(base, size); Generated-by: Coccinelle SmPL Cc: Thomas Winischhofer <thomas@winischhofer.net> Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> Cc: Suresh Siddha <sbsiddha@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Juergen Gross <jgross@suse.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Andy Lutomirski <luto@amacapital.net> Cc: Dave Airlie <airlied@redhat.com> Cc: Antonino Daplas <adaplas@gmail.com> Cc: linux-fbdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com> Reviewed-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
* video: fbdev-SIS: Deletion of unnecessary checks before the function call ↵Markus Elfring2014-12-041-9/+5
| | | | | | | | | | | | | "pci_dev_put" The pci_dev_put() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
* Merge tag 'fbdev-3.18' of ↵Linus Torvalds2014-10-182-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux Pull fbdev updates from Tomi Valkeinen: - new 6x10 font - various small fixes and cleanups * tag 'fbdev-3.18' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux: (30 commits) fonts: Add 6x10 font videomode: provide dummy inline functions for !CONFIG_OF video/atmel_lcdfb: Introduce regulator support fbdev: sh_mobile_hdmi: Re-init regs before irq re-enable on resume framebuffer: fix screen corruption when copying framebuffer: fix border color arm, fbdev, omap2, LLVMLinux: Remove nested function from omapfb arm, fbdev, omap2, LLVMLinux: Remove nested function from omap2 dss video: fbdev: valkyriefb.c: use container_of to resolve fb_info_valkyrie from fb_info video: fbdev: pxafb.c: use container_of to resolve pxafb_info/layer from fb_info video: fbdev: cyber2000fb.c: use container_of to resolve cfb_info from fb_info video: fbdev: controlfb.c: use container_of to resolve fb_info_control from fb_info video: fbdev: sa1100fb.c: use container_of to resolve sa1100fb_info from fb_info video: fbdev: stifb.c: use container_of to resolve stifb_info from fb_info video: fbdev: sis: sis_main.c: Cleaning up missing null-terminate in conjunction with strncpy video: valkyriefb: Fix unused variable warning in set_valkyrie_clock() video: fbdev: use %*ph specifier to dump small buffers video: mx3fb: always enable BACKLIGHT_LCD_SUPPORT video: fbdev: au1200fb: delete double assignment video: fbdev: sis: delete double assignment ...
| * video: fbdev: sis: sis_main.c: Cleaning up missing null-terminate in ↵Rickard Strandqvist2014-09-301-1/+1
| | | | | | | | | | | | | | | | | | conjunction with strncpy Replacing strncpy with strlcpy to avoid strings that lacks null terminate. Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
| * video: fbdev: sis: delete double assignmentJulia Lawall2014-08-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Delete successive assignments to the same location. The second assignment is changed to update a different field, as done in other nearby code. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression i; @@ *i = ...; i = ...; // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
* | video: fbdev: replace strnicmp with strncasecmpRasmus Villemoes2014-10-141-33/+33
|/ | | | | | | | | | | | | | | | | | The kernel used to contain two functions for length-delimited, case-insensitive string comparison, strnicmp with correct semantics and a slightly buggy strncasecmp. The latter is the POSIX name, so strnicmp was renamed to strncasecmp, and strnicmp made into a wrapper for the new strncasecmp to avoid breaking existing users. To allow the compat wrapper strnicmp to be removed at some point in the future, and to avoid the extra indirection cost, do s/strnicmp/strncasecmp/g. Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* drivers/video/fbdev/sis: Add missing elseRasmus Villemoes2014-07-011-1/+1
| | | | | | | | | | The surrounding code and the fact that the previous two if's are rendered useless without this "else" (since SIS_340==55 and XGI_20==75 are greater than SIS_661==15) suggests that the "else" is indeed missing. Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
* drivers/video/fbdev/sis/sis_main.c: remove unnecessary test on unsigned valueFabian Frederick2014-06-241-4/+0
| | | | | | | | | unsigned value is never < 0 Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
* video: move fbdev to drivers/video/fbdevTomi Valkeinen2014-04-1718-0/+31032
The drivers/video directory is a mess. It contains generic video related files, directories for backlight, console, linux logo, lots of fbdev device drivers, fbdev framework files. Make some order into the chaos by creating drivers/video/fbdev directory, and move all fbdev related files there. No functionality is changed, although I guess it is possible that some subtle Makefile build order related issue could be created by this patch. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Rob Clark <robdclark@gmail.com> Acked-by: Jingoo Han <jg1.han@samsung.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>