[PATCH 0/2] Add support for multiple framebuffer outputs

Bryce Harrington bryce at osg.samsung.com
Fri Aug 7 12:37:39 PDT 2015


On Tue, Jul 07, 2015 at 07:31:26AM -0500, Derek Foreman wrote:
> On 06/07/15 03:31 AM, Sjoerd Simons wrote:
> > This patchset add support for driving multiple framebuffers from weston. First
> > patch drops the intermediate shadow buffer in the fbdev compositor, which
> > turned out to be both unneeded and buggy with non-0x0 rooted outputs second
> > patch actually adds multiple output support.
> > 
> > Sjoerd Simons (2):
> >   compositor-fbdev: Drop intermediate shadow buffer
> >   fbdev-compositor: enumerate framebuffer device using udev
> > 
> >  src/compositor-fbdev.c | 148 +++++++++++++++++++++++--------------------------
> >  1 file changed, 68 insertions(+), 80 deletions(-)
> > 
> 
> I like this,
> 
> Reviewed-By: Derek Foreman <derekf at osg.samsung.com>
> 
> For both.  Some trivial comments on the second.
> 
> There are some other cases where non 0x0 outputs have funny behaviour
> (with patches in patchwork), but I think they only apply to non-zero Y.

Hi Sjoerd, thanks for these changes.  Unfortunately the first patch no
longer applies.  Would you mind updating it to current git?  Sounds like
Derek's suggestions would be worth folding in as well.  Thanks!

Bryce

Applying patch #53689 using 'git am'
Description: [1/2] compositor-fbdev: Drop intermediate shadow buffer
Applying: compositor-fbdev: Drop intermediate shadow buffer
error: patch failed: src/compositor-fbdev.c:551
error: src/compositor-fbdev.c: patch does not apply
Patch failed at 0001 compositor-fbdev: Drop intermediate shadow buffer
The copy of the patch that failed is found in:
   /home/bryce/src/Wayland/weston/.git/rebase-apply/patch

------------------

---
src/compositor-fbdev.c | 68 +++-----------------------------------------------
 1 file changed, 3 insertions(+), 65 deletions(-)

diff --git a/src/compositor-fbdev.c b/src/compositor-fbdev.c
index a6fd823..75ad646 100644
--- a/src/compositor-fbdev.c
+++ b/src/compositor-fbdev.c
@@ -89,8 +89,6 @@ struct fbdev_output {
 
 	/* pixman details. */
 	pixman_image_t *hw_surface;
-	pixman_image_t *shadow_surface;
-	void *shadow_buf;
 	uint8_t depth;
 };
 
@@ -130,39 +128,11 @@ fbdev_output_repaint_pixman(struct weston_output *base, pixman_region32_t *damag
 {
 	struct fbdev_output *output = to_fbdev_output(base);
 	struct weston_compositor *ec = output->base.compositor;
-	pixman_box32_t *rects;
-	int nrects, i;
 
 	/* Repaint the damaged region onto the back buffer. */
-	pixman_renderer_output_set_buffer(base, output->shadow_surface);
+	pixman_renderer_output_set_buffer(base, output->hw_surface);
 	ec->renderer->repaint_output(base, damage);
 
-	/* Transform and composite onto the frame buffer. */
-	rects = pixman_region32_rectangles(damage, &nrects);
-
-	for (i = 0; i < nrects; i++) {
-		pixman_box32_t transformed_rect;
-		int width, height;
-
-		transformed_rect = weston_transformed_rect(base->width,
-							   base->height,
-							   base->transform,
-							   1, rects[i]);
-		width = transformed_rect.x2 - transformed_rect.x1;
-		height = transformed_rect.y2 - transformed_rect.y1;
-		pixman_image_composite32(PIXMAN_OP_SRC,
-			output->shadow_surface, /* src */
-			NULL /* mask */,
-			output->hw_surface, /* dest */
-			transformed_rect.x1, /* src_x */
-			transformed_rect.y1, /* src_y */
-			0, 0, /* mask_x, mask_y */
-			transformed_rect.x1, /* dest_x */
-			transformed_rect.y1, /* dest_y */
-			width, /* width */
-			height /* height */);
-	}
-
 	/* Update the damage region. */
 	pixman_region32_subtract(&ec->primary_plane.damage,
 	                         &ec->primary_plane.damage, damage);
@@ -487,8 +457,6 @@ fbdev_output_create(struct fbdev_compositor *compositor,
 	struct fbdev_output *output;
 	struct weston_config_section *section;
 	int fb_fd;
-	int width, height;
-	unsigned int bytes_per_pixel;
 	struct wl_event_loop *loop;
 	uint32_t config_transform;
 	char *s;
@@ -551,24 +519,9 @@ fbdev_output_create(struct fbdev_compositor *compositor,
 	                   config_transform,
 			   1);
 
-	width = output->mode.width;
-	height = output->mode.height;
-	bytes_per_pixel = output->fb_info.bits_per_pixel / 8;
-
-	output->shadow_buf = malloc(width * height * bytes_per_pixel);
-	output->shadow_surface =
-		pixman_image_create_bits(output->fb_info.pixel_format,
-		                         width, height,
-		                         output->shadow_buf,
-		                         width * bytes_per_pixel);
-	if (output->shadow_buf == NULL || output->shadow_surface == NULL) {
-		weston_log("Failed to create surface for frame buffer.\n");
-		goto out_hw_surface;
-	}
-
 	if (compositor->use_pixman) {
 		if (pixman_renderer_output_create(&output->base) < 0)
-			goto out_shadow_surface;
+			goto out_hw_surface;
 	} else {
 		setenv("HYBRIS_EGLPLATFORM", "wayland", 1);
 		if (gl_renderer->output_create(&output->base,
@@ -576,11 +529,10 @@ fbdev_output_create(struct fbdev_compositor *compositor,
 					       gl_renderer->opaque_attribs,
 					       NULL, 0) < 0) {
 			weston_log("gl_renderer_output_create failed.\n");
-			goto out_shadow_surface;
+			goto out_hw_surface;
 		}
 	}
 
-
 	loop = wl_display_get_event_loop(compositor->base.wl_display);
 	output->finish_frame_timer =
 		wl_event_loop_add_timer(loop, finish_frame_handler, output);
@@ -594,11 +546,7 @@ fbdev_output_create(struct fbdev_compositor *compositor,
 
 	return 0;
 
-out_shadow_surface:
-	pixman_image_unref(output->shadow_surface);
-	output->shadow_surface = NULL;
 out_hw_surface:
-	free(output->shadow_buf);
 	pixman_image_unref(output->hw_surface);
 	output->hw_surface = NULL;
 	weston_output_destroy(&output->base);
@@ -623,16 +571,6 @@ fbdev_output_destroy(struct weston_output *base)
 	if (compositor->use_pixman) {
 		if (base->renderer_state != NULL)
 			pixman_renderer_output_destroy(base);
-
-		if (output->shadow_surface != NULL) {
-			pixman_image_unref(output->shadow_surface);
-			output->shadow_surface = NULL;
-		}
-
-		if (output->shadow_buf != NULL) {
-			free(output->shadow_buf);
-			output->shadow_buf = NULL;
-		}
 	} else {
 		gl_renderer->output_destroy(base);
 	}


More information about the wayland-devel mailing list