Commit Graph

60 Commits

Author SHA1 Message Date
Steve Lhomme 65b813712c display: remove redundant VOUT_DISPLAY_CHANGE_DISPLAY_FILLED
If the display filling mode of the video changed, the video placement has changed as well.
Display modules don't actually care about the aspect ratio, just where they're supposed to stretch the video.
2024-04-15 05:51:40 +00:00
Steve Lhomme 0c10d95148 display: remove redundant VOUT_DISPLAY_CHANGE_ZOOM
If the zoom of the video changed, the video placement has changed as well.
Display modules don't actually care about the aspect ratio, just where they're supposed to stretch the video.
2024-04-15 05:51:40 +00:00
Steve Lhomme 4ab62d06f8 display: notify display modules when the picture placement changed
In many cases that's what they really care about. Not the display size or display filled value.
2024-04-15 05:51:40 +00:00
Steve Lhomme 2d53d9ca27 vout: pass the SPU regions to render as const
The display module should not need to modify them.
2023-11-07 09:51:52 +00:00
Steve Lhomme f599d4c4f8 subpicture: use a separate type to pass a list of SPU regions to render
It contains only the useful fields from subpicture_t.

A display module should not need to know about channels, order, ephemer, fade,
etc.
2023-11-07 09:51:52 +00:00
Steve Lhomme 6906faa15f fourcc: rename VLC_CODEC_RGBA10 to VLC_CODEC_RGBA10LE
As said in bf2f64958b, it's supposed
to match DXGI_FORMAT_R10G10B10A2_UNORM which is in fact
ABGR [1] in memory order. We declare it like 15/16-bit RGB.

We can't map it to D3D11 opaque BGRA/RGBA directly.

[1] https://learn.microsoft.com/en-us/windows/win32/api/dxgiformat/ne-dxgiformat-dxgi_format#portable-coding-for-endian-independence
2023-10-20 11:34:24 +00:00
Steve Lhomme 242928e3c8 vout/drm: remove DRM_FORMAT_YVU410
So we don't have to use VLC_CODEC_YV9 and don't have to swap U/V planes.
This chroma output should be rare enough that noone is impacted.
2023-10-18 09:04:56 +00:00
Steve Lhomme de4685a6d8 vout/drm: remove comment
DRM_FORMAT_RGBA8888 haa a VLC mapping since c6a3c197e0
2023-09-28 05:56:47 +00:00
Steve Lhomme f13bface72 vout/drm: remove unused vlc_drm_format() 2023-09-28 05:56:47 +00:00
Steve Lhomme f72e39f223 vout/drm: use vlc_drm_fourcc() instead of vlc_drm_format()
They return the same thing.
2023-09-28 05:56:47 +00:00
Steve Lhomme c3ec37df66 vout/drm: remove unused vlc_video_format_drm() 2023-09-28 05:56:47 +00:00
Steve Lhomme 21eae7ea02 vout/drm: use vlc_fourcc_drm to get the mapped chroma
So we can remove vlc_video_format_drm().
2023-09-28 05:56:47 +00:00
Steve Lhomme 1c6b4470f1 drm/fourcc: remove empty rgb_fourcc_list 2023-09-28 05:56:47 +00:00
Steve Lhomme ba10eedfdd drm/fourcc: disable 15-bit shifted one bit left
We don't have any way to convert them back to anything useful.
2023-09-28 05:56:47 +00:00
Steve Lhomme 1bec49f6ed drm/fourcc: remove fourcc mapped to RGB without masks
They won't be used from rgb_fourcc_list in that case
2023-09-28 05:56:47 +00:00
Steve Lhomme 9bb1409bb5 drm/fourcc: map 555 RGB chromas
The formats are little endian by default [1], but there may be big endian variants.
We don't have the variants where the unused bit is at the end. They also
don't exist in libavutil.

[1] https://github.com/torvalds/linux/blob/master/include/drm/drm_fourcc.h
2023-09-24 19:57:38 +00:00
Steve Lhomme 9d8087766b drm/fourcc: map 565 RGB chromas
The formats are little endian by default [1], but there may be big endian variants.

[1] https://github.com/torvalds/linux/blob/master/drivers/gpu/drm/drm_fourcc.c
2023-09-24 19:57:38 +00:00
Steve Lhomme 4f6c1922e1 drm/fourcc: map RGB24 chromas
The formats are little endian by default [1].

[1] https://github.com/torvalds/linux/blob/master/drivers/gpu/drm/drm_fourcc.c
2023-09-24 19:57:38 +00:00
Steve Lhomme 0127ad54f9 vlc_fourcc: rename VLC_CODEC_RGB24 to VLC_CODEC_RGB24M
To signify it uses a mask, and to leave room for a real VLC_CODEC_RGB24 without
a mask.
2023-09-24 19:57:38 +00:00
Steve Lhomme f859440f51 drm/fourcc: map chromas to RGB+x 2023-09-24 19:57:38 +00:00
Steve Lhomme f70f81c955 drm/fourcc: map RGB8 chromas
The memory layout is deduced from the name, not the doc [1].

[1] https://github.com/torvalds/linux/blob/master/drivers/gpu/drm/drm_fourcc.c
2023-09-15 05:45:05 +00:00
Steve Lhomme fcd8b0e42e fourcc: remove VLC_CODEC_RGB12
The only source is Linux DRM and it's supposedly handled by libplacebo
except it never uses the mask.
There is no support in libavutil/swscale or any other converter.
2023-09-11 11:12:48 +00:00
Steve Lhomme d597a97267 vout/drm: use vlc_fourcc_GetChromaBPP to get bits per pixels
VLC_CODEC_RGB15 will report 15 and will be rounded to 16 as before.
2023-09-04 07:07:03 +02:00
Steve Lhomme fc94ef9171 drm: don't use vd->fmt until it's set
At this point vd->fmt and vd->source have the same format, but only vd->source
should be read. We're the ones writing vd->fmt afterwards.
2023-08-11 14:39:28 +00:00
Rémi Denis-Courmont c6a3c197e0 drm: add BGRA 2022-06-06 17:43:23 +00:00
Rémi Denis-Courmont 17db49c1bc drm: fix build without libdrm
The display module does not actually depend on libdrm in any way.
It can be compiled with just the Linux kernel headers, so do just that.
2022-06-02 15:19:11 +00:00
Steve Lhomme e810115cf5 vout: drm: don't use vd->fmt on Open
vd->fmt is the format the display is requesting to receive. On open it's set to
the same as vd->source for convenience. But it might as well not set be at all
before Open has finished.
2022-05-31 12:11:13 +00:00
Rémi Denis-Courmont c58018e41f display: update vout_display_PlacePicture() prototype
Take only a struct vout_display_size rather than a full
struct vout_display_cfg_t. No functional changes.
2022-05-17 19:14:06 +00:00
Rémi Denis-Courmont 4bd922622b window: rename <vlc_vout_window.h> to <vlc_window.h> 2022-05-16 16:51:03 +00:00
Rémi Denis-Courmont 84c253cdd1 window: rename vout_window* to vlc_window*
The baseline windowing code has not been specific to the video output
for a while.
2022-05-16 16:51:03 +00:00
Rémi Denis-Courmont eca00803d0 drm: fix potential out of bound read
If the specified chroma had only 1 or 2 characters, this would overflow.
2022-03-24 09:31:37 +00:00
Rémi Denis-Courmont dc8f95ec89 drm: initialise sys explicitly 2022-03-24 09:31:37 +00:00
Rémi Denis-Courmont 743fa40aca drm: remove unnecessary private data fields 2022-03-24 09:31:37 +00:00
Rémi Denis-Courmont 570bed45a8 drm: remove no longer format negotiation code
This removes the notoriously nonreentrant global format table.
This also incidentally removes the dependency on `-ldrm`.
2022-03-24 09:31:37 +00:00
Rémi Denis-Courmont e3e92d8cca drm: select pixel format as other displays do
Use the helpers from the previous changesets and the follow the common
chroma fallback lists.

This should fix mismatched colour (masks) with RGB formats. This also
enables the use of a bunch of formats not included in the static table
from display.c.
2022-03-24 09:31:37 +00:00
Rémi Denis-Courmont e8b508626b drm/fourcc: add helper to convert DRM to VLC format
This extra function is needed to deal with the RGB masks.
2022-03-24 09:31:37 +00:00
Rémi Denis-Courmont 2f34395f06 drm/fourcc: fix copy-paste errors 2022-03-24 09:31:37 +00:00
Rémi Denis-Courmont 854bbb4a80 drm: add helper to negotiate a pixel format 2022-03-24 09:31:37 +00:00
Rémi Denis-Courmont 78af9d20ec drm: return number of formats
After selecting a plane, we presumably will need to query its formats.
Since we already know how many there are.
2022-03-24 09:31:37 +00:00
Rémi Denis-Courmont ee3f780e52 drm: always use the primary plane
The code used the first plane that matched the wanted pixel format.
This has mostly been working as the primary plane is normally the first
plane, but it incorrectly assumed that other plane types would not
expose further pixel formats, or that VLC would not prefer any of them.
2022-03-23 16:57:10 +00:00
Rémi Denis-Courmont 3aa9536985 drm: helper to get the primary plane 2022-03-23 16:57:10 +00:00
Rémi Denis-Courmont 82056aa6da drm: use the CRTC index helper 2022-03-23 16:57:10 +00:00
Rémi Denis-Courmont 86a84951b9 drm: add helper to find the CRTC index
(for matching planes to the CRTC)
2022-03-23 16:57:10 +00:00
Rémi Denis-Courmont 96621930fc drm: don't spam logs
Do not print the list of plane formats every time. Also don't crash if
a new type of plane is exposed by the kernel.

One can get the list of plane formats and more with the modetest or
drm_info tools. VLC video outputs do not normally list all supported
options of the hardware (imagine if GL would list all extensions...).
2022-03-22 06:13:02 +00:00
Rémi Denis-Courmont cf0b7fcb23 drm: remove stray typedef 2022-03-21 15:34:49 +00:00
Rémi Denis-Courmont 1a033eab84 drm: fix/clean up Display() error handling
drmModeSetPlane() is just a glorified ioctl(). Errors are negative
values, and the error code is in errno.
2022-03-21 15:34:49 +00:00
Rémi Denis-Courmont a9ffd6aec1 drm: add (back) P010 mapping 2022-03-17 09:40:06 +00:00
Rémi Denis-Courmont d19eda8b0e fourcc: clarify P010 and P016 2022-03-17 09:40:06 +00:00
Rémi Denis-Courmont aed74edea9 drm: remove redundant initialisation 2022-03-15 17:35:13 +00:00
Rémi Denis-Courmont 50a0bc433b drm: use the buffer allocation helpers
This rectifies ioctl parameters so that allocating frame buffers no
longer fails in kernel.

This also cleans up the triple-buffered frame buffer handling:
now we keep one picture buffer for each of the 3 front buffers, instead
of switching the property of a dummy picture all the time.
2022-03-15 17:35:13 +00:00