Changeset 846 for trunk/src/gui/embedded/qscreenlinuxfb_qws.cpp
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/src/gui/embedded/qscreenlinuxfb_qws.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 92 92 int startupd; 93 93 bool blank; 94 QLinuxFbScreen::DriverTypes driverType; 94 95 95 96 bool doGraphicsMode; … … 163 164 QT_CLOSE(ttyfd); 164 165 ttyfd = -1; 166 } 167 168 /*! 169 \enum QLinuxFbScreen::DriverTypes 170 171 This enum describes the driver type. 172 173 \value GenericDriver Generic Linux framebuffer driver 174 \value EInk8Track e-Ink framebuffer driver using the 8Track chipset 175 */ 176 177 /*! 178 \fn QLinuxFbScreen::fixupScreenInfo(fb_fix_screeninfo &finfo, fb_var_screeninfo &vinfo) 179 180 Adjust the values returned by the framebuffer driver, to work 181 around driver bugs or nonstandard behavior in certain drivers. 182 \a finfo and \a vinfo specify the fixed and variable screen info 183 returned by the driver. 184 */ 185 void QLinuxFbScreen::fixupScreenInfo(fb_fix_screeninfo &finfo, fb_var_screeninfo &vinfo) 186 { 187 // 8Track e-ink devices (as found in Sony PRS-505) lie 188 // about their bit depth -- they claim they're 1 bit per 189 // pixel while the only supported mode is 8 bit per pixel 190 // grayscale. 191 // Caused by this, they also miscalculate their line length. 192 if(!strcmp(finfo.id, "8TRACKFB") && vinfo.bits_per_pixel == 1) { 193 vinfo.bits_per_pixel = 8; 194 finfo.line_length = vinfo.xres; 195 } 165 196 } 166 197 … … 307 338 } 308 339 340 d_ptr->driverType = strcmp(finfo.id, "8TRACKFB") ? GenericDriver : EInk8Track; 341 309 342 if (finfo.type == FB_TYPE_VGA_PLANES) { 310 343 qWarning("VGA16 video mode not supported"); … … 318 351 return false; 319 352 } 353 354 fixupScreenInfo(finfo, vinfo); 320 355 321 356 grayscale = vinfo.grayscale; … … 665 700 #endif 666 701 667 d_ptr->startupw=vinfo.xres;668 d_ptr->startuph=vinfo.yres;669 d_ptr->startupd=vinfo.bits_per_pixel;670 grayscale = vinfo.grayscale;671 672 702 if (ioctl(d_ptr->fd, FBIOGET_FSCREENINFO, &finfo)) { 673 703 perror("QLinuxFbScreen::initDevice"); … … 677 707 return true; 678 708 } 709 710 fixupScreenInfo(finfo, vinfo); 711 712 d_ptr->startupw=vinfo.xres; 713 d_ptr->startuph=vinfo.yres; 714 d_ptr->startupd=vinfo.bits_per_pixel; 715 grayscale = vinfo.grayscale; 679 716 680 717 #ifdef __i386__ … … 1123 1160 } 1124 1161 1162 fixupScreenInfo(finfo, vinfo); 1125 1163 disconnect(); 1126 1164 connect(d_ptr->displaySpec); … … 1201 1239 \reimp 1202 1240 */ 1241 void QLinuxFbScreen::setDirty(const QRect &r) 1242 { 1243 if(d_ptr->driverType == EInk8Track) { 1244 // e-Ink displays need a trigger to actually show what is 1245 // in their framebuffer memory. The 8-Track driver does this 1246 // by adding custom IOCTLs - FBIO_EINK_DISP_PIC (0x46a2) takes 1247 // an argument specifying whether or not to flash the screen 1248 // while updating. 1249 // There doesn't seem to be a way to tell it to just update 1250 // a subset of the screen. 1251 if(r.left() == 0 && r.top() == 0 && r.width() == dw && r.height() == dh) 1252 ioctl(d_ptr->fd, 0x46a2, 1); 1253 else 1254 ioctl(d_ptr->fd, 0x46a2, 0); 1255 } 1256 } 1257 1258 /*! 1259 \reimp 1260 */ 1203 1261 void QLinuxFbScreen::blank(bool on) 1204 1262 { … … 1316 1374 bool QLinuxFbScreen::useOffscreen() 1317 1375 { 1318 if ((mapsize - size) < 16*1024) 1376 // Not done for 8Track because on e-Ink displays, 1377 // everything is offscreen anyway 1378 if (d_ptr->driverType == EInk8Track || ((mapsize - size) < 16*1024)) 1319 1379 return false; 1320 1380
Note:
See TracChangeset
for help on using the changeset viewer.