Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5439

Beginners • Re: MSP3520 (ili9488)

$
0
0
Sorry about the delayed reply.
I spent a little time trying to integrate the ads7846 driver and it wasn't working out for me either. I could just use it with the spi libraries but figured I should implement something cleaner.

To answer your question:
https://elixir.bootlin.com/linux/v6.6.2 ... dbi.c#L216

Code:

int mipi_dbi_buf_copy(void *dst, struct iosys_map *src, struct drm_framebuffer *fb,      struct drm_rect *clip, bool swap){struct drm_gem_object *gem = drm_gem_fb_get_obj(fb, 0);struct iosys_map dst_map = IOSYS_MAP_INIT_VADDR(dst);int ret;ret = drm_gem_fb_begin_cpu_access(fb, DMA_FROM_DEVICE);if (ret)return ret;switch (fb->format->format) {case DRM_FORMAT_RGB565:if (swap)drm_fb_swab(&dst_map, NULL, src, fb, clip, !gem->import_attach);elsedrm_fb_memcpy(&dst_map, NULL, src, fb, clip);break;case DRM_FORMAT_XRGB8888:drm_fb_xrgb8888_to_rgb565(&dst_map, NULL, src, fb, clip, swap);break;default:drm_err_once(fb->dev, "Format is not supported: %p4cc\n",     &fb->format->format);ret = -EINVAL;}drm_gem_fb_end_cpu_access(fb, DMA_FROM_DEVICE);return ret;}
This is the mipi driver code doing the buffer copy step

All formats get converted to RGB565 in the end.
It may be possible to get the code running where the XRGB8888 format is used and a bit in red and blue is lost.
All my attempts to do so have resulted in it not working. I shouldn't say it's not supported at all, sorry.

Statistics: Posted by VasilyK — Fri Apr 19, 2024 9:31 am



Viewing all articles
Browse latest Browse all 5439

Trending Articles