commit 97b3ef8

Michael Forney  ·  2016-05-01 07:39:07 +0000 UTC
parent 3d0a76b
Rename framebuffer_plane to primary_plane to match DRM terminology
7 files changed,  +27, -27
+1, -1
1@@ -157,7 +157,7 @@ target_new(struct screen *screen)
2 	if (!target->surface)
3 		goto error1;
4 
5-	target->view = &screen->planes.framebuffer.view;
6+	target->view = &screen->planes.primary.view;
7 	target->view_handler.impl = &screen_view_handler;
8 	wl_list_insert(&target->view->handlers, &target->view_handler.link);
9 	target->current_buffer = NULL;
+1, -1
 1@@ -28,7 +28,6 @@ SWC_SOURCES =                       \
 2     libswc/data_device.c            \
 3     libswc/data_device_manager.c    \
 4     libswc/drm.c                    \
 5-    libswc/framebuffer_plane.c      \
 6     libswc/input.c                  \
 7     libswc/keyboard.c               \
 8     libswc/launch.c                 \
 9@@ -37,6 +36,7 @@ SWC_SOURCES =                       \
10     libswc/panel.c                  \
11     libswc/panel_manager.c          \
12     libswc/pointer.c                \
13+    libswc/primary_plane.c          \
14     libswc/region.c                 \
15     libswc/screen.c                 \
16     libswc/seat.c                   \
+1, -1
1@@ -41,7 +41,7 @@ bind_output(struct wl_client *client, void *data, uint32_t version, uint32_t id)
2 		flags = 0;
3 		if (mode->preferred)
4 			flags |= WL_OUTPUT_MODE_PREFERRED;
5-		if (mode_equal(&screen->planes.framebuffer.mode, mode))
6+		if (mode_equal(&screen->planes.primary.mode, mode))
7 			flags |= WL_OUTPUT_MODE_CURRENT;
8 
9 		wl_output_send_mode(resource, flags, mode->width, mode->height, mode->refresh);
R libswc/framebuffer_plane.c => libswc/primary_plane.c
+9, -9
 1@@ -1,6 +1,6 @@
 2-/* swc: framebuffer_plane.c
 3+/* swc: primary_plane.c
 4  *
 5- * Copyright (c) 2013, 2014 Michael Forney
 6+ * Copyright (c) 2013, 2014, 2016 Michael Forney
 7  *
 8  * Permission is hereby granted, free of charge, to any person obtaining a copy
 9  * of this software and associated documentation files (the "Software"), to deal
10@@ -21,7 +21,7 @@
11  * SOFTWARE.
12  */
13 
14-#include "framebuffer_plane.h"
15+#include "primary_plane.h"
16 #include "drm.h"
17 #include "event.h"
18 #include "internal.h"
19@@ -78,7 +78,7 @@ update(struct view *view)
20 static void
21 send_frame(void *data)
22 {
23-	struct framebuffer_plane *plane = data;
24+	struct primary_plane *plane = data;
25 
26 	view_frame(&plane->view, get_time());
27 }
28@@ -86,7 +86,7 @@ send_frame(void *data)
29 static int
30 attach(struct view *view, struct wld_buffer *buffer)
31 {
32-	struct framebuffer_plane *plane = wl_container_of(view, plane, view);
33+	struct primary_plane *plane = wl_container_of(view, plane, view);
34 	union wld_object object;
35 	int ret;
36 
37@@ -154,7 +154,7 @@ const static struct view_impl view_impl = {
38 static void
39 handle_page_flip(struct drm_handler *handler, uint32_t time)
40 {
41-	struct framebuffer_plane *plane = wl_container_of(handler, plane, drm_handler);
42+	struct primary_plane *plane = wl_container_of(handler, plane, drm_handler);
43 	view_frame(&plane->view, time);
44 }
45 
46@@ -162,7 +162,7 @@ static void
47 handle_swc_event(struct wl_listener *listener, void *data)
48 {
49 	struct event *event = data;
50-	struct framebuffer_plane *plane = wl_container_of(listener, plane, swc_listener);
51+	struct primary_plane *plane = wl_container_of(listener, plane, swc_listener);
52 
53 	switch (event->type) {
54 	case SWC_EVENT_ACTIVATED:
55@@ -172,7 +172,7 @@ handle_swc_event(struct wl_listener *listener, void *data)
56 }
57 
58 bool
59-framebuffer_plane_initialize(struct framebuffer_plane *plane, uint32_t crtc, struct mode *mode, uint32_t *connectors, uint32_t num_connectors)
60+primary_plane_initialize(struct primary_plane *plane, uint32_t crtc, struct mode *mode, uint32_t *connectors, uint32_t num_connectors)
61 {
62 	uint32_t *plane_connectors;
63 
64@@ -209,7 +209,7 @@ error0:
65 }
66 
67 void
68-framebuffer_plane_finalize(struct framebuffer_plane *plane)
69+primary_plane_finalize(struct primary_plane *plane)
70 {
71 	wl_array_release(&plane->connectors);
72 	drmModeCrtcPtr crtc = plane->original_crtc_state;
R libswc/framebuffer_plane.h => libswc/primary_plane.h
+7, -7
 1@@ -1,6 +1,6 @@
 2-/* swc: libswc/framebuffer_plane.h
 3+/* swc: libswc/primary_plane.h
 4  *
 5- * Copyright (c) 2013 Michael Forney
 6+ * Copyright (c) 2013, 2016 Michael Forney
 7  *
 8  * Permission is hereby granted, free of charge, to any person obtaining a copy
 9  * of this software and associated documentation files (the "Software"), to deal
10@@ -21,8 +21,8 @@
11  * SOFTWARE.
12  */
13 
14-#ifndef SWC_FRAMEBUFFER_PLANE_H
15-#define SWC_FRAMEBUFFER_PLANE_H
16+#ifndef SWC_PRIMARY_PLANE_H
17+#define SWC_PRIMARY_PLANE_H
18 
19 #include "drm.h"
20 #include "mode.h"
21@@ -32,7 +32,7 @@
22 #include <stdbool.h>
23 #include <wayland-server.h>
24 
25-struct framebuffer_plane {
26+struct primary_plane {
27 	uint32_t crtc;
28 	drmModeCrtcPtr original_crtc_state;
29 	struct mode mode;
30@@ -43,7 +43,7 @@ struct framebuffer_plane {
31 	struct wl_listener swc_listener;
32 };
33 
34-bool framebuffer_plane_initialize(struct framebuffer_plane *plane, uint32_t crtc, struct mode *mode, uint32_t *connectors, uint32_t num_connectors);
35-void framebuffer_plane_finalize(struct framebuffer_plane *plane);
36+bool primary_plane_initialize(struct primary_plane *plane, uint32_t crtc, struct mode *mode, uint32_t *connectors, uint32_t num_connectors);
37+void primary_plane_finalize(struct primary_plane *plane);
38 
39 #endif
+6, -6
 1@@ -117,8 +117,8 @@ screen_new(uint32_t crtc, struct output *output)
 2 		goto error1;
 3 	}
 4 
 5-	if (!framebuffer_plane_initialize(&screen->planes.framebuffer, crtc, output->preferred_mode, &output->connector, 1)) {
 6-		ERROR("Failed to initialize framebuffer plane\n");
 7+	if (!primary_plane_initialize(&screen->planes.primary, crtc, output->preferred_mode, &output->connector, 1)) {
 8+		ERROR("Failed to initialize primary plane\n");
 9 		goto error2;
10 	}
11 
12@@ -134,8 +134,8 @@ screen_new(uint32_t crtc, struct output *output)
13 	wl_list_insert(&screen->outputs, &output->link);
14 	wl_list_init(&screen->modifiers);
15 
16-	view_move(&screen->planes.framebuffer.view, x, 0);
17-	screen->base.geometry = screen->planes.framebuffer.view.geometry;
18+	view_move(&screen->planes.primary.view, x, 0);
19+	screen->base.geometry = screen->planes.primary.view.geometry;
20 	screen->base.usable_geometry = screen->base.geometry;
21 
22 	swc.manager->new_screen(&screen->base);
23@@ -143,7 +143,7 @@ screen_new(uint32_t crtc, struct output *output)
24 	return screen;
25 
26 error3:
27-	framebuffer_plane_finalize(&screen->planes.framebuffer);
28+	primary_plane_finalize(&screen->planes.primary);
29 error2:
30 	wl_global_destroy(screen->global);
31 error1:
32@@ -164,7 +164,7 @@ screen_destroy(struct screen *screen)
33 	wl_signal_emit(&screen->destroy_signal, NULL);
34 	wl_list_for_each_safe (output, next, &screen->outputs, link)
35 		output_destroy(output);
36-	framebuffer_plane_finalize(&screen->planes.framebuffer);
37+	primary_plane_finalize(&screen->planes.primary);
38 	cursor_plane_finalize(&screen->planes.cursor);
39 	free(screen);
40 }
+2, -2
 1@@ -26,7 +26,7 @@
 2 
 3 #include "swc.h"
 4 #include "cursor_plane.h"
 5-#include "framebuffer_plane.h"
 6+#include "primary_plane.h"
 7 
 8 #include <wayland-util.h>
 9 
10@@ -52,7 +52,7 @@ struct screen {
11 	uint8_t id;
12 
13 	struct {
14-		struct framebuffer_plane framebuffer;
15+		struct primary_plane primary;
16 		struct cursor_plane cursor;
17 	} planes;
18