summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/imx233/sansa-fuzeplus/lcd-fuzeplus.c
AgeCommit message (Collapse)AuthorFilesLines
2022-03-21Lcd save function pointer to frame buffer get_address_fn before loopsWilliam Wilgus1-1/+2
Calling multiple levels of indirection in a loop slows things down Really these need to be rewritten to take a start and end address like most of the rest of the codebase But this is safer without having test hardware in hand Change-Id: Idae7b92ee779d020ed7fcc9334e2d5a9c710e64d
2020-11-08Fuze+: Fix misplaced rectangle when lcd_flip setMoshe Piekarski1-7/+30
Change-Id: Ic5197d8dffd66cfefdb42242869b48b33aa4d042
2018-05-25Fuze PLUS Fix lcd_update_rect()William Wilgus1-6/+21
Lcd_update rect was hanging during horizontal screen update x = 238 and width = 2 which was within the bounds of the screen, this seems to be a weird corner case but more testing needs done. Update_rect now properly bounded between 0 - screen w/h --Cleaned up code Pixels in x are now multiples of 4. Datasheet states: ------------------------------------------------------------------------------------------- WORD_LENGTH=0 implies the input frame buffer is RGB 16 bits per pixel. DATA_FORMAT_16_BIT field indicates if the pixels are in RGB 555 or RGB 565 format. Limitations: — BYTE_PACKING_FORMAT [3:0] should be 0x3 or 0xC if there is only one pixel per word. — If there are two pixels per word, BYTE_PACKING_FORMAT [3:0] should be 0xF and H_COUNT will be restricted to be a multiple of 2 pixels. and WORD_LENGTH=3 indicates that the input frame-buffer is RGB 24 bits per pixel (RGB 888). If BYTE_PACKING_FORMAT [3:0] is 0x7, it indicates that there is only one pixel per 32-bit word and there is no restriction on H_COUNT. Limitations: — If BYTE_PACKING_FORMAT [3:0] is 0xF, it indicates that the pixels are packed, i.e. there are 4 pixels in 3 words or 12 bytes. In that case, H_COUNT must be a multiple of 4 pixels. ------------------------------------------------------------------------------------------- We are using 16 bits per pixel and byte_packing = 0xF but device crashes with multiple of 2 pixels Behaviour can be verified with plugin - oscilloscope, Horizontal mode device hangs as indicator reaches right of screen Change-Id: I1445f5334f4e7fe59304c65c76b47d0daa0614b2
2014-01-05Add missing kernel.h includes (hopefully all of them), take #2.Thomas Martitz1-0/+3
Change-Id: I62cedf992bb096987050621cfc34f0432e9da170
2013-09-26fuze+/zenxfi2: make sure pixclk is running before initialising lcdifAmaury Pouly1-1/+1
Change-Id: I50b2376d5f6dcf4dde994b533e0b946589a737e8
2013-06-18fuze+: fix lcd code which got broken in 52426d0Amaury Pouly1-1/+1
The lcd data line were not setup as input anymore, making register reading plain broken and probably lead to bad lcd detection. Change-Id: I281460f845537c58045f3893261ded5c9c6e53b5
2013-06-17imx233: fix/improve lcdif for stmp3600 and stmp4700, fix driversAmaury Pouly1-205/+11
Factorise pin setup, rewrite PIO code, add support for lcdif irq, handle all the various differences between the stmps, drop yuv blitting code since it already exists in the common lcd drivers. Change-Id: Ifc40aed9b3b12f16611ce960602e46a5bc87ae53
2013-06-17imx233: fix pinctrl for stmp3600 and stmp3700Amaury Pouly1-10/+11
Change-Id: I87281b89315890fa285cb9a63fda5c90bdc8cdbf
2013-06-17imx233: normalise clkctrlAmaury Pouly1-4/+4
The clkctrl functions were becoming a mess. Normalise the names, get rid of the xtal derived as special case and use the same interface. Change-Id: Ib954a8d30a6bd691914b5e0d97774ec9fc560c50
2013-06-17imx233: normalise pinctrl namesAmaury Pouly1-68/+68
The current pinctrl functions were a mess. Normalise the functions names to make them shorter and clearer. Change-Id: Iac6ff84625ef2b7610268e3a5802dc0088de3167
2013-06-16imx233: rewrite pinctrl using new registersAmaury Pouly1-5/+5
Change-Id: I907a0b599ef65061360c215580f96f59b78b615b
2013-06-16imx233: rewrite lcdif using the new register headersAmaury Pouly1-7/+7
Change-Id: I94329a65a7c6a4127fa05b77b9a7a291f8a50013
2013-01-12imx233: correctly send the LCD_EVENT_ACTIVATION on enableAmaury Pouly1-0/+1
For some reason it is the responsability of the driver to send this event so do it. This might fix some non-updating screens. Change-Id: Ib5fdc94bf266c3497a8ac4e89d0418c0e876ff9f
2013-01-12fuze+: lcd code cleanupAmaury Pouly1-3/+1
The lcd kind is always set to st7783 in case we can't read the ID so don't bother handling impossible cases Change-Id: I352fd43b26068b460e69190d37c4cd4627e1db9a
2013-01-12fuze+: correctly handle settings (flip and invert) accross enableAmaury Pouly1-2/+34
The flip and invert settings can potentially be reset to their value accross a disable/enable cycle, so save the value of the impacted registers and apply it after each enable. Also avoid poking registers when the lcd is not on. Change-Id: Ica98f166c060aade7eb205f5628b58aae692024f
2013-01-12imx233: enable underflow recovery in lcdif (needed for freq scale)Amaury Pouly1-0/+1
When chaging the cpu and memory frequency we need to disable the external memory interface (EMI) for a small time. This can underflow the dma and cause some breakage. Hopefully the SSP controller handles this gracefully by stopping the clock and the I2C probably handles this naturally because the clock can be streched anyway. However the LCDIF has a special setting for this which needs to be enable, otherwise it will send garbage to the LCD. No other block is known to suffer from this currently but this issue might have more unexpected consequences. Change-Id: Ide154cad87929f2bf6cc419ac1d2ff33e30eec66
2012-12-26fuze+: fix bootloader buildAmaury Pouly1-0/+4
Change-Id: Ibe221d0f94ec4234ce1459073ba9ae77f6de162f
2012-12-26fuze+: implement lcd flip and invertAmaury Pouly1-0/+16
Change-Id: I1efcd0c6aa5e586b64c1b48d401648c7a933c4d9
2012-12-26fuze+: make sure lcd is ready before chaning a registerAmaury Pouly1-0/+1
The lcd driver does not wait for the refresh to be done to return from lcd_update(). This means that changing a register is unsafe if done in the middle of the redraw. This could happen when disabling the lcd for example. Make sure it doesn't happen by waiting for the lcdif to be ready. Change-Id: I43ec62a637dd61c3b2a3a6e131c1a9e8035524b1
2012-12-26fuze+: add lcd debug screen (display kind)Amaury Pouly1-0/+34
Change-Id: I08ffcfb8e4cf516aae1c23740eedf80d2cfcea41
2012-05-19imx233: fix clkctrl namingAmaury Pouly1-4/+4
Move to a more consistent naming convention like the other devices Change-Id: I4ddbbee27ee9f5ae775c5776592ec7ce02b30948
2012-05-19fuze+: fix lcd_on comment and storage qualifierAmaury Pouly1-1/+1
Change-Id: Iaf06ecd30559ac07b760f6a01ff920fdbacb398e
2012-05-10imx233: add pinctrl debug code to track pin usesAmaury Pouly1-1/+8
Past development has proved that one can mistakely use the same pin for two uses without noticing. Since this causes extremely hard to find bugs, the infrastructure will allow to register pin uses and panic when a conflict is detected. The pinctrl debug now shows the pin uses when its support is compiled in. Change-Id: Idb2d5235ce09207d77aa474d6f158e72b933761a
2012-05-08fuze+: don't touch B1P{22,24} in lcd code since these are used by the tunerAmaury Pouly1-4/+3
Change-Id: Icdb328b939902c4f8e57a76d27296d58b9548aab
2012-02-28lcd drivers: Convert lcd_[remote_]framebuffer to a pointerJonathan Gordon1-4/+4
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-04Fix Fuze+ bootloader redBoris Gjenero1-0/+2
Change-Id: I434e3f4930e6ab7f8d9f5ba43a5bfe0a387e0f09
2012-02-02fuze+: don't use the DCP to copy the framebuffer since it can yield and then ↵Amaury Pouly1-2/+1
several lcd udpates could run concurrently with undefined behaviour Change-Id: I39167188f354859fc8e4f9f979c97343b40beb7d
2012-02-01fuze+: check rectangle coordinates in lcd_update_rectAmaury Pouly1-0/+6
Change-Id: I5f23063751d7650b8eefd0f37393498d9a27bd19
2012-01-27fuze+: change rendering scheme, do not rely on generic framebuffer and ↵Amaury Pouly1-24/+259
implement rect updating and yuv blitting correctly. Now lcd_framebuffer is the only framebuffer in the system. We still use a ARM-buffered buffer which serve as an intermediate buffer for copying, to accomodate the requirement of the controller. We implement lcd_update_rect() properly using this new scheme (this requires two little quirks), this allows to implement lcd_blit_yuv with the right semantic (bypasses the framebuffer). YUV to RGB conversion is still done in software but the DCP CSC should be able to do that but the hardware rotation scheme is not the same as our software so it will require some tricks. Change-Id: I0752e9c2f1a705d2e6a6010084e1f150965d8370
2011-12-16Convert remaining memframe LCDs that can be convert to common code.Michael Sevakis1-82/+5
Massage the way it interfaces a bit to make things more flexible. The chroma_buf scheme on Sansa Connect and Creative ZVx calling the lcd_write_yuv420_lines implementation in lcd-as-memframe.S with five params with a chroma buffer that the function can't use wouldn't work anyway so just have them use the stock implementation (really, how was that working?). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31335 a1c6a512-1295-4272-9138-f99709370657
2011-12-13imx233: add comment about block resetAmaury Pouly1-6/+7
fuze+: reset the controller for all lcd types, should fix the "CRT effet" git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31234 a1c6a512-1295-4272-9138-f99709370657
2011-11-10fuze+: fix typo (mdelay vs udelay) in register read (shouldn't change ↵Amaury Pouly1-15/+16
anything) and be sure lcdif is ready git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30958 a1c6a512-1295-4272-9138-f99709370657
2011-11-07fuze+: fix typo in lcd init sequence for second lcd typeAmaury Pouly1-1/+1
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30926 a1c6a512-1295-4272-9138-f99709370657
2011-10-23fuze+: fix typo and remove ugly logf constructAmaury Pouly1-4/+2
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30829 a1c6a512-1295-4272-9138-f99709370657
2011-09-13imx233/fuze+: fix default init code (define lcd kind as 9325 and do 7783 init !)Amaury Pouly1-2/+2
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30532 a1c6a512-1295-4272-9138-f99709370657
2011-09-05imx233:fuze+: major memory and usb reworkAmaury Pouly1-1/+1
- now identity map dram uncached and have a cached and buffered virtual alias - rework dma to handle virtual to physical pointers conversion - fix lcd frame pointer - implement usb detection properly - implement bootloader usb properly - allow the bootloader to disable MMC windowing (useful for recovery) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30432 a1c6a512-1295-4272-9138-f99709370657
2011-07-24imx233/fuze+: implement lcd_blit_yuv (untested)Amaury Pouly1-0/+74
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30207 a1c6a512-1295-4272-9138-f99709370657
2011-07-23imx233/fuze+: huge reworkAmaury Pouly1-3/+29
- enable MMU -rework lcd frame buffer - add rtc/adc/power stubs (or not) - fix a few MMC related defines (hopefully) - implement cache handling for DMA - more SD work - add keymap (based on clip) - add virtual buttons - update linker scripts - big step toward apps actually compiling git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30200 a1c6a512-1295-4272-9138-f99709370657
2011-07-03imx233/fuze+: replace software i2c by hardware i2c, make some code more ↵Amaury Pouly1-161/+189
correct, reduce code size of lcd init sequences git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30120 a1c6a512-1295-4272-9138-f99709370657
2011-05-10fuze+: add init/enable/disable lcd sequences for the second lcd kind (only ↵Amaury Pouly1-2/+90
based on disassembly, untested) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29852 a1c6a512-1295-4272-9138-f99709370657
2011-05-02fuze+: use mdelay and not udelay in lcd sequencesAmaury Pouly1-34/+35
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29816 a1c6a512-1295-4272-9138-f99709370657
2011-05-01Sansa Fuze+: initial commit (bootloader only, LCD basically working)Amaury Pouly1-0/+376
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29808 a1c6a512-1295-4272-9138-f99709370657