Module Name: xsrc
Committed By: tsutsui
Date: Sun Jul 20 09:45:20 UTC 2014
Modified Files:
xsrc/external/mit/xf86-video-wsfb/dist/src: wsfb_driver.c
Log Message:
No need to handle colormap ioctls if cmsize == 0 even in WSFB_CI case.
To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 \
xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c
diff -u xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c:1.22 xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c:1.23
--- xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c:1.22 Sun Jul 20 08:53:00 2014
+++ xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c Sun Jul 20 09:45:20 2014
@@ -504,7 +504,8 @@ WsfbPreInit(ScrnInfoPtr pScrn, int flags
/*
* Allocate room for saving the colormap.
*/
- if (fPtr->fbi.fbi_pixeltype == WSFB_CI) {
+ if (fPtr->fbi.fbi_pixeltype == WSFB_CI &&
+ fPtr->fbi.fbi_subtype.fbi_cmapinfo.cmap_entries > 0) {
fPtr->saved_cmap.red =
(unsigned char *)malloc(fPtr->fbi.fbi_subtype.fbi_cmapinfo.cmap_entries);
if (fPtr->saved_cmap.red == NULL) {
@@ -1240,6 +1241,10 @@ WsfbLoadPalette(ScrnInfoPtr pScrn, int n
TRACE_ENTER("LoadPalette");
+ /* nothing to do if there is no color palette support */
+ if (fPtr->fbi.fbi_subtype.fbi_cmapinfo.cmap_entries == 0)
+ return;
+
cmap.count = 1;
cmap.red = red;
cmap.green = green;
@@ -1319,6 +1324,10 @@ WsfbSave(ScrnInfoPtr pScrn)
if (fPtr->fbi.fbi_pixeltype != WSFB_CI)
return;
+ /* nothing to do if no color palette support */
+ if (fPtr->fbi.fbi_subtype.fbi_cmapinfo.cmap_entries == 0)
+ return;
+
fPtr->saved_cmap.index = 0;
fPtr->saved_cmap.count = fPtr->fbi.fbi_subtype.fbi_cmapinfo.cmap_entries;
if (ioctl(fPtr->fd, WSDISPLAYIO_GETCMAP,
@@ -1338,7 +1347,8 @@ WsfbRestore(ScrnInfoPtr pScrn)
TRACE_ENTER("WsfbRestore");
- if (fPtr->fbi.fbi_pixeltype == WSFB_CI) {
+ if (fPtr->fbi.fbi_pixeltype == WSFB_CI &&
+ fPtr->fbi.fbi_subtype.fbi_cmapinfo.cmap_entries > 0) {
/* reset colormap for text mode */
if (ioctl(fPtr->fd, WSDISPLAYIO_PUTCMAP,
&(fPtr->saved_cmap)) == -1) {