summaryrefslogtreecommitdiff
path: root/kms++/src/omap/omapframebuffer.cpp
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ideasonboard.com>2025-02-05 11:28:23 +0200
committerTomi Valkeinen <tomi.valkeinen@ideasonboard.com>2025-03-26 15:44:00 +0200
commita9e7ecab862183399c5947931f2bad69ecec393d (patch)
tree6c02b4e7a4cb19f9af1421afccd87eef1b084d3a /kms++/src/omap/omapframebuffer.cpp
parent8b1c053359ed7593e43222daccb8c0db8fcc441f (diff)
PixelFormats: New PixelFormatInfo code
New pixel format code, from Python pixutils library. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Diffstat (limited to 'kms++/src/omap/omapframebuffer.cpp')
-rw-r--r--kms++/src/omap/omapframebuffer.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/kms++/src/omap/omapframebuffer.cpp b/kms++/src/omap/omapframebuffer.cpp
index 3bea13e..2efe1ec 100644
--- a/kms++/src/omap/omapframebuffer.cpp
+++ b/kms++/src/omap/omapframebuffer.cpp
@@ -67,9 +67,9 @@ void OmapFramebuffer::Create(uint32_t width, uint32_t height, PixelFormat format
uint32_t stride;
if (!(buffer_flags & Flags::Tiled)) {
- stride = width * pi.bitspp / 8;
+ stride = format_info.stride(width, i);
- uint32_t size = stride * height / pi.ysub;
+ uint32_t size = format_info.planesize(stride, height, i);
bo = omap_bo_new(m_omap_card.dev(), size, flags);
if (!bo)
@@ -110,13 +110,13 @@ void OmapFramebuffer::Create(uint32_t width, uint32_t height, PixelFormat format
throw invalid_argument("bad bitspertiler");
}
- uint32_t width_tiler = width * pi.bitspp / bitspertiler;
+ uint32_t width_tiler = format_info.stride(width, i) / pi.bytes_per_block;
bo = omap_bo_new_tiled(m_omap_card.dev(), width_tiler, height, flags);
if (!bo)
throw invalid_argument(string("omap_bo_new_tiled failed: ") + strerror(errno));
- stride = round_up(width * pi.bitspp / 8, PAGE_SIZE);
+ stride = format_info.stride(width, i, PAGE_SIZE);
}
plane.omap_bo = bo;