create mode 100644 src/gal2d-renderer.c
create mode 100644 src/gal2d-renderer.h
-Index: weston-1.11.0/Makefile.am
+Index: weston-1.11.1/Makefile.am
===================================================================
---- weston-1.11.0.orig/Makefile.am 2016-05-19 16:36:04.000000000 -0500
-+++ weston-1.11.0/Makefile.am 2016-09-20 15:28:46.634190725 -0500
+--- weston-1.11.1.orig/Makefile.am 2016-09-20 19:35:22.000000000 -0500
++++ weston-1.11.1/Makefile.am 2017-01-14 08:35:10.000000000 -0600
@@ -247,6 +247,18 @@
src/vertex-clipping.h \
shared/helpers.h
if ENABLE_X11_COMPOSITOR
module_LTLIBRARIES += x11-backend.la
-Index: weston-1.11.0/src/compositor-fbdev.c
+Index: weston-1.11.1/src/compositor-fbdev.c
===================================================================
---- weston-1.11.0.orig/src/compositor-fbdev.c 2016-05-19 16:36:04.000000000 -0500
-+++ weston-1.11.0/src/compositor-fbdev.c 2016-09-20 17:05:27.000000000 -0500
+--- weston-1.11.1.orig/src/compositor-fbdev.c 2016-09-20 19:35:22.000000000 -0500
++++ weston-1.11.1/src/compositor-fbdev.c 2017-01-14 08:35:11.000000000 -0600
@@ -50,6 +50,7 @@
#include "libinput-seat.h"
#include "gl-renderer.h"
config->output_transform = WL_OUTPUT_TRANSFORM_NORMAL;
}
-Index: weston-1.11.0/src/gal2d-renderer.c
+Index: weston-1.11.1/src/gal2d-renderer.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ weston-1.11.0/src/gal2d-renderer.c 2016-09-20 16:58:24.000000000 -0500
++++ weston-1.11.1/src/gal2d-renderer.c 2017-01-14 08:35:10.000000000 -0600
@@ -0,0 +1,1342 @@
+/*
+ * Copyright (c) 2015 Freescale Semiconductor, Inc.
+ .output_create = gal2d_renderer_output_create,
+ .output_destroy = gal2d_renderer_output_destroy,
+};
-Index: weston-1.11.0/src/gal2d-renderer.h
+Index: weston-1.11.1/src/gal2d-renderer.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ weston-1.11.0/src/gal2d-renderer.h 2016-09-20 15:28:46.638190745 -0500
++++ weston-1.11.1/src/gal2d-renderer.h 2017-01-14 08:35:10.000000000 -0600
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2015 Freescale Semiconductor, Inc.
+};
+
+#endif
-Index: weston-1.11.0/src/compositor-fbdev.h
+Index: weston-1.11.1/src/compositor-fbdev.h
===================================================================
---- weston-1.11.0.orig/src/compositor-fbdev.h 2016-05-19 16:36:04.000000000 -0500
-+++ weston-1.11.0/src/compositor-fbdev.h 2016-09-20 17:03:37.000000000 -0500
+--- weston-1.11.1.orig/src/compositor-fbdev.h 2016-09-20 19:35:22.000000000 -0500
++++ weston-1.11.1/src/compositor-fbdev.h 2017-01-14 08:35:10.000000000 -0600
@@ -40,6 +40,7 @@
int tty;
char *device;
uint32_t output_transform;
};
-Index: weston-1.11.0/src/main.c
+Index: weston-1.11.1/src/main.c
===================================================================
---- weston-1.11.0.orig/src/main.c 2016-05-19 16:36:04.000000000 -0500
-+++ weston-1.11.0/src/main.c 2016-09-20 17:29:12.000000000 -0500
+--- weston-1.11.1.orig/src/main.c 2017-01-14 08:34:10.030218137 -0600
++++ weston-1.11.1/src/main.c 2017-01-14 08:54:45.000000000 -0600
@@ -285,7 +285,13 @@
"Options for fbdev-backend.so:\n\n"
" --tty=TTY\t\tThe tty to use\n"
" --device=DEVICE\tThe framebuffer device to use\n"
- " --use-gl\t\tUse the GL renderer\n\n");
+#if defined ENABLE_EGL
-+ " --no-use-gl\t\tDo not use the GL renderer\n"
-+ " --use-gal2d\t\tUse the GAL2D renderer\n\n");
++ " --use-gl=1\t\tUse the GL renderer (default is 1)\n"
++ " --use-gal2d=1\t\tUse the GAL2D renderer (default is 0)\n\n");
+#else
-+ " --use-gl\t\tUse the GL renderer\n"
-+ " --no-use-gal2d\t\tDo not use the GAL2D renderer\n\n");
++ " --use-gl=1\t\tUse the GL renderer (default is 0)\n"
++ " --use-gal2d=1\t\tUse the GAL2D renderer (default is 1)\n\n");
+#endif
#endif
#if defined(BUILD_HEADLESS_COMPOSITOR)
-@@ -864,18 +870,35 @@
- struct weston_config_section *section;
- char *s = NULL;
- int ret = 0;
-+#ifdef ENABLE_EGL
-+ /* GL rendering is default, so user options are --no-use-gl and --use-gal2d */
-+ int no_use_gl = 0;
-+#else
-+ /* GAL2D rendering is default, so user options are --use-gl and --no-use-gal2d */
-+ int no_use_gal2d = 0;
-+#endif
-
+@@ -868,7 +874,8 @@
const struct weston_option fbdev_options[] = {
{ WESTON_OPTION_INTEGER, "tty", 0, &config.tty },
{ WESTON_OPTION_STRING, "device", 0, &config.device },
-+#ifdef ENABLE_EGL
-+ { WESTON_OPTION_BOOLEAN, "no-use-gl", 0, &no_use_gl },
-+ { WESTON_OPTION_BOOLEAN, "use-gal2d", 0, &config.use_gal2d },
-+#else
- { WESTON_OPTION_BOOLEAN, "use-gl", 0, &config.use_gl },
-+ { WESTON_OPTION_BOOLEAN, "no-use-gal2d", 0, &no_use_gal2d },
-+#endif
+- { WESTON_OPTION_BOOLEAN, "use-gl", 0, &config.use_gl },
++ { WESTON_OPTION_INTEGER, "use-gl", 0, &config.use_gl },
++ { WESTON_OPTION_INTEGER, "use-gal2d", 0, &config.use_gal2d },
};
parse_options(fbdev_options, ARRAY_LENGTH(fbdev_options), argc, argv);
-
- if (!config.device)
- config.device = strdup("/dev/fb0");
--
-+#ifdef ENABLE_EGL
-+ config.use_gl = !no_use_gl;
-+#else
-+ config.use_gal2d = !no_use_gal2d;
-+#endif
- section = weston_config_get_section(wc, "output", "name", "fbdev");
- weston_config_section_get_string(section, "transform", &s, "normal");
- if (weston_parse_transform(s, &config.output_transform) < 0)
delete mode 100644 src/gal2d-renderer.c
delete mode 100644 src/gal2d-renderer.h
-Index: weston-1.11.0/Makefile.am
+Index: weston-1.11.1/Makefile.am
===================================================================
---- weston-1.11.0.orig/Makefile.am 2016-10-06 14:26:20.254564856 -0500
-+++ weston-1.11.0/Makefile.am 2016-10-06 14:28:47.000000000 -0500
+--- weston-1.11.1.orig/Makefile.am 2017-01-14 08:59:52.293865810 -0600
++++ weston-1.11.1/Makefile.am 2017-01-14 09:08:38.000000000 -0600
@@ -247,16 +247,16 @@
src/vertex-clipping.h \
shared/helpers.h
src/vertex-clipping.c \
src/vertex-clipping.h
-Index: weston-1.11.0/src/compositor-fbdev.c
+Index: weston-1.11.1/src/compositor-fbdev.c
===================================================================
---- weston-1.11.0.orig/src/compositor-fbdev.c 2016-10-06 14:26:20.418565670 -0500
-+++ weston-1.11.0/src/compositor-fbdev.c 2016-10-06 14:28:47.000000000 -0500
+--- weston-1.11.1.orig/src/compositor-fbdev.c 2017-01-14 08:59:52.473866702 -0600
++++ weston-1.11.1/src/compositor-fbdev.c 2017-01-14 09:19:12.000000000 -0600
@@ -50,7 +50,7 @@
#include "libinput-seat.h"
#include "gl-renderer.h"
if (fbdev_output_create(backend, 0, 0, param->device) < 0)
goto out_launcher;
-@@ -924,10 +898,10 @@
+@@ -922,13 +896,8 @@
+ * udev, rather than passing a device node in as a parameter. */
+ config->tty = 0; /* default to current tty */
config->device = "/dev/fb0"; /* default frame buffer */
- #ifdef ENABLE_EGL
- config->use_gl = 1;
+-#ifdef ENABLE_EGL
+- config->use_gl = 1;
- config->use_gal2d = 0;
-+ config->use_g2d = 0;
- #else
+-#else
config->use_gl = 0;
- config->use_gal2d = 1;
-+ config->use_g2d = 1;
- #endif
+-#endif
++ config->use_g2d = 0;
config->output_transform = WL_OUTPUT_TRANSFORM_NORMAL;
}
-Index: weston-1.11.0/src/g2d-renderer.c
+
+Index: weston-1.11.1/src/g2d-renderer.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ weston-1.11.0/src/g2d-renderer.c 2016-10-06 14:28:47.000000000 -0500
++++ weston-1.11.1/src/g2d-renderer.c 2017-01-14 09:08:38.000000000 -0600
@@ -0,0 +1,1175 @@
+/*
+ * Copyright (c) 2016 Freescale Semiconductor, Inc.
+ .output_create = g2d_renderer_output_create,
+ .output_destroy = g2d_renderer_output_destroy,
+};
-Index: weston-1.11.0/src/g2d-renderer.h
+Index: weston-1.11.1/src/g2d-renderer.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ weston-1.11.0/src/g2d-renderer.h 2016-10-06 14:28:47.000000000 -0500
++++ weston-1.11.1/src/g2d-renderer.h 2017-01-14 09:08:38.000000000 -0600
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2015 Freescale Semiconductor, Inc.
+};
+
+#endif
-Index: weston-1.11.0/src/gal2d-renderer.c
+Index: weston-1.11.1/src/gal2d-renderer.c
===================================================================
---- weston-1.11.0.orig/src/gal2d-renderer.c 2016-10-06 14:26:20.678566959 -0500
+--- weston-1.11.1.orig/src/gal2d-renderer.c 2017-01-14 08:59:52.753868091 -0600
+++ /dev/null 1970-01-01 00:00:00.000000000 +0000
@@ -1,1307 +0,0 @@
-/*
- .output_create = gal2d_renderer_output_create,
- .output_destroy = gal2d_renderer_output_destroy,
-};
-Index: weston-1.11.0/src/gal2d-renderer.h
+Index: weston-1.11.1/src/gal2d-renderer.h
===================================================================
---- weston-1.11.0.orig/src/gal2d-renderer.h 2016-10-06 14:26:20.254564856 -0500
+--- weston-1.11.1.orig/src/gal2d-renderer.h 2017-01-14 08:59:52.297865829 -0600
+++ /dev/null 1970-01-01 00:00:00.000000000 +0000
@@ -1,50 +0,0 @@
-/*
-};
-
-#endif
-Index: weston-1.11.0/src/main.c
+Index: weston-1.11.1/src/main.c
===================================================================
---- weston-1.11.0.orig/src/main.c 2016-10-06 14:26:20.258564876 -0500
-+++ weston-1.11.0/src/main.c 2016-10-06 14:28:47.000000000 -0500
+--- weston-1.11.1.orig/src/main.c 2017-01-14 08:59:52.297865829 -0600
++++ weston-1.11.1/src/main.c 2017-01-14 09:08:38.000000000 -0600
@@ -287,10 +287,10 @@
" --device=DEVICE\tThe framebuffer device to use\n"
#if defined ENABLE_EGL
- " --no-use-gl\t\tDo not use the GL renderer\n"
-- " --use-gal2d\t\tUse the GAL2D renderer\n\n");
-+ " --use-g2d\t\tUse the G2D renderer\n\n");
+ " --use-gl=1\t\tUse the GL renderer (default is 1)\n"
+- " --use-gal2d=1\t\tUse the GAL2D renderer (default is 0)\n\n");
++ " --use-g2d=1\t\tUse the G2D renderer (default is 0)\n\n");
#else
- " --use-gl\t\tUse the GL renderer\n"
-- " --no-use-gal2d\t\tDo not use the GAL2D renderer\n\n");
-+ " --no-use-g2d\t\tDo not use the G2D renderer\n\n");
+ " --use-gl=1\t\tUse the GL renderer (default is 0)\n"
+- " --use-gal2d=1\t\tUse the GAL2D renderer (default is 1)\n\n");
++ " --use-g2d=1\t\tUse the G2D renderer (default is 1)\n\n");
#endif
#endif
-@@ -871,11 +871,11 @@
- char *s = NULL;
- int ret = 0;
- #ifdef ENABLE_EGL
-- /* GL rendering is default, so user options are --no-use-gl and --use-gal2d */
-+ /* GL rendering is default, so user options are --no-use-gl and --use-g2d */
- int no_use_gl = 0;
- #else
-- /* GAL2D rendering is default, so user options are --use-gl and --no-use-gal2d */
-- int no_use_gal2d = 0;
-+ /* G2D rendering is default, so user options are --use-gl and --no-use-g2d */
-+ int no_use_g2d = 0;
- #endif
-
- const struct weston_option fbdev_options[] = {
-@@ -883,10 +883,10 @@
+@@ -875,7 +875,7 @@
+ { WESTON_OPTION_INTEGER, "tty", 0, &config.tty },
{ WESTON_OPTION_STRING, "device", 0, &config.device },
- #ifdef ENABLE_EGL
- { WESTON_OPTION_BOOLEAN, "no-use-gl", 0, &no_use_gl },
-- { WESTON_OPTION_BOOLEAN, "use-gal2d", 0, &config.use_gal2d },
-+ { WESTON_OPTION_BOOLEAN, "use-g2d", 0, &config.use_g2d },
- #else
- { WESTON_OPTION_BOOLEAN, "use-gl", 0, &config.use_gl },
-- { WESTON_OPTION_BOOLEAN, "no-use-gal2d", 0, &no_use_gal2d },
-+ { WESTON_OPTION_BOOLEAN, "no-use-g2d", 0, &no_use_g2d },
- #endif
+ { WESTON_OPTION_INTEGER, "use-gl", 0, &config.use_gl },
+- { WESTON_OPTION_INTEGER, "use-gal2d", 0, &config.use_gal2d },
++ { WESTON_OPTION_INTEGER, "use-g2d", 0, &config.use_g2d },
};
-@@ -897,7 +897,7 @@
- #ifdef ENABLE_EGL
- config.use_gl = !no_use_gl;
- #else
-- config.use_gal2d = !no_use_gal2d;
-+ config.use_g2d = !no_use_g2d;
- #endif
- section = weston_config_get_section(wc, "output", "name", "fbdev");
- weston_config_section_get_string(section, "transform", &s, "normal");
-Index: weston-1.11.0/src/compositor-fbdev.h
+ parse_options(fbdev_options, ARRAY_LENGTH(fbdev_options), argc, argv);
+Index: weston-1.11.1/src/compositor-fbdev.h
===================================================================
---- weston-1.11.0.orig/src/compositor-fbdev.h 2016-10-06 14:26:20.258564876 -0500
-+++ weston-1.11.0/src/compositor-fbdev.h 2016-10-06 14:34:09.000000000 -0500
+--- weston-1.11.1.orig/src/compositor-fbdev.h 2017-01-14 08:59:52.297865829 -0600
++++ weston-1.11.1/src/compositor-fbdev.h 2017-01-14 08:59:52.841868527 -0600
@@ -40,7 +40,8 @@
int tty;
char *device;
src/g2d-renderer.c | 4 ++--
2 files changed, 12 insertions(+), 3 deletions(-)
-Index: weston-1.11.0/src/compositor-fbdev.c
+Index: weston-1.11.1/src/compositor-fbdev.c
===================================================================
---- weston-1.11.0.orig/src/compositor-fbdev.c 2016-10-06 13:11:53.376414804 -0500
-+++ weston-1.11.0/src/compositor-fbdev.c 2016-10-06 13:19:16.000000000 -0500
+--- weston-1.11.1.orig/src/compositor-fbdev.c 2017-01-14 09:47:24.064006974 -0600
++++ weston-1.11.1/src/compositor-fbdev.c 2017-01-14 09:55:59.000000000 -0600
@@ -63,7 +63,9 @@
int use_g2d;
uint32_t output_transform;
}
if(!backend->use_g2d)
if (fbdev_output_create(backend, 0, 0, param->device) < 0)
-Index: weston-1.11.0/src/g2d-renderer.c
+Index: weston-1.11.1/src/g2d-renderer.c
===================================================================
---- weston-1.11.0.orig/src/g2d-renderer.c 2016-10-06 13:11:53.376414804 -0500
-+++ weston-1.11.0/src/g2d-renderer.c 2016-10-06 13:11:53.372414784 -0500
+--- weston-1.11.1.orig/src/g2d-renderer.c 2017-01-14 09:47:24.152007410 -0600
++++ weston-1.11.1/src/g2d-renderer.c 2017-01-14 09:48:56.000000000 -0600
@@ -756,11 +756,11 @@
switch (wl_shm_buffer_get_format(shm_buffer)) {
gs->bpp = 4;
break;
case WL_SHM_FORMAT_RGB565:
+Index: weston-1.11.1/src/main.c
+===================================================================
+--- weston-1.11.1.orig/src/main.c 2017-01-14 10:02:42.000000000 -0600
++++ weston-1.11.1/src/main.c 2017-01-14 10:02:58.000000000 -0600
+@@ -866,7 +866,17 @@
+ load_fbdev_backend(struct weston_compositor *c, char const * backend,
+ int *argc, char **argv, struct weston_config *wc)
+ {
+- struct weston_fbdev_backend_config config = {{ 0, }};
++ struct weston_fbdev_backend_config config = {
++ .base = {0},
++#ifdef ENABLE_EGL
++ .use_gl = 1,
++ .use_g2d = 0,
++#else
++ .use_gl = 0,
++ .use_g2d = 1,
++#endif
++ .clone_mode = 0,
++ };
+ struct weston_config_section *section;
+ char *s = NULL;
+ int ret = 0;
src/g2d-renderer.h | 4 +-
3 files changed, 167 insertions(+), 41 deletions(-)
-Index: weston-1.11.0/src/compositor-fbdev.c
+Index: weston-1.11.1/src/compositor-fbdev.c
===================================================================
---- weston-1.11.0.orig/src/compositor-fbdev.c 2016-10-06 13:17:41.738142236 -0500
-+++ weston-1.11.0/src/compositor-fbdev.c 2016-10-06 13:28:22.000000000 -0500
+--- weston-1.11.1.orig/src/compositor-fbdev.c 2017-01-16 13:23:48.925264352 -0600
++++ weston-1.11.1/src/compositor-fbdev.c 2017-01-16 13:23:49.013264789 -0600
@@ -61,6 +61,8 @@
struct udev_input input;
int use_pixman;
#ifdef ENABLE_EGL
gl_renderer = weston_load_module("gl-renderer.so",
"gl_renderer_interface");
-Index: weston-1.11.0/src/g2d-renderer.c
+Index: weston-1.11.1/src/g2d-renderer.c
===================================================================
---- weston-1.11.0.orig/src/g2d-renderer.c 2016-10-06 13:17:41.738142236 -0500
-+++ weston-1.11.0/src/g2d-renderer.c 2016-10-06 13:17:41.734142216 -0500
+--- weston-1.11.1.orig/src/g2d-renderer.c 2017-01-16 13:23:48.925264352 -0600
++++ weston-1.11.1/src/g2d-renderer.c 2017-01-16 13:26:17.000000000 -0600
@@ -37,15 +37,16 @@
#include <sys/ioctl.h>
#include <fcntl.h>
pixman_region32_init(&go->buffer_damage[i]);
return 0;
}
-Index: weston-1.11.0/src/g2d-renderer.h
+Index: weston-1.11.1/src/g2d-renderer.h
===================================================================
---- weston-1.11.0.orig/src/g2d-renderer.h 2016-10-06 13:17:41.738142236 -0500
-+++ weston-1.11.0/src/g2d-renderer.h 2016-10-06 13:17:41.734142216 -0500
+--- weston-1.11.1.orig/src/g2d-renderer.h 2017-01-16 13:23:48.757263519 -0600
++++ weston-1.11.1/src/g2d-renderer.h 2017-01-16 13:26:17.000000000 -0600
@@ -27,13 +27,11 @@
#define __g2d_renderer_h_
struct g2d_renderer_interface {
int (*create)(struct weston_compositor *ec);
-Index: weston-1.11.0/src/main.c
+Index: weston-1.11.1/src/main.c
===================================================================
---- weston-1.11.0.orig/src/main.c 2016-10-06 13:39:13.000000000 -0500
-+++ weston-1.11.0/src/main.c 2016-10-06 13:39:39.000000000 -0500
+--- weston-1.11.1.orig/src/main.c 2017-01-16 13:23:48.929264372 -0600
++++ weston-1.11.1/src/main.c 2017-01-16 13:32:49.000000000 -0600
@@ -287,11 +287,12 @@
" --device=DEVICE\tThe framebuffer device to use\n"
#if defined ENABLE_EGL
- " --no-use-gl\t\tDo not use the GL renderer\n"
-- " --use-g2d\t\tUse the G2D renderer\n\n");
-+ " --use-g2d\t\tUse the G2D renderer\n"
+ " --use-gl=1\t\tUse the GL renderer (default is 1)\n"
+- " --use-g2d=1\t\tUse the G2D renderer (default is 0)\n\n");
++ " --use-g2d=1\t\tUse the G2D renderer (default is 0)\n"
#else
- " --use-gl\t\tUse the GL renderer\n"
-- " --no-use-g2d\t\tDo not use the G2D renderer\n\n");
-+ " --no-use-g2d\t\tDo not use the G2D renderer\n"
+ " --use-gl=1\t\tUse the GL renderer (default is 0)\n"
+- " --use-g2d=1\t\tUse the G2D renderer (default is 1)\n\n");
++ " --use-g2d=1\t\tUse the G2D renderer (default is 1)\n"
#endif
+ " --clone-mode\t\tClone display to multiple devices\n\n");
#endif
#if defined(BUILD_HEADLESS_COMPOSITOR)
-@@ -888,6 +889,7 @@
- { WESTON_OPTION_BOOLEAN, "use-gl", 0, &config.use_gl },
- { WESTON_OPTION_BOOLEAN, "no-use-g2d", 0, &no_use_g2d },
- #endif
+@@ -886,6 +887,7 @@
+ { WESTON_OPTION_STRING, "device", 0, &config.device },
+ { WESTON_OPTION_INTEGER, "use-gl", 0, &config.use_gl },
+ { WESTON_OPTION_INTEGER, "use-g2d", 0, &config.use_g2d },
+ { WESTON_OPTION_BOOLEAN, "clone-mode", 0, &config.clone_mode },
};