Commit graph

58 commits

Author SHA1 Message Date
Aidan MacDonald
9549ddabba lcd: Fix bug in grayscale clear_display() implementation
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-12 07:58:57 -04:00
Aidan MacDonald
44b9785465 lcd: Move grayscale clear_viewport() to lcd-bitmap-common.c
All grayscale LCDs have the same clear_viewport() implementation.

Change-Id: I087ac3be824c97a1f42857b4e2fedb0675d453fa
2022-10-12 07:58:57 -04:00
Aidan MacDonald
f737e5025d lcd: Refactor viewport clipping functions
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-12 07:34:15 -04:00
Aidan MacDonald
6acc8a81a7 lcd: Cosmetic variable renaming
Assign lcd_current_viewport to a local variable for easier typing.

Change-Id: Ib5d4283fd1c5a21c94d3bd3c2c28ce206383fb96
2022-10-12 07:34:15 -04:00
Aidan MacDonald
f8e968991d lcd: Move parameter handling calls to lcd-bitmap-common.c
No need to reimplement the same drawmode, getwidth, etc, calls
for each pixel format.

Change-Id: Ibbe32814f72e1492c190ba578cec303c1cf29b12
2022-10-09 22:07:49 +01:00
Aidan MacDonald
4f9e4ddb99 lcd: Consolidate drawpixel, drawline, and drawrect functions
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-09 22:07:46 +01:00
Aidan MacDonald
4b8fe8acd1 lcd: Consolidate in-viewport clipping routines
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-10-09 22:07:44 +01:00
Aidan MacDonald
f373c97c90 Define LCD_STRIDEFORMAT unconditionally
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-30 10:42:49 +01:00
Aidan MacDonald
09cb3c7843 lcd: Remove HAVE_VIEWPORT_CLIP
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-09-27 14:13:15 +01:00
William Wilgus
c4156b1909 viewports, set flags to VP_DEFAULT_FLAGS
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
2022-04-17 10:59:56 -04:00
William Wilgus
ed99b305a9 Revert "lcd framebuffer - Bugfix ensure proper alignment"
This reverts commit ffee661ab7.

Reason for revert: <INSERT REASONING HERE>
iAudio M5  `IRAM' overflowed by 48 bytes

Change-Id: Id808a72c6eacabc562d53eac8acd36b45f678a97
2021-03-24 18:44:35 +00:00
William Wilgus
ffee661ab7 lcd framebuffer - Bugfix ensure proper alignment
-- 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
2021-03-24 18:22:01 +00:00
William Wilgus
40e98a2e49 Whitespace cleanup on fb_viewport Rewrite
Change-Id: I24aac41c8abecf7b78a44d7f59e842b791be4563
2020-10-26 12:38:22 -04:00
William Wilgus
3237ae4a4f LCD core move buf ptr and address look up function viewport struct
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
2020-10-26 12:28:48 -04:00
Thomas Martitz
ed5b853c18 Fix more reds.
Change-Id: Ie62386a8f3e9986381f96eb83abb69bfc42b42e1
2013-12-15 00:47:21 +01:00
Thomas Martitz
47c8d3c14d lcd-*: Merge common viewport operations into lcd-bitmap-common.c
Change-Id: Ibec2d039ac0ba1214c9bd1b667bc8a9538a0d3d7
2013-12-14 23:11:30 +01:00
Jonathan Gordon
b37e6bc8c1 lcd drivers: Convert lcd_[remote_]framebuffer to a pointer
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
2012-02-28 11:44:59 +11:00
Tomer Shalev
bc8cefd1a4 Comment out lcd_drawline() DEBUGF messages which show in various simulators
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24784 a1c6a512-1295-4272-9138-f99709370657
2010-02-20 06:42:45 +00:00
Karl Kurbjun
765ff0130a Add optional viewport clipping, can be enabled with HAVE_VIEWPORT_CLIP. A 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-11-07 18:38:46 +00:00
Rafaël Carré
ee9ece1acf LCD_DEPTH == 2, horizontal packing: specify if lcd framebuffer is in iram into the model specific config file
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22399 a1c6a512-1295-4272-9138-f99709370657
2009-08-18 04:23:57 +00:00
Andrew Mahone
e04f95eab9 LCD bitmap driver code consolidation from FS#4817:
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-08-13 08:02:29 +00:00
Nils Wallménius
5905b0be3e Missed one strncpy call
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21864 a1c6a512-1295-4272-9138-f99709370657
2009-07-14 14:15:33 +00:00
Jens Arnold
c1d27d105c Speed up mono bitmap drawing on horizontally packed greyscale targets (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-06-01 21:28:03 +00:00
Jens Arnold
72061047d1 Two tiny optimisations for mono bitmap drawing on greyscale displays: (1) 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-05-30 23:35:44 +00:00
Bertrik Sikken
4f87abf90a Cosmetic fix: remove duplicate semicolons
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20198 a1c6a512-1295-4272-9138-f99709370657
2009-03-04 18:15:06 +00:00
Daniel Stenberg
2acc0ac542 Updated our source code header to explicitly mention that we are GPL v2 or
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-28 18:10:04 +00:00
Jonathan Gordon
bdbdb97f19 FS#9051 - remove LCD margins... use viewports if you need them...
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-06-23 13:20:35 +00:00
Jens Arnold
00ac809cc7 LCD drivers: * Automatically optimise horizontal and vertical lines drawn 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-04-12 07:53:33 +00:00
Dave Chapman
3646c31367 Add the viewport functions to the screens API, including a new getfont() 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-08 01:22:14 +00:00
Dave Chapman
945c8a221a Add viewport capabilities to all the LCD drivers, and adapt scrolling code. 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
2008-01-07 20:34:11 +00:00
Antoine Cellerier
2445f66450 Fix red due to previous commit, remove some ifdefs. (/me crosses his fingers)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14929 a1c6a512-1295-4272-9138-f99709370657
2007-09-30 21:40:22 +00:00
Michael Sevakis
5832b59c85 Fix warnings and errors. Remove some added stuff that wasn't needed afterall.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14036 a1c6a512-1295-4272-9138-f99709370657
2007-07-28 08:45:57 +00:00
Michael Sevakis
58fc279d26 Scroll on main and remote with a single thread. Change the way system 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-07-28 08:12:05 +00:00
Robert Kukla
6dbcceb1fe for WPS files with many lines the current wps code will call puts_scroll 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-04-01 17:28:46 +00:00
Daniel Ankers
82f9056988 Dual core support for PP502x players (iPod G4 and later, iriver h10, Sansa - 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-03-04 20:06:41 +00:00
Jens Arnold
51223e5395 Introduced LCD_FBHEIGHT in addition to the already existing LCD_FBWIDTH to 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
2007-02-20 19:31:34 +00:00
Jens Arnold
0297873f6a Backdrop support for greyscale targets. WPS backdrop is untested.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11520 a1c6a512-1295-4272-9138-f99709370657
2006-11-13 00:45:21 +00:00
Miika Pekkarinen
cabfbb3556 Fixed the line scrolling not always being smooth.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11044 a1c6a512-1295-4272-9138-f99709370657
2006-09-25 12:45:14 +00:00
Miika Pekkarinen
a85044bf9e New scheduler, with priorities for swcodec platforms. Frequent task
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-09-16 16:18:11 +00:00
Mark Arigo
1e9ac7a32e Allow scrolling lines with different x-margins. The margin at the time of 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-08-23 20:07:59 +00:00
Jens Arnold
cb36fec392 LCD drivers: * Slight speedup for 2bit greyscale drivers. Use the same 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-28 07:17:00 +00:00
Jens Arnold
9051afa8a0 Contrast setting cleanup: * Only include contrast setting for targets where 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-25 11:15:50 +00:00
Jens Arnold
393f31cc43 1bit and 2bit LCD drivers: Low-level bit handling optimisations.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10225 a1c6a512-1295-4272-9138-f99709370657
2006-07-18 00:04:43 +00:00
Linus Nielsen Feltzing
33bd218010 Patch #5182 by Liberman Shachar - Vertical screen scroll bug fix (inverse bar crop in vertical scroll)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9881 a1c6a512-1295-4272-9138-f99709370657
2006-05-06 06:37:23 +00:00
Peter D'Hoye
69433c8667 Fix fillrect calculation error for 'Screen scrolls out of view'. Fixes bug 5267. Also some minor code policing.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9871 a1c6a512-1295-4272-9138-f99709370657
2006-05-03 20:22:03 +00:00
Jens Arnold
a5d2a28089 lcd_blit() (with mono->2bit expansion) implemented for greyscale ipods. 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-06 21:05:59 +00:00
Jens Arnold
fcab617331 Grayscale iPods: Bit-flipped the 2bit LCD driver to use the same format as 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-04 00:55:16 +00:00
Jens Arnold
3a3304fa31 greyscale iPod LCD: Working display flip. * Correct register definitions for 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-04-01 23:48:03 +00:00
Marcoen Hirschberg
d257683f3e font caching fixes by Frank Dischner
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9178 a1c6a512-1295-4272-9138-f99709370657
2006-03-22 09:53:27 +00:00
Jens Arnold
19b45a4374 LCD extension library: Implemented scrolling for LCD depths below 8 bit. * Oscilloscope: Use new scrolling function, some minor optimisations.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8951 a1c6a512-1295-4272-9138-f99709370657
2006-03-08 01:14:46 +00:00