summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ideasonboard.com>2026-05-07 22:18:39 +0300
committerTomi Valkeinen <tomi.valkeinen@ideasonboard.com>2026-05-08 11:57:30 +0300
commit9cb56229bcd96448ae133c5b42622e1c1e740197 (patch)
tree881f2b2070c7b046ca3e79b7b22589d4826eea79
parentc5dc30f1d6ce98bdc28381cc75650eab0e98ce96 (diff)
kms++: Update pixel formats to latest upstream
-rw-r--r--kms++/inc/kms++/pixelformats.h8
-rw-r--r--kms++/src/pixelformats.cpp29
-rw-r--r--kms++util/src/conv-gray.h2
-rw-r--r--kms++util/src/conv-yuv-planar-packed.h4
-rw-r--r--kms++util/src/conv-yuv-semiplanar.h6
-rw-r--r--kms++util/src/testpat.cpp8
6 files changed, 28 insertions, 29 deletions
diff --git a/kms++/inc/kms++/pixelformats.h b/kms++/inc/kms++/pixelformats.h
index 2d97b32..17b05c0 100644
--- a/kms++/inc/kms++/pixelformats.h
+++ b/kms++/inc/kms++/pixelformats.h
@@ -74,8 +74,8 @@ enum class PixelFormat {
NV21,
NV16,
NV61,
- XV15,
- XV20,
+ P030,
+ P230,
XVUY2101010,
YUV420,
YVU420,
@@ -83,13 +83,13 @@ enum class PixelFormat {
YVU422,
YUV444,
YVU444,
- X403,
+ T430,
Y8,
Y10,
Y10P,
Y12,
Y12P,
- Y10_P32,
+ XYYY2101010,
SBGGR8,
SGBRG8,
SGRBG8,
diff --git a/kms++/src/pixelformats.cpp b/kms++/src/pixelformats.cpp
index 95a7153..cf730ba 100644
--- a/kms++/src/pixelformats.cpp
+++ b/kms++/src/pixelformats.cpp
@@ -502,10 +502,10 @@ static map<PixelFormat, PixelFormatInfo> format_info_array = {
}
},
{
- PixelFormat::XV15, {
+ PixelFormat::P030, {
PixelFormatInfo {
- "XV15",
- "XV15",
+ "P030",
+ "P030",
"",
PixelColorType::YUV,
{ 6, 2 },
@@ -514,10 +514,10 @@ static map<PixelFormat, PixelFormatInfo> format_info_array = {
}
},
{
- PixelFormat::XV20, {
+ PixelFormat::P230, {
PixelFormatInfo {
- "XV20",
- "XV20",
+ "P230",
+ "P230",
"",
PixelColorType::YUV,
{ 6, 2 },
@@ -610,10 +610,10 @@ static map<PixelFormat, PixelFormatInfo> format_info_array = {
}
},
{
- PixelFormat::X403, {
+ PixelFormat::T430, {
PixelFormatInfo {
- "X403",
- "X403",
+ "T430",
+ "T430",
"",
PixelColorType::YUV,
{ 1, 1 },
@@ -682,9 +682,9 @@ static map<PixelFormat, PixelFormatInfo> format_info_array = {
}
},
{
- PixelFormat::Y10_P32, {
+ PixelFormat::XYYY2101010, {
PixelFormatInfo {
- "Y10_P32",
+ "XYYY2101010",
"YPA4",
"",
PixelColorType::YUV,
@@ -987,7 +987,7 @@ static map<PixelFormat, PixelFormatInfo> format_info_array = {
"MJPEG",
"MJPG",
"MJPG",
- PixelColorType::YUV,
+ PixelColorType::Undefined,
{ 1, 1 },
{ { 1, 1, 1, 1 } },
}
@@ -1087,8 +1087,7 @@ uint32_t PixelFormatInfo::planesize(uint32_t stride, uint32_t height,
return stride * (height / pi.vsub);
}
-uint32_t PixelFormatInfo::framesize(uint32_t width, uint32_t height,
- uint32_t align) const
+uint32_t PixelFormatInfo::framesize(uint32_t width, uint32_t height, uint32_t align) const
{
uint32_t size = 0;
@@ -1113,7 +1112,7 @@ std::tuple<uint32_t, uint32_t, uint32_t> PixelFormatInfo::dumb_size(uint32_t wid
DRM_IOCTL_MODE_CREATE_DUMB takes a 'bpp' (bits-per-pixel) argument,
which is then used with the width and height to allocate the buffer.
This doesn't work for pixel formats where the average bits-per-pixel
- is not an integer (e.g. XV15)
+ is not an integer (e.g. P030)
So, we instead use the bytes_per_block (in bits) as
the 'bpp' argument, and adjust the width accordingly.
diff --git a/kms++util/src/conv-gray.h b/kms++util/src/conv-gray.h
index fed8c5c..7fead46 100644
--- a/kms++util/src/conv-gray.h
+++ b/kms++util/src/conv-gray.h
@@ -28,7 +28,7 @@ using Y12_Layout = FormatLayout<PlaneLayout<uint16_t,
using Y16_Layout = FormatLayout<PlaneLayout<uint16_t,
ComponentLayout<ComponentType::Y, 16, 0>>>;
-using Y10_P32_Layout = FormatLayout<PlaneLayout<uint32_t,
+using XYYY2101010_Layout = FormatLayout<PlaneLayout<uint32_t,
ComponentLayout<ComponentType::Y, 10, 0>, // Y0
ComponentLayout<ComponentType::Y, 10, 10>, // Y1
ComponentLayout<ComponentType::Y, 10, 20>, // Y2
diff --git a/kms++util/src/conv-yuv-planar-packed.h b/kms++util/src/conv-yuv-planar-packed.h
index 4475100..481b594 100644
--- a/kms++util/src/conv-yuv-planar-packed.h
+++ b/kms++util/src/conv-yuv-planar-packed.h
@@ -9,9 +9,9 @@
namespace kms
{
-/* YUV Planar Packed (only X403 for now) */
+/* YUV Planar Packed (only T430 for now) */
-struct X403_Layout : FormatLayout <
+struct T430_Layout : FormatLayout <
PlaneLayout<uint32_t,
ComponentLayout<ComponentType::Y, 10, 0>,
ComponentLayout<ComponentType::Y, 10, 10>,
diff --git a/kms++util/src/conv-yuv-semiplanar.h b/kms++util/src/conv-yuv-semiplanar.h
index f9d771d..81117c1 100644
--- a/kms++util/src/conv-yuv-semiplanar.h
+++ b/kms++util/src/conv-yuv-semiplanar.h
@@ -35,7 +35,7 @@ using NV16_Layout = NV12_Family_Layout<ComponentType::Cb, ComponentType::Cr, 2,
using NV61_Layout = NV12_Family_Layout<ComponentType::Cr, ComponentType::Cb, 2, 1>;
template<size_t HSub, size_t VSub>
-struct XV15_Family_Layout
+struct P030_Family_Layout
: public FormatLayout<
PlaneLayout<uint32_t,
ComponentLayout<ComponentType::Y, 10, 0>,
@@ -56,8 +56,8 @@ struct XV15_Family_Layout
static constexpr size_t v_sub = VSub;
};
-using XV15_Layout = XV15_Family_Layout<2, 2>;
-using XV20_Layout = XV15_Family_Layout<2, 1>;
+using P030_Layout = P030_Family_Layout<2, 2>;
+using P230_Layout = P030_Family_Layout<2, 1>;
template<size_t HSub, size_t VSub>
struct SubsampleHelper {
diff --git a/kms++util/src/testpat.cpp b/kms++util/src/testpat.cpp
index e424103..b9f1e56 100644
--- a/kms++util/src/testpat.cpp
+++ b/kms++util/src/testpat.cpp
@@ -379,8 +379,8 @@ static void draw_test_pattern_part(IFramebuffer& fb, size_t start_y, size_t end_
break;
switch (fb.format()) {
- CASE_YUV_SEMI(XV20);
- CASE_YUV_SEMI(XV15);
+ CASE_YUV_SEMI(P230);
+ CASE_YUV_SEMI(P030);
CASE_YUV_SEMI(NV12);
CASE_YUV_SEMI(NV21);
CASE_YUV_SEMI(NV16);
@@ -429,9 +429,9 @@ static void draw_test_pattern_part(IFramebuffer& fb, size_t start_y, size_t end_
CASE_YUV_PLANAR(YVU420);
CASE_Y_ONLY(Y8);
- CASE_Y_ONLY(Y10_P32);
+ CASE_Y_ONLY(XYYY2101010);
- CASE_YUV_PLANAR_PACKED(X403);
+ CASE_YUV_PLANAR_PACKED(T430);
CASE_RAW(SRGGB8);
CASE_RAW(SGBRG8);