diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2022-12-10 17:50:06 +0000 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2022-12-10 17:50:06 +0000 |
commit | 2d0ede468ddd363243fd31580e3e86c39b51f7be (patch) | |
tree | 1796526cba0e86cc31f9df6550c728e594f00332 /sys/src/9/imx8/lcd.c | |
parent | 9911557e45d5763320eb612aa6c5965f8ff39007 (diff) |
imx8: cleanup framebuffer code
We can get rid of a bunch of stuff now that we'r using a softscreen.
Get rid of the static Memimage and Memdata for the framebuffer;
just allocate gscreen as a memimage from the image pool.
Avoid exporting fbraw pointer, just have screeninit() return it.
Remove fbmemalloc() function. it used to create a write-thru
mapping but given that we are no more reading the framebuffer,
we can use ucalloc() instead.
Diffstat (limited to 'sys/src/9/imx8/lcd.c')
-rw-r--r-- | sys/src/9/imx8/lcd.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/sys/src/9/imx8/lcd.c b/sys/src/9/imx8/lcd.c index db09bab21..634286000 100644 --- a/sys/src/9/imx8/lcd.c +++ b/sys/src/9/imx8/lcd.c @@ -12,8 +12,6 @@ #include <cursor.h> #include "screen.h" -extern u8int *fbraw; - /* system reset controller registers */ enum { SRC_MIPIPHY_RCR = 0x28/4, @@ -455,7 +453,7 @@ lcdifreset(void) } static void -lcdifinit(struct video_mode *mode) +lcdifinit(struct video_mode *mode, u32int framebuffer) { wr(lcdif, LCDIF_CTRL_CLR, CTRL_SFTRST); while(rr(lcdif, LCDIF_CTRL) & CTRL_SFTRST) @@ -504,8 +502,8 @@ lcdifinit(struct video_mode *mode) wr(lcdif, LCDIF_VDCTRL4, sm(mode->hactive, VDCTRL4_DOTCLK_H_VALID_DATA_CNT)); - wr(lcdif, LCDIF_CUR_BUF, PADDR(fbraw)); - wr(lcdif, LCDIF_NEXT_BUF, PADDR(fbraw)); + wr(lcdif, LCDIF_CUR_BUF, framebuffer); + wr(lcdif, LCDIF_NEXT_BUF, framebuffer); wr(lcdif, LCDIF_CTRL_SET, CTRL_DOTCLK_MODE); @@ -891,6 +889,7 @@ lcdinit(void) struct dsi_cfg dsi_cfg; struct video_mode mode; char *err; + void *fb; intrenable(IRQlcdif, blankirq, nil, BUSUNKNOWN, "lcdif"); @@ -960,8 +959,8 @@ lcdinit(void) if(err != nil) goto out; - /* allocates the framebuffer (gscreen->data->bdata) */ - if(screeninit(mode.hactive, mode.vactive, 32) < 0){ + /* allocates the framebuffer */ + if((fb = screeninit(mode.hactive, mode.vactive, 32)) == nil){ err = "screeninit failed"; goto out; } @@ -980,7 +979,7 @@ lcdinit(void) bridgeinit(&mode, &dsi_cfg); /* send the pixels */ - lcdifinit(&mode); + lcdifinit(&mode, (u32int)PADDR(fb)); return; out: |