diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2016-08-12 11:42:19 +0300 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2016-08-12 11:43:07 +0300 |
commit | 6927e751ddd7c833f71ad7376ec055ff40bf82a7 (patch) | |
tree | 18ba6a8a876ee89c21e1a7b2fd2219cc30c54088 /kms++util/src/extcpuframebuffer.cpp | |
parent | cdab6faf18b5f2b9964476673cd6d6bc87b264ba (diff) |
ExtCPUFramebuffer: add size and offset params
Add size and offset params to ExtCPUFramebuffer, so that we can fix
fbtestpat's test pattern size on larger virtual fbdevs.
Diffstat (limited to 'kms++util/src/extcpuframebuffer.cpp')
-rw-r--r-- | kms++util/src/extcpuframebuffer.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/kms++util/src/extcpuframebuffer.cpp b/kms++util/src/extcpuframebuffer.cpp index 232c778..feb3add 100644 --- a/kms++util/src/extcpuframebuffer.cpp +++ b/kms++util/src/extcpuframebuffer.cpp @@ -7,7 +7,7 @@ namespace kms { ExtCPUFramebuffer::ExtCPUFramebuffer(uint32_t width, uint32_t height, PixelFormat format, - uint8_t* buffer, uint32_t pitch) + uint8_t* buffer, uint32_t size, uint32_t pitch, uint32_t offset) : m_width(width), m_height(height), m_format(format) { const PixelFormatInfo& format_info = get_pixel_format_info(m_format); @@ -16,16 +16,16 @@ ExtCPUFramebuffer::ExtCPUFramebuffer(uint32_t width, uint32_t height, PixelForma ASSERT(m_num_planes == 1); - const PixelFormatPlaneInfo& pi = format_info.planes[0]; FramebufferPlane& plane = m_planes[0]; plane.stride = pitch; - plane.size = plane.stride * height / pi.ysub; + plane.size = size; + plane.offset = offset; plane.map = buffer; } ExtCPUFramebuffer::ExtCPUFramebuffer(uint32_t width, uint32_t height, PixelFormat format, - uint8_t* buffers[4], uint32_t pitches[4]) + uint8_t* buffers[4], uint32_t sizes[4], uint32_t pitches[4], uint32_t offsets[4]) : m_width(width), m_height(height), m_format(format) { const PixelFormatInfo& format_info = get_pixel_format_info(m_format); @@ -33,11 +33,11 @@ ExtCPUFramebuffer::ExtCPUFramebuffer(uint32_t width, uint32_t height, PixelForma m_num_planes = format_info.num_planes; for (unsigned i = 0; i < format_info.num_planes; ++i) { - const PixelFormatPlaneInfo& pi = format_info.planes[i]; FramebufferPlane& plane = m_planes[i]; plane.stride = pitches[i]; - plane.size = plane.stride * height / pi.ysub; + plane.size = sizes[i]; + plane.offset = offsets[i]; plane.map = buffers[i]; } } |