History

wayland: rename gpu_formats to planar_formats

The old name is misleading. We do want these formats, but it is not accurate to call them "gpu formats". Call it "planar" instead so it's more obvious these come from drm primary planes.

Dudemanguy committed 2 years ago

Commit 99d4dec1 parent c5aa7d83 files · +18 −18Browse files

Unified · Split

3 files
  1. video/out/wayland_common.c +9 −9
  2. video/out/wayland_common.h +2 −2
  3. video/out/wldmabuf/ra_wldmabuf.c +7 −7
video/out/wayland_common.c+9−9
@@ -212,7 +212,7 @@ static int spawn_cursor(struct vo_wayland_state *wl); · 211 unmodified lines
212212 static void add_feedback(struct vo_wayland_feedback_pool *fback_pool,
213213 struct wp_presentation_feedback *fback);
214214 static void apply_keepaspect(struct vo_wayland_state *wl, int *width, int *height);
215−static void get_gpu_drm_formats(struct vo_wayland_state *wl);
215+static void get_planar_drm_formats(struct vo_wayland_state *wl);
216216 static void get_shape_device(struct vo_wayland_state *wl, struct vo_wayland_seat *s);
217217 static void guess_focus(struct vo_wayland_state *wl);
218218 static void handle_key_input(struct vo_wayland_seat *s, uint32_t key, uint32_t state, bool no_emit);
@@ -1406,7 +1406,7 @@ static void tranche_target_device(void *data, · 1187 unmodified lines
14061406 memcpy(&wl->target_device_id, id, sizeof(dev_t));
14071407 break;
14081408 }
1409− get_gpu_drm_formats(wl);
1409+ get_planar_drm_formats(wl);
14101410 }
14111411 }
14121412
@@ -1828,7 +1828,7 @@ static char **get_displays_spanned(struct vo_wayland_state *wl) · 415 unmodified lines
18281828 return names;
18291829 }
18301830
1831−static void get_gpu_drm_formats(struct vo_wayland_state *wl)
1831+static void get_planar_drm_formats(struct vo_wayland_state *wl)
18321832 {
18331833 #if HAVE_DRM
18341834 drmDevice *device = NULL;
@@ -1913,15 +1913,15 @@ static void get_gpu_drm_formats(struct vo_wayland_state *wl) · 78 unmodified lines
19131913 }
19141914
19151915 plane = drmModeGetPlane(fd, res->planes[index]);
1916− wl->num_gpu_formats = plane->count_formats;
1916+ wl->num_planar_formats = plane->count_formats;
19171917
1918− if (wl->gpu_formats)
1919− talloc_free(wl->gpu_formats);
1918+ if (wl->planar_formats)
1919+ talloc_free(wl->planar_formats);
19201920
1921− wl->gpu_formats = talloc_zero_array(wl, int, wl->num_gpu_formats);
1922− for (int i = 0; i < wl->num_gpu_formats; ++i) {
1921+ wl->planar_formats = talloc_zero_array(wl, int, wl->num_planar_formats);
1922+ for (int i = 0; i < wl->num_planar_formats; ++i) {
19231923 MP_DBG(wl, "DRM primary plane supports drm format: %s\n", mp_tag_str(plane->formats[i]));
1924− wl->gpu_formats[i] = plane->formats[i];
1924+ wl->planar_formats[i] = plane->formats[i];
19251925 }
19261926
19271927 done:
video/out/wayland_common.h+2−2
@@ -115,8 +115,8 @@ struct vo_wayland_state { · 114 unmodified lines
115115 uint32_t compositor_format_size;
116116 struct drm_format *compositor_formats;
117117 int num_compositor_formats;
118− uint32_t *gpu_formats;
119− int num_gpu_formats;
118+ uint32_t *planar_formats;
119+ int num_planar_formats;
120120
121121 /* presentation-time */
122122 struct wp_presentation *presentation;
video/out/wldmabuf/ra_wldmabuf.c+7−7
@@ -35,17 +35,17 @@ bool ra_compatible_format(struct ra *ra, int imgfmt, uint32_t drm_format, uint64 · 34 unmodified lines
3535 struct drm_format *formats = wl->compositor_formats;
3636
3737
38− // If we were able to make the DRM query, filter out the GPU formats.
38+ // If we were able to make the DRM query, filter out the planar formats.
3939 // If not, just assume they all work and hope for the best.
40− if (wl->gpu_formats) {
41− bool supported_gpu_format = false;
42− for (int i = 0; i < wl->num_gpu_formats; i++) {
43− if (drm_format == wl->gpu_formats[i]) {
44− supported_gpu_format = true;
40+ if (wl->planar_formats) {
41+ bool supported_planar_format = false;
42+ for (int i = 0; i < wl->num_planar_formats; i++) {
43+ if (drm_format == wl->planar_formats[i]) {
44+ supported_planar_format = true;
4545 break;
4646 }
4747 }
48− if (!supported_gpu_format)
48+ if (!supported_planar_format)
4949 return false;
5050 }
5151

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t