aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/intelfb/intelfbdrv.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/intelfb/intelfbdrv.c')
-rw-r--r--drivers/video/intelfb/intelfbdrv.c50
1 files changed, 26 insertions, 24 deletions
diff --git a/drivers/video/intelfb/intelfbdrv.c b/drivers/video/intelfb/intelfbdrv.c
index 6b8bd3cdf9c0..995b47c165a7 100644
--- a/drivers/video/intelfb/intelfbdrv.c
+++ b/drivers/video/intelfb/intelfbdrv.c
@@ -1333,33 +1333,35 @@ intelfb_setcolreg(unsigned regno, unsigned red, unsigned green,
1333 if (regno > 255) 1333 if (regno > 255)
1334 return 1; 1334 return 1;
1335 1335
1336 switch (dinfo->depth) { 1336 if (dinfo->depth == 8) {
1337 case 8: 1337 red >>= 8;
1338 { 1338 green >>= 8;
1339 red >>= 8; 1339 blue >>= 8;
1340 green >>= 8; 1340
1341 blue >>= 8; 1341 intelfbhw_setcolreg(dinfo, regno, red, green, blue,
1342 transp);
1343 }
1342 1344
1343 intelfbhw_setcolreg(dinfo, regno, red, green, blue, 1345 if (regno < 16) {
1344 transp); 1346 switch (dinfo->depth) {
1347 case 15:
1348 dinfo->pseudo_palette[regno] = ((red & 0xf800) >> 1) |
1349 ((green & 0xf800) >> 6) |
1350 ((blue & 0xf800) >> 11);
1351 break;
1352 case 16:
1353 dinfo->pseudo_palette[regno] = (red & 0xf800) |
1354 ((green & 0xfc00) >> 5) |
1355 ((blue & 0xf800) >> 11);
1356 break;
1357 case 24:
1358 dinfo->pseudo_palette[regno] = ((red & 0xff00) << 8) |
1359 (green & 0xff00) |
1360 ((blue & 0xff00) >> 8);
1361 break;
1345 } 1362 }
1346 break;
1347 case 15:
1348 dinfo->pseudo_palette[regno] = ((red & 0xf800) >> 1) |
1349 ((green & 0xf800) >> 6) |
1350 ((blue & 0xf800) >> 11);
1351 break;
1352 case 16:
1353 dinfo->pseudo_palette[regno] = (red & 0xf800) |
1354 ((green & 0xfc00) >> 5) |
1355 ((blue & 0xf800) >> 11);
1356 break;
1357 case 24:
1358 dinfo->pseudo_palette[regno] = ((red & 0xff00) << 8) |
1359 (green & 0xff00) |
1360 ((blue & 0xff00) >> 8);
1361 break;
1362 } 1363 }
1364
1363 return 0; 1365 return 0;
1364} 1366}
1365 1367