From patchwork Wed May 15 09:05:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Griffin X-Patchwork-Id: 164265 Delivered-To: patches@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp500777ili; Wed, 15 May 2019 02:07:14 -0700 (PDT) X-Received: by 2002:a1c:1b49:: with SMTP id b70mr13686909wmb.50.1557911234243; Wed, 15 May 2019 02:07:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557911234; cv=none; d=google.com; s=arc-20160816; b=UlozI8lJ0qattDNc50rkp7CujqdNGIWS43NW1i6Izu2w8oHnzMArFRVJqvbcfYEgGj Owl3R7cjdFUivl/u1wXOiBhwAO44p4xckCJWmYrvrKAzUqntKbHhinYZvMDsyFmWtTuH wsxcAFDpyNeAN4ZV2WIyFP3UjECH1UHPHwpML92Mw5HZR/4V025C5f4G9UDAEeOuLOtt LGQwMQMSnPeA+MTRqCWnfsNNl70w6EbpNLFJJKg6Sj5092+4a3qfAqYpMWdDln3eHxna YRdXwwBmEiGmZCCT+5AIw3Kw0xnGP8DzYRwMvtq6s9g6vFiCJll6JH+w3++nB9ctrtKR lGYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:dkim-signature; bh=c7IMP/3hc94JsYmdSwnbB2SB0D5Upp0wtqpZp2Ig1uc=; b=ZrFLxNN/3VR5aI46uAz2Ib+PoKTEFpy6SYldygU1g9qVkfT9viz8rJvBIF58DwPmjf hmJIL+fr0uuNfgbpr35IaJHXA/0nZ0heM+z86hs9B/QEXoKgSU7kjcXvRJ4OoogNhDZh E1b1GeHqJo+1my2FllWlqVd2leTIhTVJTVAB4dwi6VlfYa7BCVQX/DlH847el3wxPvOx znrNv7DOEUit8h9F0wjd3RGRSX2Rpnll6G7bhl0DvzDAUkLTGeCdGuXaR2+IcrK4T3IZ EB1uNJ5xDLJIbQotBBqmNm1jfms0cuNocGxeDiz20X0Kd0GTHBb9PaiYyhc+IGgCsCvi lStw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TRSFs6Yd; spf=pass (google.com: domain of peter.griffin@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=peter.griffin@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id b62sor861981wmc.26.2019.05.15.02.07.14 for (Google Transport Security); Wed, 15 May 2019 02:07:14 -0700 (PDT) Received-SPF: pass (google.com: domain of peter.griffin@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TRSFs6Yd; spf=pass (google.com: domain of peter.griffin@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=peter.griffin@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=c7IMP/3hc94JsYmdSwnbB2SB0D5Upp0wtqpZp2Ig1uc=; b=TRSFs6YdTk04DvuLz6hhcL+hlhtLuyTniZSLo9xbXBk0jy8oFm4I5ErUOKGwOgxva1 xaBZg1/2ZkMgd+pbtDzNC8Maqh2i8n6CPNO32o2/jq9gKfrRQ3DKd81lSTg622iTTGKW ZZxwr56XQi3W5hlh8ys28IlRaq5+CE71nQbuJX4CckMi7ICBef2XFX3czSSd4M5BZDuM YYLD+LFVR3QhcdZSoz4Eukb0A7wybVlau19W5VzYXVXXhv1nkDo7K5OE6WFXNcn25Zoo JEePH/eVJS7M9cy8N9kWsROxgAvQaBacJUOJnEaGYWgPtNUkohXRv6zQLYBwIY8HxHoK OL0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=c7IMP/3hc94JsYmdSwnbB2SB0D5Upp0wtqpZp2Ig1uc=; b=YSkoJFu6I6V1im7lbGcVU0jvYNJr2KXVj324QXTNu8ZA6fBPEkP6RjNgP/YTlHvN9w mW42+db363aTQNCtLbY7c/dxBMzxWzwrhGqCdWYF96Ee4T5HUPnXZQYxJmOKjOFnzN3/ 5SArbpcYvhmr2K57m3FRbV8pOZjAUzCOtoS3lsgR+KYak4eYPy7INE7N7fxsw9XX/zIH bV9smxnbCrKcPdq2+qDTSfo+XneHhKcMbo4wopTBr6Tko3etZQLxf2XJ1SJGbRoYsbfw f+Tr1lv20gu2nunki0vAhniZeApefkPzgVVvtXxlIYAfYD+R0X1yYESZCagag3aHVybK Yk/g== X-Gm-Message-State: APjAAAXfDv6SjzBL6E/IKy4VKz4H0V8nlGaDzBGUHfnkMIeVUTWq83PG n2xiaBBJPj1J7imGKbtUtSlq9Z5l X-Google-Smtp-Source: APXvYqxix04RDcHL3y2+al8RfwxOqBtysHJ8PhS9cNgJbLqGhw+zr3WTe7RMEN6nWZkTJCnO4QhoVw== X-Received: by 2002:a7b:c76b:: with SMTP id x11mr13528714wmk.22.1557911233719; Wed, 15 May 2019 02:07:13 -0700 (PDT) Return-Path: Received: from localhost.localdomain (cpc89244-aztw30-2-0-cust4998.18-1.cable.virginm.net. [86.31.179.135]) by smtp.gmail.com with ESMTPSA id o4sm1252766wmc.38.2019.05.15.02.07.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 15 May 2019 02:07:12 -0700 (PDT) From: Peter Griffin To: openembedded-core@lists.openembedded.org, nicolas.dechesne@linaro.org Cc: Peter Griffin Subject: [PATCH] mesa: Add backport of freedreno dmabuf modifiers patch. Date: Wed, 15 May 2019 10:05:10 +0100 Message-Id: <1557911110-10999-1-git-send-email-peter.griffin@linaro.org> X-Mailer: git-send-email 2.7.4 This is required to get weston-simple-dmabuf-drm to work and also now required by Chromium v73 ozone-wayland backend. It is present in mesa 19.0, backporting to Thud which is on 18.1.9. Signed-off-by: Peter Griffin --- ...ckport-of-freedreno-dmabuf-modifiers-patc.patch | 140 +++++++++++++++++++++ ...-freedreno-add-query-for-dmabuf-modifiers.patch | 101 +++++++++++++++ meta/recipes-graphics/mesa/mesa_18.1.9.bb | 1 + 3 files changed, 242 insertions(+) create mode 100644 meta/recipes-graphics/mesa/0001-mesa-Add-backport-of-freedreno-dmabuf-modifiers-patc.patch create mode 100644 meta/recipes-graphics/mesa/files/0001-freedreno-add-query-for-dmabuf-modifiers.patch -- 2.7.4 diff --git a/meta/recipes-graphics/mesa/0001-mesa-Add-backport-of-freedreno-dmabuf-modifiers-patc.patch b/meta/recipes-graphics/mesa/0001-mesa-Add-backport-of-freedreno-dmabuf-modifiers-patc.patch new file mode 100644 index 0000000..1a5aa68 --- /dev/null +++ b/meta/recipes-graphics/mesa/0001-mesa-Add-backport-of-freedreno-dmabuf-modifiers-patc.patch @@ -0,0 +1,140 @@ +From 6de2fe7bdd1bbe7a1d56c91fabe32a3dbcb736ac Mon Sep 17 00:00:00 2001 +From: Peter Griffin +Date: Wed, 15 May 2019 10:07:49 +0200 +Subject: [PATCH] mesa: Add backport of freedreno dmabuf modifiers patch. + +This is required to get weston-simple-dmabuf-drm to work +and also now required by Chromium v73 ozone-wayland backend. + +It is present in mesa 19.0, backporting to Thud which is +on 18.1.9. + +Signed-off-by: Peter Griffin +--- + ...-freedreno-add-query-for-dmabuf-modifiers.patch | 101 +++++++++++++++++++++ + meta/recipes-graphics/mesa/mesa_18.1.9.bb | 1 + + 2 files changed, 102 insertions(+) + create mode 100644 meta/recipes-graphics/mesa/files/0001-freedreno-add-query-for-dmabuf-modifiers.patch + +diff --git a/meta/recipes-graphics/mesa/files/0001-freedreno-add-query-for-dmabuf-modifiers.patch b/meta/recipes-graphics/mesa/files/0001-freedreno-add-query-for-dmabuf-modifiers.patch +new file mode 100644 +index 0000000..57ebd8f +--- /dev/null ++++ b/meta/recipes-graphics/mesa/files/0001-freedreno-add-query-for-dmabuf-modifiers.patch +@@ -0,0 +1,101 @@ ++From c4bee1a1b3fb224002fe8c263bedbce1b705ed49 Mon Sep 17 00:00:00 2001 ++From: Peter Griffin ++Date: Mon, 13 May 2019 19:18:56 +0100 ++Subject: [PATCH] freedreno: add query for dmabuf modifiers ++ ++Backport of mesa 7c4b9510d by Fritz Koenig. Tested with Weston ++and weston-simple-dmabuf-drm client. ++ ++Upstream-Status: Backport from 19.0 ++ ++Signed-off-by: Peter Griffin ++--- ++ src/gallium/drivers/freedreno/freedreno_screen.c | 43 ++++++++++++++++++++++++ ++ src/gallium/drivers/freedreno/freedreno_screen.h | 3 ++ ++ 2 files changed, 46 insertions(+) ++ ++diff --git a/src/gallium/drivers/freedreno/freedreno_screen.c b/src/gallium/drivers/freedreno/freedreno_screen.c ++index f338d75..cbb5b8a 100644 ++--- a/src/gallium/drivers/freedreno/freedreno_screen.c +++++ b/src/gallium/drivers/freedreno/freedreno_screen.c ++@@ -40,6 +40,7 @@ ++ ++ #include "util/os_time.h" ++ +++#include ++ #include ++ #include ++ #include ++@@ -732,6 +733,37 @@ fd_screen_bo_get_handle(struct pipe_screen *pscreen, ++ } ++ } ++ +++static void +++fd_screen_query_dmabuf_modifiers(struct pipe_screen *pscreen, +++ enum pipe_format format, +++ int max, uint64_t *modifiers, +++ unsigned int *external_only, +++ int *count) +++{ +++ struct fd_screen *screen = fd_screen(pscreen); +++ int i, num = 0; +++ +++ max = MIN2(max, screen->num_supported_modifiers); +++ +++ if (!max) { +++ max = screen->num_supported_modifiers; +++ external_only = NULL; +++ modifiers = NULL; +++ } +++ +++ for (i = 0; i < max; i++) { +++ if (modifiers) +++ modifiers[num] = screen->supported_modifiers[i]; +++ +++ if (external_only) +++ external_only[num] = 0; +++ +++ num++; +++ } +++ +++ *count = num; +++} +++ ++ struct fd_bo * ++ fd_screen_bo_from_handle(struct pipe_screen *pscreen, ++ struct winsys_handle *whandle) ++@@ -921,6 +953,17 @@ fd_screen_create(struct fd_device *dev) ++ pscreen->fence_finish = fd_fence_finish; ++ pscreen->fence_get_fd = fd_fence_get_fd; ++ +++ pscreen->query_dmabuf_modifiers = fd_screen_query_dmabuf_modifiers; +++ +++ if (!screen->supported_modifiers) { +++ static const uint64_t supported_modifiers[] = { +++ DRM_FORMAT_MOD_LINEAR, +++ }; +++ +++ screen->supported_modifiers = supported_modifiers; +++ screen->num_supported_modifiers = ARRAY_SIZE(supported_modifiers); +++ } +++ ++ slab_create_parent(&screen->transfer_pool, sizeof(struct fd_transfer), 16); ++ ++ return pscreen; ++diff --git a/src/gallium/drivers/freedreno/freedreno_screen.h b/src/gallium/drivers/freedreno/freedreno_screen.h ++index 6be739a..5558066 100644 ++--- a/src/gallium/drivers/freedreno/freedreno_screen.h +++++ b/src/gallium/drivers/freedreno/freedreno_screen.h ++@@ -89,6 +89,9 @@ struct fd_screen { ++ struct fd_batch_cache batch_cache; ++ ++ bool reorder; +++ +++ unsigned num_supported_modifiers; +++ const uint64_t *supported_modifiers; ++ }; ++ ++ static inline struct fd_screen * ++-- ++2.7.4 ++ +diff --git a/meta/recipes-graphics/mesa/mesa_18.1.9.bb b/meta/recipes-graphics/mesa/mesa_18.1.9.bb +index 86d6a6b..0558690 100644 +--- a/meta/recipes-graphics/mesa/mesa_18.1.9.bb ++++ b/meta/recipes-graphics/mesa/mesa_18.1.9.bb +@@ -7,6 +7,7 @@ SRC_URI = "https://mesa.freedesktop.org/archive/mesa-${PV}.tar.xz \ + file://0004-Use-Python-3-to-execute-the-scripts.patch \ + file://0005-dri-i965-Add-missing-time.h-include.patch \ + file://0006-use-PKG_CHECK_VAR-for-defining-WAYLAND_PROTOCOLS_DAT.patch \ ++ file://0001-freedreno-add-query-for-dmabuf-modifiers.patch \ + " + + SRC_URI[md5sum] = "2f8d2098ab478bc3907e42130577b54a" +-- +2.7.4 + diff --git a/meta/recipes-graphics/mesa/files/0001-freedreno-add-query-for-dmabuf-modifiers.patch b/meta/recipes-graphics/mesa/files/0001-freedreno-add-query-for-dmabuf-modifiers.patch new file mode 100644 index 0000000..57ebd8f --- /dev/null +++ b/meta/recipes-graphics/mesa/files/0001-freedreno-add-query-for-dmabuf-modifiers.patch @@ -0,0 +1,101 @@ +From c4bee1a1b3fb224002fe8c263bedbce1b705ed49 Mon Sep 17 00:00:00 2001 +From: Peter Griffin +Date: Mon, 13 May 2019 19:18:56 +0100 +Subject: [PATCH] freedreno: add query for dmabuf modifiers + +Backport of mesa 7c4b9510d by Fritz Koenig. Tested with Weston +and weston-simple-dmabuf-drm client. + +Upstream-Status: Backport from 19.0 + +Signed-off-by: Peter Griffin +--- + src/gallium/drivers/freedreno/freedreno_screen.c | 43 ++++++++++++++++++++++++ + src/gallium/drivers/freedreno/freedreno_screen.h | 3 ++ + 2 files changed, 46 insertions(+) + +diff --git a/src/gallium/drivers/freedreno/freedreno_screen.c b/src/gallium/drivers/freedreno/freedreno_screen.c +index f338d75..cbb5b8a 100644 +--- a/src/gallium/drivers/freedreno/freedreno_screen.c ++++ b/src/gallium/drivers/freedreno/freedreno_screen.c +@@ -40,6 +40,7 @@ + + #include "util/os_time.h" + ++#include + #include + #include + #include +@@ -732,6 +733,37 @@ fd_screen_bo_get_handle(struct pipe_screen *pscreen, + } + } + ++static void ++fd_screen_query_dmabuf_modifiers(struct pipe_screen *pscreen, ++ enum pipe_format format, ++ int max, uint64_t *modifiers, ++ unsigned int *external_only, ++ int *count) ++{ ++ struct fd_screen *screen = fd_screen(pscreen); ++ int i, num = 0; ++ ++ max = MIN2(max, screen->num_supported_modifiers); ++ ++ if (!max) { ++ max = screen->num_supported_modifiers; ++ external_only = NULL; ++ modifiers = NULL; ++ } ++ ++ for (i = 0; i < max; i++) { ++ if (modifiers) ++ modifiers[num] = screen->supported_modifiers[i]; ++ ++ if (external_only) ++ external_only[num] = 0; ++ ++ num++; ++ } ++ ++ *count = num; ++} ++ + struct fd_bo * + fd_screen_bo_from_handle(struct pipe_screen *pscreen, + struct winsys_handle *whandle) +@@ -921,6 +953,17 @@ fd_screen_create(struct fd_device *dev) + pscreen->fence_finish = fd_fence_finish; + pscreen->fence_get_fd = fd_fence_get_fd; + ++ pscreen->query_dmabuf_modifiers = fd_screen_query_dmabuf_modifiers; ++ ++ if (!screen->supported_modifiers) { ++ static const uint64_t supported_modifiers[] = { ++ DRM_FORMAT_MOD_LINEAR, ++ }; ++ ++ screen->supported_modifiers = supported_modifiers; ++ screen->num_supported_modifiers = ARRAY_SIZE(supported_modifiers); ++ } ++ + slab_create_parent(&screen->transfer_pool, sizeof(struct fd_transfer), 16); + + return pscreen; +diff --git a/src/gallium/drivers/freedreno/freedreno_screen.h b/src/gallium/drivers/freedreno/freedreno_screen.h +index 6be739a..5558066 100644 +--- a/src/gallium/drivers/freedreno/freedreno_screen.h ++++ b/src/gallium/drivers/freedreno/freedreno_screen.h +@@ -89,6 +89,9 @@ struct fd_screen { + struct fd_batch_cache batch_cache; + + bool reorder; ++ ++ unsigned num_supported_modifiers; ++ const uint64_t *supported_modifiers; + }; + + static inline struct fd_screen * +-- +2.7.4 + diff --git a/meta/recipes-graphics/mesa/mesa_18.1.9.bb b/meta/recipes-graphics/mesa/mesa_18.1.9.bb index 86d6a6b..0558690 100644 --- a/meta/recipes-graphics/mesa/mesa_18.1.9.bb +++ b/meta/recipes-graphics/mesa/mesa_18.1.9.bb @@ -7,6 +7,7 @@ SRC_URI = "https://mesa.freedesktop.org/archive/mesa-${PV}.tar.xz \ file://0004-Use-Python-3-to-execute-the-scripts.patch \ file://0005-dri-i965-Add-missing-time.h-include.patch \ file://0006-use-PKG_CHECK_VAR-for-defining-WAYLAND_PROTOCOLS_DAT.patch \ + file://0001-freedreno-add-query-for-dmabuf-modifiers.patch \ " SRC_URI[md5sum] = "2f8d2098ab478bc3907e42130577b54a"