summaryrefslogtreecommitdiffstats
path: root/firmware/drivers/lcd-2bit-horz.c
AgeCommit message (Collapse)AuthorFilesLines
2022-10-12lcd: Fix bug in grayscale clear_display() implementationAidan MacDonald1-1/+1
clear_display() on grayscale LCDs sets the number of scrolling lines to 0 but that's wrong, the scollers need to be shut down first. Call scroll_stop() for that, as is done on color LCDs. Change-Id: I75fb6839ed04f6fe1eb8e2855c8db820fcedddb8
2022-10-12lcd: Move grayscale clear_viewport() to lcd-bitmap-common.cAidan MacDonald1-27/+0
All grayscale LCDs have the same clear_viewport() implementation. Change-Id: I087ac3be824c97a1f42857b4e2fedb0675d453fa
2022-10-12lcd: Refactor viewport clipping functionsAidan MacDonald1-5/+5
There's no need to generate separate copies of these functions for main and remote LCDs; we can just pass the viewport directly. Change-Id: I20aa04a58d327b479a942708e161068bd6a3357b
2022-10-12lcd: Cosmetic variable renamingAidan MacDonald1-8/+13
Assign lcd_current_viewport to a local variable for easier typing. Change-Id: Ib5d4283fd1c5a21c94d3bd3c2c28ce206383fb96
2022-10-09lcd: Move parameter handling calls to lcd-bitmap-common.cAidan MacDonald1-42/+0
No need to reimplement the same drawmode, getwidth, etc, calls for each pixel format. Change-Id: Ibbe32814f72e1492c190ba578cec303c1cf29b12
2022-10-09lcd: Consolidate drawpixel, drawline, and drawrect functionsAidan MacDonald1-111/+0
All three functions are nearly identical regardless of the LCD pixel format. Consolidate them into a generic version in lcd-bitmap-common.c. Change-Id: Iab13429ea27ea2b0150b9004535bd27d4a4121a0
2022-10-09lcd: Consolidate in-viewport clipping routinesAidan MacDonald1-127/+17
In-viewport clipping code is duplicated across 8 files, making it a chore to change anything related to clipping; refactor the clipping logic into dedicated functions. Change-Id: I4ab20bb3c59b0406098d0c7d23833025f17a320a
2022-09-30Define LCD_STRIDEFORMAT unconditionallyAidan MacDonald1-1/+1
Instead of putting "#ifdef LCD_STRIDEFORMAT" at every usage of the macro it's simpler to have config.h define LCD_STRIDEFORMAT to the default of horizontal stride when the target leaves it unspecified. Change-Id: Ib187012aad65ac678dbd837b1464a83bad722411
2022-09-27lcd: Remove HAVE_VIEWPORT_CLIPAidan MacDonald1-112/+0
This was only enabled for the mrobe500 and sansaconnect targets. Most targets are therefore running without this "safety" measure, and presumably we'd have noticed long ago if there was a problem. So in all likelihood this is just a bunch of dead code that we don't need to carry around. Change-Id: I7d27701a38b1c2a985ee73fa6f277ad215d8d385
2022-04-17viewports, set flags to VP_DEFAULT_FLAGSWilliam Wilgus1-0/+1
flags were getting un-initialized memory it really didn't matter with the flags getting initialized anyway But once I added a new flag that didn't explicitly set or clear the flag at init well here we are set flags to VP_DEFAULT_FLAGS in viewport_set_defaults() add the flags variable to the default vp's set to 0 (it was already initialized to 0 by bss, make it explicit) Change-Id: I3a9a062455b4cf66d2b8c70fdf05402a5c0c091c
2021-03-24Revert "lcd framebuffer - Bugfix ensure proper alignment"William Wilgus1-2/+3
This reverts commit ffee661ab70e9622a05c9c2f24ecf474dad8f042. Reason for revert: <INSERT REASONING HERE> iAudio M5 `IRAM' overflowed by 48 bytes Change-Id: Id808a72c6eacabc562d53eac8acd36b45f678a97
2021-03-24lcd framebuffer - Bugfix ensure proper alignmentWilliam Wilgus1-3/+2
-- apparenty 0x4 aligned doesn't work properly requires 0x8 alignment at least for the h10 20gb but enabled for all arm processors assign the default framebuffer to the default_vp as well Change-Id: I0b76c30f2ddb5d6d2f7c6a132e4081aee58da17b
2020-10-26Whitespace cleanup on fb_viewport RewriteWilliam Wilgus1-42/+42
Change-Id: I24aac41c8abecf7b78a44d7f59e842b791be4563
2020-10-26LCD core move buf ptr and address look up function viewport structWilliam Wilgus1-91/+124
I'm currently running up against the limitations of the lcd_draw functions I want these functions to be able to be used on any size buffer not just buffers with a stride matching the underlying device [DONE] allow the framebuffer to be decoupled from the device framebuffer [DONE need examples] allow for some simple blit like transformations [DONE] remove the device framebuffer from the plugin api [DONE}ditto remote framebuffer [DONE] remove _viewport_get_framebuffer you can call struct *vp = lcd_set_viewport(NULL) and vp->buffer->fb_ptr while remote lcds may compile (and work in the sim) its not been tested on targets [FIXED] backdrops need work to be screen agnostic [FIXED] screen statusbar is not being combined into the main viewport correctly yet [FIXED] screen elements are displayed incorrectly after switch to void* [FIXED] core didn't restore proper viewport on splash etc. [NEEDS TESTING] remote lcd garbled data [FIXED] osd lib garbled screen on bmp_part [FIXED] grey_set_vp needs to return old viewport like lcd_set_viewport [FIXED] Viewport update now handles viewports with differing buffers/strides by copying to the main buffer [FIXED] splash on top of WPS leaves old framebuffer data (doesn't redraw) [UPDATE] refined this a bit more to have clear_viewport set the clean bit and have skin_render do its own screen clear scrolling viewports no longer trigger wps refresh also fixed a bug where guisyncyesno was displaying and then disappearing [ADDED!] New LCD macros that allow you to create properly size frame buffers in you desired size without wasting bytes (LCD_ and LCD_REMOTE_) LCD_STRIDE(w, h) same as STRIDE_MAIN LCD_FBSTRIDE(w, h) returns target specific stride for a buffer W x H LCD_NBELEMS(w, h) returns the number of fb_data sized elemenst needed for a buffer W x H LCD_NATIVE_STRIDE(s) conversion between rockbox native vertical and lcd native stride (2bitH) test_viewports.c has an example of usage [FIXED!!] 2bit targets don't respect non-native strides [FIXED] Few define snags Change-Id: I0d04c3834e464eca84a5a715743a297a0cefd0af
2013-12-15Fix more reds.Thomas Martitz1-1/+1
Change-Id: Ie62386a8f3e9986381f96eb83abb69bfc42b42e1
2013-12-14lcd-*: Merge common viewport operations into lcd-bitmap-common.cThomas Martitz1-46/+0
Change-Id: Ibec2d039ac0ba1214c9bd1b667bc8a9538a0d3d7
2012-02-28lcd drivers: Convert lcd_[remote_]framebuffer to a pointerJonathan Gordon1-13/+14
Change all lcd drivers to using a pointer to the static framebuffer instead of directly accessing the static array. This will let us later do fun things like dynamic framebuffer sizes (RaaA) or ability to use different buffers for different layers (dynamic skin backdrops!) Change-Id: I0a4d58a9d7b55e6c932131b929e5d4c9f9414b06
2010-02-20Comment out lcd_drawline() DEBUGF messages which show in various simulatorsTomer Shalev1-2/+2
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24784 a1c6a512-1295-4272-9138-f99709370657
2009-11-07Add optional viewport clipping, can be enabled with HAVE_VIEWPORT_CLIP. A ↵Karl Kurbjun1-13/+152
simulator check is also added to set_viewport that will show an error/note when DEBUGF is enabled. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23551 a1c6a512-1295-4272-9138-f99709370657
2009-08-18LCD_DEPTH == 2, horizontal packing: specify if lcd framebuffer is in iram ↵Rafaël Carré1-1/+1
into the model specific config file git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22399 a1c6a512-1295-4272-9138-f99709370657
2009-08-13LCD bitmap driver code consolidation from FS#4817:Andrew Mahone1-220/+1
Move text-drawing code into firmware-drivers/lcd-bitmap-common.c, included by the various driver files. Add new static function LCDFN(putsxyofs_style) to draw styled text, and use it in both LCDFN(puts_style_offset) and LCDFN(scroll_fn). Merge lcd_gradient_rect functions, with new function containing simplified code for drawing one line of a multi-line gradient. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22289 a1c6a512-1295-4272-9138-f99709370657
2009-07-14Missed one strncpy callNils Wallménius1-1/+1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21864 a1c6a512-1295-4272-9138-f99709370657
2009-06-01Speed up mono bitmap drawing on horizontally packed greyscale targets ↵Jens Arnold1-26/+122
(greyscale iPods). Average speedup is 80% on PP5002, and 55% on PP502x. * Simplify mono bitmap drawing in the 16 bit driver and the greylib a bit, also giving a slight speedup (3% on PP502x, 1.5% on coldfire). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21163 a1c6a512-1295-4272-9138-f99709370657
2009-05-30Two tiny optimisations for mono bitmap drawing on greyscale displays: (1) ↵Jens Arnold1-6/+4
H1x0, M5: Manipulate destination masks directly for the aligned case - ~0.7% speedup. (2) Greyscale ipods: Use sentinel method for reloading data like the 16 bit driver does - ~1.5% speedup. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21139 a1c6a512-1295-4272-9138-f99709370657
2009-03-04Cosmetic fix: remove duplicate semicolonsBertrik Sikken1-1/+1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20198 a1c6a512-1295-4272-9138-f99709370657
2008-06-28Updated our source code header to explicitly mention that we are GPL v2 orDaniel Stenberg1-2/+4
later. We still need to hunt down snippets used that are not. 1324 modified files... http://www.rockbox.org/mail/archive/rockbox-dev-archive-2008-06/0060.shtml git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17847 a1c6a512-1295-4272-9138-f99709370657
2008-06-23FS#9051 - remove LCD margins... use viewports if you need them...Jonathan Gordon1-24/+6
NOTE to WPS people.... %m has been removed, but (i think) because of the other %m tags it wont fail if you try loading a wps with %m|..|, it will just be ignored. Also note that if the statusbar is enabled the default viewport is 8 pixels shorter than when its not, i.e (0,0) is really (0,8) if the statusbar is shown... I dont think this will be a major issue because almost no WPS show the bar and use bitmaps... text only WPS shouldnt be affected. Please report problem screens in http://forums.rockbox.org/index.php?topic=17358.0 git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17763 a1c6a512-1295-4272-9138-f99709370657
2008-04-12LCD drivers: * Automatically optimise horizontal and vertical lines drawn ↵Jens Arnold1-47/+43
via _drawline(), with debug message to show possible optimisations in the caller. * Get rid of the extra ICODE function declarations by putting the attribute into the definition. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17081 a1c6a512-1295-4272-9138-f99709370657
2008-01-08Add the viewport functions to the screens API, including a new getfont() ↵Dave Chapman1-0/+5
function to return the font used by the current viewport. A change to the screens API makes the plugin API incompatible, so we bump version and sort. Also commit the test_viewports plugin (not built by default). This is some more of FS#8385. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16022 a1c6a512-1295-4272-9138-f99709370657
2008-01-07Add viewport capabilities to all the LCD drivers, and adapt scrolling code. ↵Dave Chapman1-85/+192
This is the firmware/ part of FS#8385 - the changes to the WPS code still need more work and will be committed at a later date. NOTE: There are no user-visible changes with this commit - just the infrastructure. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16018 a1c6a512-1295-4272-9138-f99709370657
2007-09-30Fix red due to previous commit, remove some ifdefs. (/me crosses his fingers)Antoine Cellerier1-3/+2
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14929 a1c6a512-1295-4272-9138-f99709370657
2007-07-28Fix warnings and errors. Remove some added stuff that wasn't needed afterall.Michael Sevakis1-5/+0
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14036 a1c6a512-1295-4272-9138-f99709370657
2007-07-28Scroll on main and remote with a single thread. Change the way system ↵Michael Sevakis1-119/+57
messages are defined before running out is an issue (which requires a full update of rockbox on the player). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14035 a1c6a512-1295-4272-9138-f99709370657
2007-04-01for WPS files with many lines the current wps code will call puts_scroll ↵Robert Kukla1-0/+4
with y-values greater than the size of the scroll[] array (e.g. gwps-common.c:2063). This is a temporary security measure until viewports and/or wps tokenizer are available... git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12992 a1c6a512-1295-4272-9138-f99709370657
2007-03-04Dual core support for PP502x players (iPod G4 and later, iriver h10, Sansa - ↵Daniel Ankers1-1/+2
iPod G3 will be coming soon.) This allows threads to be run on either core provided that all communications between the cores is done using uncached memory. There should be no significant change in battery life from doing this. Documentation (on the RockboxKernel wiki page) will follow shortly. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12601 a1c6a512-1295-4272-9138-f99709370657
2007-02-20Introduced LCD_FBHEIGHT in addition to the already existing LCD_FBWIDTH to ↵Jens Arnold1-1/+1
ease framebuffer handling a bit. Added equivalent definitions for the remote LCD. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12419 a1c6a512-1295-4272-9138-f99709370657
2006-11-13Backdrop support for greyscale targets. WPS backdrop is untested.Jens Arnold1-5/+104
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11520 a1c6a512-1295-4272-9138-f99709370657
2006-09-25Fixed the line scrolling not always being smooth.Miika Pekkarinen1-1/+1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11044 a1c6a512-1295-4272-9138-f99709370657
2006-09-16New scheduler, with priorities for swcodec platforms. Frequent taskMiika Pekkarinen1-1/+1
switching should be more efficient and tasks are stored in linked lists to eliminate unnecessary task switching to improve performance. Audio should no longer skip on swcodec targets caused by too CPU hungry UI thread or background threads. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10958 a1c6a512-1295-4272-9138-f99709370657
2006-08-23Allow scrolling lines with different x-margins. The margin at the time of ↵Mark Arigo1-2/+2
the call to puts_scroll will be used as the margin for that line. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10727 a1c6a512-1295-4272-9138-f99709370657
2006-07-28LCD drivers: * Slight speedup for 2bit greyscale drivers. Use the same ↵Jens Arnold1-35/+36
scrolltext drawing anywhere. * Cleanup, fixes and definitions in preparation for X5 remote. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10346 a1c6a512-1295-4272-9138-f99709370657
2006-07-25Contrast setting cleanup: * Only include contrast setting for targets where ↵Jens Arnold1-9/+0
it's used. * Make lcd_default_contrast() a stub for simulators. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10317 a1c6a512-1295-4272-9138-f99709370657
2006-07-181bit and 2bit LCD drivers: Low-level bit handling optimisations.Jens Arnold1-13/+26
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10225 a1c6a512-1295-4272-9138-f99709370657
2006-05-06Patch #5182 by Liberman Shachar - Vertical screen scroll bug fix (inverse ↵Linus Nielsen Feltzing1-2/+3
bar crop in vertical scroll) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9881 a1c6a512-1295-4272-9138-f99709370657
2006-05-03Fix fillrect calculation error for 'Screen scrolls out of view'. Fixes bug ↵Peter D'Hoye1-2/+3
5267. Also some minor code policing. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9871 a1c6a512-1295-4272-9138-f99709370657
2006-04-06lcd_blit() (with mono->2bit expansion) implemented for greyscale ipods. ↵Jens Arnold1-5/+0
Changed the flip mode maths for the mini LCD for coexistence with lcd_blit(). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9540 a1c6a512-1295-4272-9138-f99709370657
2006-04-04Grayscale iPods: Bit-flipped the 2bit LCD driver to use the same format as ↵Jens Arnold1-18/+15
apple. No more mirrored display when loading retailos, after a bootloader update. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9478 a1c6a512-1295-4272-9138-f99709370657
2006-04-01greyscale iPod LCD: Working display flip. * Correct register definitions for ↵Jens Arnold1-1/+5
HD66753. * Correct 1/3 and 2/3 greylevels. * Some tweaks. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9414 a1c6a512-1295-4272-9138-f99709370657
2006-03-22font caching fixes by Frank DischnerMarcoen Hirschberg1-5/+0
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9178 a1c6a512-1295-4272-9138-f99709370657
2006-03-08LCD extension library: Implemented scrolling for LCD depths below 8 bit. * ↵Jens Arnold1-9/+9
Oscilloscope: Use new scrolling function, some minor optimisations. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8951 a1c6a512-1295-4272-9138-f99709370657