| Age | Commit message (Collapse) | Author |
|
Enable enumeration of writeback connectors if both libdrm and the device
support it. The new Card::has_writeback() method report if the card
support writeback connectors.
Existing code that expect all connectors to model an output may be
confused by the sudden availability of new connectors. To handle this
issue,
- add a KMSXX_DISABLE_WRITEBACK_CONNECTORS environment variable to
disable enumeration of writeback connectors, similarly to universal
planes ; and
- ignore writeback connectors where no specific connector is requested
(Card::get_first_connected_connector(),
ResourceManager::reserve_connector() if no connector name is
specified, and applications that use all connected outputs).
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
Add a new method to write the contents of a framebuffer to a file
descriptor. This can be used to capture frames from writeback
connectors.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
|
|
Replace the hand-rolled draw_color_bar call in FlipState::draw_bar with
pixpat's "vbar" pattern via a new draw_vbar_pattern helper in kms++util.
The pattern fills the full buffer, so the old_xpos bookkeeping for
clearing the previous bar is no longer needed.
|
|
Switch draw_test_pattern() to call libpixpat (linked statically into
libkms++util.so) instead of the in-tree pattern generator. Pixpat
covers every pattern (kmstest, smpte, solid colors) and every pixel
format the previous generator handled, so behavior is unchanged for
all callers.
Drop the now-unused machinery: conv.h and conv-*.h template writers,
color16.h (RGB16/YUV16 plus conversions), the *_old / _single / _multi
declarations that had no definitions or callers, and the c_draw_test_pattern
C ABI which had no callers anywhere in the tree. RecStandard and
ColorRange move from color16.h directly into kms++util.h, since they
are still part of the public TestPatternOptions struct.
|
|
|
|
We can use std::format() and a custom print() wrapper with C++20. When
moving to C++23, we can drop the wrapper.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
|
|
|
|
This commit addresses cppcheck warnings about variables that can be
declared as const references (constVariableReference). These variables
were being copied unnecessarily when they could be accessed as const
references, improving performance and code clarity.
Fixed files:
- kms++util/src/cpuframebuffer.cpp: Make plane reference const in destructor
- kms++util/src/testpat.cpp: Make info and lambda parameter const references
- utils/kmstest.cpp: Make loop variable const reference in output parsing
|
|
Fix cppcheck shadowVariable and shadowArgument warnings by renaming
local variables to avoid conflicts:
- Rename 'ob' to 'prop' in property creation loop in card.cpp
- Rename loop variable 'y_offset' to 'y_off' in conv-yuv-semiplanar.h
- Rename local 'y' to 'y_val' in SMPTE pattern generator in testpat.cpp
- Rename 'is_last' to 'child_is_last' in entry printing in kmsprint.cpp
These changes eliminate naming conflicts while preserving functionality
and improving code clarity.
|
|
Fix cppcheck performance warnings by passing function parameters
by const reference instead of by value, preventing unnecessary
copies:
- string parameters in open_device_by_path()
- set<Connector*> parameters in connector finder functions
- vector parameter in FlipState constructor
- range variable in kmscapture loop
These changes improve performance by avoiding object copies while
maintaining the same functionality.
|
|
C-style casts should be replaced with appropriate C++ cast operators
for better type safety and code clarity. This change fixes cppcheck
style warnings about C-style pointer casting by using:
- static_cast for simple pointer type conversions
- reinterpret_cast for memory buffer pointer arithmetic
The changes maintain identical functionality while following modern
C++ best practices for explicit casting.
|
|
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
|
|
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
|
|
We can generate test patterns for pixel formats not in DRM, so we can't
take DRM fourcc as a parameter for c_draw_test_pattern(). Switch it to
format name instead.
This is a ABI change, but it is marked as super experimental.
Also, it feels a bit odd to add non-DRM format handling to kms++. But it
feels a bit pointless to split the testpat generation to a separate
library.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
|
|
|
|
|
|
Only Y8 and Y10_P32 can be used and have been tested for now.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
|
|
|
|
Add a draw_test_pattern for C ABI (i.e. not C++). This function can be
easily called from Python with ctypes, without any kind of bindings.
Experimental, ABI can change.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
|
|
|
|
New templated conversion and test pattern code.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
|
|
New pixel format code, from Python pixutils library.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
|
|
|
|
The IFramebuffer::map() function is not thread-safe, which is why the
threaded implementation of draw_test_pattern_impl() maps all planes
before starting to draw. A typo slipped in the code, resulting in only
plane 0 being mapped. This didn't result in an immediate segfault, as
drawing operations in the worker threads map the remaining planes.
However, due to the implementation of DumbFramebuffer::map(), this can
result in the same plane being mapped multiple times, with only one of
the mapping recorded in the mapping cache. The other mappings are then
leaked, leading not only to extra memory consumption, but also to the
DRM device never being released even after the destruction of the Card
object.
Fix this.
Fixes: 40d96062a37c ("Revert "testpat: remove threaded drawing"")
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
|
|
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
|
|
Add support for drawing Y210, Y212, Y216 pixels.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
|
|
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
|
|
Create v4l2++ library and pyv4l2, which are independent from the rest of
the kms++.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
|
|
|
|
Add support for the RGB332, XRGB1555 and XRGB4444 formats to the
PixelFormat class, the Python API, and the drawing utilities.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
|
|
Add support for the 6 planar YUV formats (YUV and YVU, combined with
420, 422 or 444 subsampling) to the PixelFormat class, the Python API,
and the drawing utilities.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
|
|
Add support for the NV16 and NV61 pixel formats to the PixelFormat
class, the Python API, and the drawing utilities.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
|
|
|
|
fix compiler errors with gcc 10
|
|
|
|
This makes the ResourceManager class much more functional
for uses where the set of resources used to scan out a
scene changes from frame to frame. The atomic modesetting
API discipline requires a brute-force search to find a
compatible pairing of planes/etc, and being able to reserve
bits incrementally is much simpler than throwing out the
entire resourcemanager and make a new one each time a
resource reserved in a tentative attempt to probe its
compatibility with an test-mode atomic commit, turns out not
to pan out.
|
|
|
|
|
|
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
|
|
V4L2 and DRM differ in their interpretation of YUV420::NV12
V4L2 NV12 is a Y and UV co-located planes in a single plane buffer.
DRM NV12 is a Y and UV planes presented as dual plane buffer, which is
known as NM12 in V4L2.
Since here we have hybrid DRM/V4L2 user space helper functions we need
to translate DRM::NV12 to V4L2:NM12 pixel format back and forth to keep
the data view consistent.
Signed-off-by: Benoit Parrot <bparrot@ti.com>
|
|
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
|
|
Add selection API support to the VideoSteamer class.
Signed-off-by: Benoit Parrot <bparrot@ti.com>
|
|
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
|
|
This reverts commit 33246d9b5fb0347aabd62caac1da03440f9e1634.
Add threaded drawing back, but have it behind a CMAKE variable so that
it can easily be turned off.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
|
|
|
|
Threading causes easily issues with (at least) static linking. Let's
just remove it as it's not really that important.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
|
|
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
|
|
Provide a space between the return type and the function definition
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
|
|
|
|
|