summaryrefslogtreecommitdiff
path: root/kms++
AgeCommit message (Collapse)Author
2020-12-03crtc: add legacy gamma setTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2020-12-03atomicreq: throw on non-existing propertyTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2020-12-01Fix clang-tidy reported issuesTomi Valkeinen
2020-10-09Bulk format of all filesTomi Valkeinen
2020-10-09dmabuffb: add constructor which takes in string fourccTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2020-10-08added #include <string> to card.h to follow gcc10 porting guideTobias Off
2020-10-02Small Property improvementsTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2020-09-29Fix Plane::get_possible_crtcsTomi Valkeinen
Looks like RPi gives 0xff as possible_crtcs, even if there's only one crtc. The current code throws an exception in that case. Fix this by just ignoring non-existent possible crtcs. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2020-09-14Add meson buildTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2020-08-10kms++: Add support for missing 8 -and 16-bit RGB formatsLaurent Pinchart
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>
2020-08-10kms++: Add support for the planar YUV formatsLaurent Pinchart
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>
2020-08-10kms++: Add support for semiplanar YUV422 formats (NV16 and NV61)Laurent Pinchart
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>
2020-08-10dumbfb: Fix pitch for tri-planar formatsLaurent Pinchart
The BO pitches are unconditionally set to the frame buffer pitch, for all planes. This is correct for semiplanar YUV formats, as they subsample chroma horizontally by two but combined U and V in a single plane, cancelling each other. For fully planar YUV formats, however, the horizontal subsampling need to be taken into account to compute the pitch. Fix it. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2020-08-10dumbfb: Add support tri- or quadri-planar buffersLaurent Pinchart
The DumbFrameBuffer class supports up to 4 planes, as required by the DRM/KMS API, but only considers planes 0 and 1 when constructing the buffer. Fix it. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2020-08-10card: Rename has_has_universal_planes to has_universal_planesLaurent Pinchart
The has_has_universal_planes() method name includes a typo, fix it. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2020-08-10card: Add a method to retrieve the device minorLaurent Pinchart
The device minor number is needed to access the debugfs directory corresponding to the device. Make it available to users through a dev_minor() method on the Card object. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2020-05-28card: add factory function for selecting card by nameMatt Hoosier
Uses drmOpen() to do the heavy lifting.
2020-05-28card: add constructor for pre-opened FDMatt Hoosier
This is an escape hatch to let the user do whatever crazy thing he wants to obtain the DRM fd. This could be from a DRM lease, an FD passed across a Wayland protocol request, something calculated by manually walking across the set of DRI cards and selecting specific criteria, etc.
2020-05-17Merge pull request #54 from ilteroi/gcc10Tomi Valkeinen
fix compiler errors with gcc 10
2020-05-15fix compiler errors with gcc 10Peter Trompeter
2020-05-15kmstest: allow enabling output without anything connectedTomi Valkeinen
Allow kmstest to enable an output without anything connected, if the user gives a videomode. DRM framework allows this, and is needed for testing. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2020-04-02Include arrayHaibo Huang
2020-03-03Supply pkg-config filesMatt Hoosier
These are customary, and pretty straightforward to offer.
2020-01-29PixelFormats: cast to uin32_tTomi Valkeinen
PixelFormat is an uint32_t underneath, so use that type instead of int when casting. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2020-01-16Link libfmt in header-only modeMatt Hoosier
This saves us the trouble of having a copy of its shared library installed into the target filesystem, which would conflict with an independently packaged copy. Only the headers are needed to accomplish the usages that Kms++ makes.
2019-11-19Set a dummy version number on the shared librariesMatt Hoosier
This makes package managers happier when the software is built as a dynamic-library. Signed-off-by: Matt Hoosier <matt.hoosier@garmin.com>
2019-11-18Allow making extframebuffer and dmabufframebuffer with modifiersMatt Hoosier
Many GPUs use bandwidth compression or tiling, and this information must be passed along to KMS when constructing the framebuffer object around the GEM handle or prime filedescriptor. Add an vector of modifiers as an optional parameter to both of these classes. Bump the minimum required version of libdrm to 2.4.17 to ensure drmModeAddFB2WithModifiers() is available. Signed-off-by: Matt Hoosier <matt.hoosier@garmin.com>
2019-11-18fbs: use std::array and .at()Tomi Valkeinen
Use std::array and .at() to get bounds checking. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2019-11-18fbs: check params and ensure drmModeAddFB2 is passed correctly sized arraysTomi Valkeinen
Check that parameter vectors are of the same size, and match the number of planes. Extend the vectors to 4, as drmModeAddFB2() expects to get arrays of 4 elements. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Reported-by: Matt Hoosier <matt.hoosier@garmin.com>
2019-11-06kms++: modernize deprecated headersTomi Valkeinen
2019-11-06kms++: use 'override' all aroundTomi Valkeinen
2019-11-06card: remove useless constsTomi Valkeinen
2019-11-06dumbfb: cleanup to avoid calls to virtual funcs via constructorTomi Valkeinen
2019-11-06fb: add begin_cpu_access & end_cpu_accessTomi Valkeinen
2019-11-06Split dmabuf support from ExtFramebuffer into DmabufFramebufferTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2019-11-06extframebuffer: add missing includeTomi Valkeinen
2019-10-02card: move DRM version data to CardVersionTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2019-09-25videomode to_string improvementsTomi Valkeinen
Add to_string_short() and to_string_long() to videomode (using the fmt library) for easy printing of videomodes. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2019-04-09add support for more pixel formatsTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2019-01-17card: another try with card constructorsTomi Valkeinen
Let's try again with the card constructors. Card::open_modesetting_card() is removed. The main constructor is Card(const std::string& dev_path = ""). If dev_path is set, the device node with that path is used. If dev_path is not set, the behavior is similar as previously, except a modeset capable card is used at the third step: - If KMSXX_DEVICE env variable is set, the card device with that path is opened. - If KMSXX_DRIVER env variable is set, the card with the given driver name and index is opened. The format is either "drvname" or "drvname:idx". - If neither env variable is given, the first modeset capable card is opened. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2019-01-17card: add has_kms()Tomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2019-01-17card: use glob() to look for card filesTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2019-01-14card: add open_modesetting_card()Tomi Valkeinen
Add open_modesetting_card() which iterates the DRM cards and returns the first one that has crtcs and connectors. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2019-01-14card: don't throw if no dumb buffersTomi Valkeinen
Allow opening DRM cards without dumb buffers. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2019-01-14card: don't throw when no resourcesTomi Valkeinen
Allow opening DRM cards without any resources. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2019-01-14Card: improve DRM card selectionTomi Valkeinen
Add new Card constructor: Card(const std::string& driver, uint32_t idx) which can be used to open Nth card for the given driver. The default constructor behavior is: - If KMSXX_DEVICE env variable is set, the card device with that path is opened. - If KMSXX_DRIVER env variable is set, the card with the given driver name and index is opened. The format is either "drvname" or "drvname:idx". - If neither env variable is given, open /dev/dri/card0 Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2019-01-14Card: add support to get the driver nameTomi Valkeinen
Add support to get the driver name. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2019-01-14card: cleanup fd usageTomi Valkeinen
Use m_fd consistently. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2018-10-17Add AR12 & AR15 supportTomi Valkeinen
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2018-09-28Add include of <cerrno> to various filesAndrew F. Davis
This is needed for building with some version of some compilers where it is not automatically included with the existing include set (clang). Signed-off-by: Andrew F. Davis <afd@ti.com>