Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id 1E36DE00CAA; Fri, 7 Oct 2016 20:16:43 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no * trust * [104.47.2.56 listed in list.dnswl.org] * -0.0 SPF_HELO_PASS SPF: HELO matches SPF record * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's * domain * 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily * valid * -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0056.outbound.protection.outlook.com [104.47.2.56]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 976C3E00C9D for ; Fri, 7 Oct 2016 20:16:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=G5hVfHgsNXTNc0E4nreyfg75Zo35X6WfTIZdalZz8Uo=; b=gJ+eRUnsxJsKosDOoWt6tk4KXzEtJxlUoFUDkQ/JDBvAXB6jO4YycXRLhlCAPR8KPpBX29S4p6Dd7q11MABpdW7jmcjj8glS8JMhziL9UmzQpZSlbelK8DiOnIwCoHtsC4XSi91fRd9M4zYgPav88etY9NS2xZVTyepDLWU8ODA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=tom.hochstein@nxp.com; Received: from tx30imx-01.am.freescale.net (192.88.168.49) by DBXPR04MB318.eurprd04.prod.outlook.com (10.141.232.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.659.8; Fri, 7 Oct 2016 22:42:14 +0000 From: Tom Hochstein To: Date: Fri, 7 Oct 2016 17:36:57 -0500 Message-ID: <1475879819-13562-5-git-send-email-tom.hochstein@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1475879819-13562-1-git-send-email-tom.hochstein@nxp.com> References: <1475879819-13562-1-git-send-email-tom.hochstein@nxp.com> MIME-Version: 1.0 X-Originating-IP: [192.88.168.49] X-ClientProxiedBy: BLUPR0401CA0039.namprd04.prod.outlook.com (10.162.114.177) To DBXPR04MB318.eurprd04.prod.outlook.com (10.141.232.17) X-MS-Office365-Filtering-Correlation-Id: 4b848d9f-459d-4cbf-7b72-08d3ef032f7e X-Microsoft-Exchange-Diagnostics: 1; DBXPR04MB318; 2:Hr3ZWYyzX4WG4pYQSYTeK937aUvLMmagvv+j7fW/YaFoqd7aJh3JIJc0wPDQDKEEL4maqQLojYhF8iDGaY9zTTaCfU0Z3Jfr50yYFSgGyoCj4NzZRBcHWfHhfnPIA0icr9rYhSW/OyynKY/Tt6Y1A3SLd/szvy5HpsOMr2L6muYu9obrZnUGFTJ4AT4OBvEPmy6SOITK9rwrqVe1YcEULg==; 3:DwsNvSPzaceb3eE8xK12xGON032O5DsLyuR2mVYF9MiQHFyCFyerfTBd9fRUMX+CRtzDuDQ6uL+1nFSZ/fH+9w3+H1d/p2xO9rRr/415hxUElApD6bT5wqZJgPNjdEQZCLGed8G6lmZ5D5qyRD60oQ== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DBXPR04MB318; X-Microsoft-Exchange-Diagnostics: 1; DBXPR04MB318; 25:C7zxjaeWbnwurVGHjfpeaP1NT89bW/MYEFxlB1ZuhW0Dra8zEGc3/ekEB6EOylIXmiuhXZL5yWy+PFwxcdLcVWIdK5TJ7SAeItM8uAUqU4+4Pw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qkoAAq3Y/3lpeHnbpa1fHlPj5SOMf1EAqUd1ajzHF4ouO5B9x790BC3RYxDwt4w2+WjmXWJbXsjKVBZ/EEYZhTutgPRvEA+iYL5nwVDPI9ZXkbyN7uVC58RrXEdtJdJH1t652djqfq0h3Y1ZYmROoAMcnKtlulvzwzb/a9QOqp0m4R0sywv7Bn0pWVpyQn+NC1UUqNk22Lv9rXdFdvNe8poU9ZqlV4H0OnYzItTbgQ+Gqm6QLpchPaoZeUexxeP085pUaE2p+GtAQiOLvQISv+Vp4gibrLlzjWuA/vpiHMBW8qMxPog0QGitkpuZ8YgD8GRvq1pc0RINAtphcYTiAEHvI15jsafM6NObnfE89jckObmJIYU43B2xkqRSF5rQ6UYB2H7/cLwE+CS0JkysILdYnvuVsMj3mCZSvKcdCti/XuaJGVyTfHEMhN7aX X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(788757137089); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026); SRVR:DBXPR04MB318; BCL:0; PCL:0; RULEID:; SRVR:DBXPR04MB318; X-Microsoft-Exchange-Diagnostics: 1; DBXPR04MB318; 4:sMA8GNVUz6+rb9DpH9dBRXJBSpmlstCbP6van38m+qOJjK0cbdrehm5Y3MKuXLwDB8ugC+BqQkVzd1ko1wnucgHNrXC2q7IAh7gDgazISMjD1aQ2/pISGySFNMfYMXdPDm9avn+cN4MBh3/iID0uX4akR/7pHMJPdz2qvvQysjNrgMLnSl3q6vVf6dGh10Sz4bB1/bTWxik5lRzeodsBoYvPPiJMg03RLdaW5zREGq8tm2P0f1vUY6c1Kja5nzeBDFFIcVRfWWule//N9SGOCN9DGl5S8rBBoEpDfTN/Nc6jzNFw2E48v2XmxvyjnGD7qbdo/jtSL6FD2nWd6QiZZDgupXzIuBaJiigg5JoyHbi14yFJwpM3+JFRLSx15VmO3aMyuQ47OkQWboilV/IP1FtdunTXo851U0uEvqx+BzsYHBjzBtcWl9Uphm6MKs2KZqMFTFFCfO2UBTuTPq7Yzv0EsFngt4krWUGCdBqebDGW+5a0+0/bG1hVuN65WohA X-Forefront-PRVS: 0088C92887 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(199003)(189002)(229853001)(81156014)(4326007)(230783001)(7736002)(48376002)(19580395003)(81166006)(33646002)(305945005)(97736004)(50226002)(5003940100001)(575784001)(68736007)(2906002)(36756003)(189998001)(86362001)(77096005)(110136003)(106356001)(66066001)(6666003)(6916009)(3846002)(586003)(450100001)(6116002)(2950100002)(105586002)(2351001)(5660300001)(42186005)(76176999)(50986999)(92566002)(7846002)(50466002)(101416001)(19580405001)(47776003)(5890100001)(8676002)(19627235001); DIR:OUT; SFP:1101; SCL:1; SRVR:DBXPR04MB318; H:tx30imx-01.am.freescale.net; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DBXPR04MB318; 23:h2xD1J279pCVznHzOzQVTOw52ZAVJ1lTce6WW/5nXt?= =?us-ascii?Q?qfYr0vUOjI87irzf/g/gUuS3LzI6SdU2FoxeGkh8XiaD6dzibX+cRBGMzs9i?= =?us-ascii?Q?/6N/lgXJmQmAZz15GSFSaB7UcAWKsT29b9ydXg+holapmlJFIwi6+6JADTJU?= =?us-ascii?Q?TRheguc9bkg0f7TYLEw/D/h/PtquK07pVJlosFTmuFUGfRD1vJggKtIQrkI/?= =?us-ascii?Q?fcO5NkLXWFnXSU8ffFilxVLkGv4ufMkLZ3qjKt8lyKlXzOgiAYfgUk/6oSiw?= =?us-ascii?Q?t7cEibgEKNtfT6e+1RABNBdNrbULsUd2tjnnHHKINxd7zlN4m8inBt+IB4wI?= =?us-ascii?Q?Ib7WZPfWmeB+X9J/OvLPQhBfhRToSWGuWxNdyWFAygSdbu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kj8Sy71k=3D?= X-Microsoft-Exchange-Diagnostics: 1; DBXPR04MB318; 6:1ah1vWH0+/b/eEj0hIl0XkMbazQNUT5D1EIavZ/xsvJao9Oyh34lvGE57o4nQ2d7xrd6XIpqBLuuY5JvsoMo5DuFzTfqRv9cCP5Lh02Z81L00ixchDNkbbO3g1GI2iKtU6KeImMLtf+SbhzdhiMxokZIarirOGwIkkX2sPymUkqJLxcEzmtEDXwF84Vo56UQudEp8JKjUnH/sPSeojlrgrAz/VBqxYWMPXVjWYRXTxeBai1ZV8Wa8gWI3JuV+tgqqR2zyDbGTlVDre8GPKj/ZKJBJJtyK0C/r8YmmRbLwHbl6DtCsSr4gdcEIr0+JNOic4I07EGkshI6m9vn2DttB2ecetD3pMkKydzm28UAj+0=; 5:7oGWDyeKEPraFZJed3VLArjo5meIwe/E89EtxZ+jqAShVUDXKVEXEzya1RGeSAqTYDmC8FN41vcE2kcC28dUsR6cxY0gvoFbCrZXylQ1ykkPQSBCIUdVPUuwLA/9Yuzk3WYy6dIS0ciTbnNIKQ0NIw==; 24:gnHfzGPDdGNkHsZbvqjUS7kTgufaJGayR0HjOUltL0yh+2sFeHvtpkKRLhFCAS0ji7uJ8XeGECqnTbtQoY5nsHQAZqyxrktQ8sjxwNPSw7c=; 7:BIlo+w2b3WI3suJkYdzr3MCeMmPptwInqDj6zeM5tOSA6NlecKfEk/3iAG6oi36PvgDFUqOd6bSSt1fwGVtgVeXNjr8w6xJxMuxkqyADwK30rT7ex4DrAHFd9w2E+QiZfTKVhXThX45rItnTdFDZG7CEiZgmlz7RoY0FAIqxwyr+H9vzxyiXyXe0ip/WitQ6jxNtNnwHiXZl012KcMe+Kg+Dh2AffjlXHImrF2nH98M8U1rximXL/Zw/sWSgpLEimRVJj20fg0a713EgLHcDENhFNAFvE/KcHx41nv1aPmnQvWbm1bEigxYJErUS9X+m SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Oct 2016 22:42:14.5056 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBXPR04MB318 Subject: [meta-fsl-arm][PATCH 4/6] weston: Use common API to support G2d compositor X-BeenThere: meta-freescale@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Usage and development list for the meta-fsl-* layers List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Oct 2016 03:16:43 -0000 Content-Type: text/plain Replace gcoOS_WaylandCreateVivGlobal with eglBindWaylandDisplayWL. Fix a width set error in g2d_renderer_attach_shm. Use noncached buffer in weston shm buffer. Signed-off-by: Tom Hochstein --- ...-Use-common-API-to-support-G2d-compositor.patch | 196 +++++++++++++++++++++ recipes-graphics/wayland/weston_%.bbappend | 1 + 2 files changed, 197 insertions(+) create mode 100644 recipes-graphics/wayland/weston/0013-MGS-1945-Use-common-API-to-support-G2d-compositor.patch diff --git a/recipes-graphics/wayland/weston/0013-MGS-1945-Use-common-API-to-support-G2d-compositor.patch b/recipes-graphics/wayland/weston/0013-MGS-1945-Use-common-API-to-support-G2d-compositor.patch new file mode 100644 index 0000000..4616173 --- /dev/null +++ b/recipes-graphics/wayland/weston/0013-MGS-1945-Use-common-API-to-support-G2d-compositor.patch @@ -0,0 +1,196 @@ +From bdf9a0349f84997397a1c9352ee041e6fa4256a9 Mon Sep 17 00:00:00 2001 +From: "yong.gan" +Date: Thu, 23 Jun 2016 09:15:51 +0800 +Subject: [PATCH] MGS-1945: Use common API to support G2d compositor. + +Replace gcoOS_WaylandCreateVivGlobal with eglBindWaylandDisplayWL. +Fix a width set error in g2d_renderer_attach_shm. +Use noncached buffer in weston shm buffer. + +Upstream-Status: Inappropriate [i.MX specific] +Date: Jun 21, 2016 +Signed-off-by: Yong Gan +--- + Makefile.am | 4 ++++ + src/g2d-renderer.c | 44 +++++++++++++++++++++++++++----------------- + src/g2d-renderer.h | 1 + + 3 files changed, 32 insertions(+), 17 deletions(-) + +diff --git a/Makefile.am b/Makefile.am +index f62bfc7..207864f 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -214,6 +214,7 @@ gl_renderer_la_SOURCES = \ + src/vertex-clipping.h \ + shared/helpers.h + endif ++ + module_LTLIBRARIES += g2d-renderer.la + g2d_renderer_la_LDFLAGS = -module -avoid-version + g2d_renderer_la_LIBADD = $(COMPOSITOR_LIBS) $(EGL_LIBS) -lg2d +@@ -226,6 +227,9 @@ g2d_renderer_la_SOURCES = \ + src/g2d-renderer.c \ + src/vertex-clipping.c \ + src/vertex-clipping.h ++if ENABLE_EGL ++g2d_renderer_la_CFLAGS += -DENABLE_EGL ++endif + + if ENABLE_X11_COMPOSITOR + module_LTLIBRARIES += x11-backend.la +diff --git a/src/g2d-renderer.c b/src/g2d-renderer.c +index 4440fb9..0c26e91 100644 +--- a/src/g2d-renderer.c ++++ b/src/g2d-renderer.c +@@ -46,7 +46,7 @@ + #include "shared/helpers.h" + + #define BUFFER_DAMAGE_COUNT 2 +-extern struct wl_global* gcoOS_WaylandCreateVivGlobal(struct wl_display* display); ++#define ALIGN_WIDTH(a) (((a) + 15) & ~15) + + typedef struct _g2dRECT + { +@@ -103,7 +103,11 @@ struct g2d_surface_state { + struct g2d_renderer { + struct weston_renderer base; + struct wl_signal destroy_signal; +- struct wl_global *viv_global; ++#ifdef ENABLE_EGL ++ NativeDisplayType display; ++ EGLDisplay egl_display; ++ struct wl_display *wl_display; ++#endif + void *handle; + }; + +@@ -296,9 +300,10 @@ g2d_getG2dFormat(IN gceSURF_FORMAT Format, enum g2d_format* g2dFormat) + } + } + +-static void printG2dSurfaceInfo(struct g2d_surfaceEx* g2dSurface) ++static void printG2dSurfaceInfo(struct g2d_surfaceEx* g2dSurface, const char* msg) + { +- weston_log("physicAddr = %d left = %d right = %d top=%d bottom=%d stride= %d tiling = %d, format=%d \n", ++ weston_log("%s physicAddr = %x left = %d right = %d top=%d bottom=%d stride= %d tiling = %d, format=%d \n", ++ msg, + g2dSurface->base.planes[0], + g2dSurface->base.left, + g2dSurface->base.right, +@@ -357,8 +362,8 @@ g2d_blitSurface(void *handle, struct g2d_surfaceEx * srcG2dSurface, struct g2d_s + + if(g2d_blitEx(handle, srcG2dSurface, dstG2dSurface)) + { +- printG2dSurfaceInfo(srcG2dSurface); +- printG2dSurfaceInfo(dstG2dSurface); ++ printG2dSurfaceInfo(srcG2dSurface, "SRC:"); ++ printG2dSurfaceInfo(dstG2dSurface, "DST:"); + return -1; + } + return 0; +@@ -724,7 +729,7 @@ g2d_renderer_flush_damage(struct weston_surface *surface) + wl_shm_buffer_begin_access(buffer->shm_buffer); + if(gs->shm_buf) + { +- int alignedWidth = (buffer->width + 15) & ~15; ++ int alignedWidth = ALIGN_WIDTH(buffer->width); + if(alignedWidth == buffer->width) + { + int size = wl_shm_buffer_get_stride(buffer->shm_buffer)*buffer->height; +@@ -743,7 +748,6 @@ g2d_renderer_flush_damage(struct weston_surface *surface) + } + } + } +- g2d_cache_op(gs->shm_buf, G2D_CACHE_CLEAN); + } + else + { +@@ -768,7 +772,6 @@ g2d_renderer_attach_shm(struct weston_surface *es, struct weston_buffer *buffer, + struct wl_shm_buffer *shm_buffer) + { + struct g2d_surface_state *gs = get_surface_state(es); +- int stride = 0; + int buffer_length = 0; + int alloc_new_buff = 1; + int alignedWidth = 0; +@@ -776,9 +779,7 @@ g2d_renderer_attach_shm(struct weston_surface *es, struct weston_buffer *buffer, + buffer->shm_buffer = shm_buffer; + buffer->width = wl_shm_buffer_get_width(shm_buffer); + buffer->height = wl_shm_buffer_get_height(shm_buffer); +- alignedWidth = (buffer->width + 15) & ~15; +- stride = wl_shm_buffer_get_stride(shm_buffer); +- buffer_length = stride * buffer->height; ++ alignedWidth = ALIGN_WIDTH(buffer->width); + + switch (wl_shm_buffer_get_format(shm_buffer)) { + case WL_SHM_FORMAT_XRGB8888: +@@ -812,7 +813,7 @@ g2d_renderer_attach_shm(struct weston_surface *es, struct weston_buffer *buffer, + { + if(gs->shm_buf) + g2d_free(gs->shm_buf); +- gs->shm_buf = g2d_alloc(buffer_length, 1); ++ gs->shm_buf = g2d_alloc(buffer_length, 0); + gs->g2d_surface.base.planes[0] = gs->shm_buf->buf_paddr; + } + gs->g2d_surface.base.left = 0; +@@ -820,7 +821,7 @@ g2d_renderer_attach_shm(struct weston_surface *es, struct weston_buffer *buffer, + gs->g2d_surface.base.right = buffer->width; + gs->g2d_surface.base.bottom = buffer->height; + gs->g2d_surface.base.stride = alignedWidth; +- gs->g2d_surface.base.width = buffer->width; ++ gs->g2d_surface.base.width = alignedWidth; + gs->g2d_surface.base.height = buffer->height; + gs->g2d_surface.base.rot = G2D_ROTATION_0; + gs->g2d_surface.base.clrcolor = 0xFF400000; +@@ -953,7 +954,7 @@ static void + g2d_renderer_output_destroy(struct weston_output *output) + { + struct g2d_output_state *go = get_output_state(output); +- gctUINT32 i; ++ int i; + + for (i = 0; i < 2; i++) + { +@@ -1005,8 +1006,12 @@ g2d_renderer_destroy(struct weston_compositor *ec) + struct g2d_renderer *gr = get_renderer(ec); + + wl_signal_emit(&gr->destroy_signal, gr); +- wl_global_destroy(gr->viv_global); + g2d_close(gr->handle); ++#ifdef ENABLE_EGL ++ eglUnbindWaylandDisplayWL(gr->egl_display); ++ eglTerminate(gr->egl_display); ++ fbDestroyDisplay(gr->display); ++#endif + free(ec->renderer); + ec->renderer = NULL; + } +@@ -1247,7 +1252,12 @@ g2d_renderer_output_create(struct weston_output *output, struct wl_display *wl_d + return -1; + go->clone_display_num = clone_display_num; + output->renderer_state = go; +- gr->viv_global = gcoOS_WaylandCreateVivGlobal(wl_display); ++#ifdef ENABLE_EGL ++ gr->wl_display = wl_display; ++ gr->display = fbGetDisplay(wl_display); ++ gr->egl_display = eglGetDisplay(gr->display); ++ eglBindWaylandDisplayWL(gr->egl_display, wl_display); ++#endif + getBufferNumber(go); + + if(g2d_renderer_surface_create(go, gr, displays[0]) < 0) +diff --git a/src/g2d-renderer.h b/src/g2d-renderer.h +index 45c72de..fc4ca49 100644 +--- a/src/g2d-renderer.h ++++ b/src/g2d-renderer.h +@@ -30,6 +30,7 @@ + + #ifdef ENABLE_EGL + #include ++#include + #endif + + struct g2d_renderer_interface { +-- +1.9.1 + diff --git a/recipes-graphics/wayland/weston_%.bbappend b/recipes-graphics/wayland/weston_%.bbappend index d0ccb01..0468149 100644 --- a/recipes-graphics/wayland/weston_%.bbappend +++ b/recipes-graphics/wayland/weston_%.bbappend @@ -11,6 +11,7 @@ SRC_URI_append_imxgpu2d = " \ file://0010-MGS-1284-1-xwld-Re-implement-weston-2d-renderer-with.patch \ file://0011-MGS-1724-xwld-G2D-compositor-build-failed-in-slevk-b.patch \ file://0012-MGS-1783-xwld-Add-clone-mode-support-for-multi-displ.patch \ + file://0013-MGS-1945-Use-common-API-to-support-G2d-compositor.patch \ " PACKAGECONFIG_IMX_TO_APPEND = "" -- 1.9.1