diff --git a/recipes-graphics/drm/libdrm/0001-tests-modetest-automatic-configuration.patch b/recipes-graphics/drm/libdrm/0001-tests-modetest-automatic-configuration.patch index 4b11ab1..7ef101f 100644 --- a/recipes-graphics/drm/libdrm/0001-tests-modetest-automatic-configuration.patch +++ b/recipes-graphics/drm/libdrm/0001-tests-modetest-automatic-configuration.patch @@ -1,7 +1,7 @@ -From 6e2b3424b4d9d58c7bb5d3cef4d7762e3817d554 Mon Sep 17 00:00:00 2001 -From: Christophe Priouzeau -Date: Thu, 7 Nov 2019 14:32:28 +0100 -Subject: [PATCH 1/2] tests/modetest: automatic configuration +From 93a5788758bf97e1017c34fbda54e1e66f301f32 Mon Sep 17 00:00:00 2001 +From: Christophe Priouzeau +Date: Thu, 9 Sep 2021 14:26:39 +0200 +Subject: [PATCH 1/4] tests/modetest: automatic configuration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -15,19 +15,19 @@ Signed-off-by: Yannick Fertré 1 file changed, 52 insertions(+), 2 deletions(-) diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c -index e66be66..018338c 100644 +index 2c83bd0..f11095b 100644 --- a/tests/modetest/modetest.c +++ b/tests/modetest/modetest.c -@@ -1811,7 +1811,7 @@ static void parse_fill_patterns(char *arg) +@@ -1990,7 +1990,7 @@ static void parse_fill_patterns(char *arg) static void usage(char *name) { -- fprintf(stderr, "usage: %s [-acDdefMPpsCvw]\n", name); -+ fprintf(stderr, "usage: %s [-acDdefMPpsCvwA]\n", name); +- fprintf(stderr, "usage: %s [-acDdefMPpsCvrw]\n", name); ++ fprintf(stderr, "usage: %s [-acDdefMPpsCvrwA]\n", name); fprintf(stderr, "\n Query options:\n\n"); fprintf(stderr, "\t-c\tlist connectors\n"); -@@ -1832,6 +1832,7 @@ static void usage(char *name) +@@ -2012,12 +2012,13 @@ static void usage(char *name) fprintf(stderr, "\t-d\tdrop master after mode set\n"); fprintf(stderr, "\t-M module\tuse the given driver\n"); fprintf(stderr, "\t-D device\tuse the given device\n"); @@ -35,16 +35,14 @@ index e66be66..018338c 100644 fprintf(stderr, "\n\tDefault is to dump all info.\n"); exit(0); -@@ -1890,7 +1891,7 @@ static int pipe_resolve_connectors(struct device *dev, struct pipe_arg *pipe) - return 0; } --static char optstr[] = "acdD:efF:M:P:ps:Cvw:"; -+static char optstr[] = "acdD:efF:M:P:ps:Cvw:A"; +-static char optstr[] = "acdD:efF:M:P:ps:Cvrw:"; ++static char optstr[] = "acdD:efF:M:P:ps:Cvrw:A"; int main(int argc, char **argv) { -@@ -1911,6 +1912,7 @@ int main(int argc, char **argv) +@@ -2039,6 +2040,7 @@ int main(int argc, char **argv) struct plane_arg *plane_args = NULL; struct property_arg *prop_args = NULL; unsigned int args = 0; @@ -52,7 +50,7 @@ index e66be66..018338c 100644 int ret; memset(&dev, 0, sizeof dev); -@@ -1999,12 +2001,18 @@ int main(int argc, char **argv) +@@ -2133,12 +2135,18 @@ int main(int argc, char **argv) prop_count++; break; @@ -68,58 +66,58 @@ index e66be66..018338c 100644 + if (auto_configuration) + use_atomic = false; + - if (!args || (args == 1 && use_atomic)) + /* Dump all the details when no* arguments are provided. */ + if (!args) encoders = connectors = crtcs = planes = framebuffers = 1; - -@@ -2042,6 +2050,48 @@ int main(int argc, char **argv) - return 1; - } +@@ -2201,6 +2209,48 @@ int main(int argc, char **argv) + return 1; + } +#define connector_status_connected 1 -+ if (auto_configuration) { -+ struct resources *resources = dev.resources; -+ drmModeConnector *connector; -+ char auto_arg[32]; -+ int j; ++ if (auto_configuration) { ++ struct resources *resources = dev.resources; ++ drmModeConnector *connector; ++ char auto_arg[32]; ++ int j; + -+ if (!resources->res->count_connectors || -+ !resources->res->count_crtcs) { -+ fprintf(stderr, "Cannot find connector or crtc\n"); -+ return 1; -+ } ++ if (!resources->count_connectors || ++ !resources->count_crtcs) { ++ fprintf(stderr, "Cannot find connector or crtc\n"); ++ return 1; ++ } + -+ for (j = 0; j < resources->res->count_connectors; j++) { -+ connector = resources->connectors[j].connector; -+ if(connector->connection == connector_status_connected) -+ break; -+ } ++ for (j = 0; j < resources->count_connectors; j++) { ++ connector = resources->connectors[j].connector; ++ if(connector->connection == connector_status_connected) ++ break; ++ } + -+ if (!connector->count_modes) { -+ fprintf(stderr, "Cannot find mode\n"); -+ return 1; -+ } ++ if (!connector->count_modes) { ++ fprintf(stderr, "Cannot find mode\n"); ++ return 1; ++ } + -+ snprintf(auto_arg, sizeof(auto_arg) - 1, "%d@%d:%s-%d@%s\n", -+ connector->connector_id, resources->res->crtcs[0], -+ connector->modes[0].name, connector->modes[0].vrefresh, -+ "XR24"); ++ snprintf(auto_arg, sizeof(auto_arg) - 1, "%d@%d:%s-%d@%s\n", ++ connector->connector_id, resources->crtcs[0].crtc->crtc_id, ++ connector->modes[0].name, connector->modes[0].vrefresh, ++ "XR24"); + -+ pipe_args = realloc(pipe_args, sizeof *pipe_args); -+ if (pipe_args == NULL) { -+ fprintf(stderr, "memory allocation failed\n"); -+ return 2; -+ } -+ memset(&pipe_args[count], 0, sizeof(*pipe_args)); ++ pipe_args = realloc(pipe_args, sizeof *pipe_args); ++ if (pipe_args == NULL) { ++ fprintf(stderr, "memory allocation failed\n"); ++ return 2; ++ } ++ memset(&pipe_args[count], 0, sizeof(*pipe_args)); + -+ if (parse_connector(&pipe_args[count], auto_arg) < 0) -+ return 3; -+ /* fix to one plane without atomic */ -+ count = 1; -+ } ++ if (parse_connector(&pipe_args[count], auto_arg) < 0) ++ return 3; ++ /* fix to one plane without atomic */ ++ count = 1; ++ } + - for (i = 0; i < count; i++) { - if (pipe_resolve_connectors(&dev, &pipe_args[i]) < 0) { - free_resources(dev.resources); + if (set_preferred || count) + set_mode(&dev, pipe_args, count); + -- -2.17.1 +2.25.1 diff --git a/recipes-graphics/drm/libdrm/0002-tests-util-smtpe-increase-alpha-to-middle-band.patch b/recipes-graphics/drm/libdrm/0002-tests-util-smtpe-increase-alpha-to-middle-band.patch index 82889ec..ea3f0e1 100644 --- a/recipes-graphics/drm/libdrm/0002-tests-util-smtpe-increase-alpha-to-middle-band.patch +++ b/recipes-graphics/drm/libdrm/0002-tests-util-smtpe-increase-alpha-to-middle-band.patch @@ -1,7 +1,7 @@ -From 7810d0d375c6fce64de5f63429ddd5a00cc25a29 Mon Sep 17 00:00:00 2001 +From 925e1dc00b00ed0e3fb965d4899398bdbb4967a7 Mon Sep 17 00:00:00 2001 From: Christophe Priouzeau Date: Thu, 7 Nov 2019 14:32:54 +0100 -Subject: [PATCH 2/2] tests/util: smtpe: increase alpha to middle band +Subject: [PATCH 2/4] tests/util: smtpe: increase alpha to middle band MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -19,7 +19,7 @@ Signed-off-by: Yannick Fertré 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/util/pattern.c b/tests/util/pattern.c -index 42a0e5c..cfa8c6e 100644 +index 158c0b1..a4eae23 100644 --- a/tests/util/pattern.c +++ b/tests/util/pattern.c @@ -373,13 +373,13 @@ static void fill_smpte_rgb16(const struct util_rgb_info *rgb, void *mem, @@ -44,5 +44,5 @@ index 42a0e5c..cfa8c6e 100644 const uint16_t colors_bottom[] = { MAKE_RGBA(rgb, 0, 33, 76, 255), /* in-phase */ -- -2.17.1 +2.25.1 diff --git a/recipes-graphics/drm/libdrm/0003-tests-modetest-set-property-in-atomic-mode.patch b/recipes-graphics/drm/libdrm/0003-tests-modetest-set-property-in-atomic-mode.patch index 8a0cd79..2f02784 100644 --- a/recipes-graphics/drm/libdrm/0003-tests-modetest-set-property-in-atomic-mode.patch +++ b/recipes-graphics/drm/libdrm/0003-tests-modetest-set-property-in-atomic-mode.patch @@ -1,43 +1,42 @@ -From 76dfcf7ed090a6cdeda86aa566fa7b653925d01d Mon Sep 17 00:00:00 2001 -From: Yannick Fertre -Date: Fri, 24 Apr 2020 15:31:23 +0200 -Subject: [PATCH 1/2] tests/modetest: set property in atomic mode +From 1b17b5034c4854bbff5954f8712c1c6cf8b39db3 Mon Sep 17 00:00:00 2001 +From: Christophe Priouzeau +Date: Thu, 9 Sep 2021 14:54:22 +0200 +Subject: [PATCH 3/4] tests/modetest: set property in atomic mode In atomic mode, the additional properties must be done after call of functions atomic_set_mode & atomic_set_planes. Signed-off-by: Yannick Fertre --- - tests/modetest/modetest.c | 9 +++++++-- - 1 file changed, 7 insertions(+), 2 deletions(-) + tests/modetest/modetest.c | 8 ++++++++ + 1 file changed, 8 insertions(+) diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c -index 018338c..26cd9d6 100644 +index f11095b..215f2ab 100644 --- a/tests/modetest/modetest.c +++ b/tests/modetest/modetest.c -@@ -2108,8 +2108,10 @@ int main(int argc, char **argv) - dump_resource(&dev, planes); - dump_resource(&dev, framebuffers); +@@ -2197,6 +2197,11 @@ int main(int argc, char **argv) + for (i = 0; i < prop_count; ++i) + set_property(&dev, &prop_args[i]); -- for (i = 0; i < prop_count; ++i) -- set_property(&dev, &prop_args[i]); + if (!dev.use_atomic) { + for (i = 0; i < prop_count; ++i) + set_property(&dev, &prop_args[i]); + } - ++ if (dev.use_atomic) { dev.req = drmModeAtomicAlloc(); -@@ -2126,6 +2128,9 @@ int main(int argc, char **argv) - atomic_set_mode(&dev, pipe_args, count); - atomic_set_planes(&dev, plane_args, plane_count, false); + +@@ -2281,6 +2286,9 @@ int main(int argc, char **argv) + if (count) + atomic_clear_mode(&dev, pipe_args, count); + for (i = 0; i < prop_count; ++i) + set_property(&dev, &prop_args[i]); + ret = drmModeAtomicCommit(dev.fd, dev.req, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL); - if (ret) { - fprintf(stderr, "Atomic Commit failed [1]\n"); + if (ret) + fprintf(stderr, "Atomic Commit failed\n"); -- -2.7.4 +2.25.1 diff --git a/recipes-graphics/drm/libdrm/0004-tests-modetest-close-crtc.patch b/recipes-graphics/drm/libdrm/0004-tests-modetest-close-crtc.patch index 189f632..3e2698f 100644 --- a/recipes-graphics/drm/libdrm/0004-tests-modetest-close-crtc.patch +++ b/recipes-graphics/drm/libdrm/0004-tests-modetest-close-crtc.patch @@ -1,24 +1,24 @@ -From 250a5ae2a5caa28911deb1028143d0c9ea4fdf88 Mon Sep 17 00:00:00 2001 -From: Yannick Fertre -Date: Fri, 24 Apr 2020 15:41:17 +0200 -Subject: [PATCH 2/2] tests/modetest: close crtc +From a98a8c35b0ad2cd9c3f357eb2ed4143c37e4c333 Mon Sep 17 00:00:00 2001 +From: Christophe Priouzeau +Date: Thu, 9 Sep 2021 14:56:46 +0200 +Subject: [PATCH 4/4] tests/modetest: close crtc To test several configuration of crtc, it must be closed at the end of modetest test (with/without atomic mode). Signed-off-by: Yannick Fertre --- - tests/modetest/modetest.c | 8 ++++++++ - 1 file changed, 8 insertions(+) + tests/modetest/modetest.c | 9 +++++++++ + 1 file changed, 9 insertions(+) diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c -index 26cd9d6..7094762 100644 +index 215f2ab..7c92702 100644 --- a/tests/modetest/modetest.c +++ b/tests/modetest/modetest.c -@@ -2182,6 +2182,10 @@ int main(int argc, char **argv) - } +@@ -2295,6 +2295,10 @@ int main(int argc, char **argv) - atomic_clear_FB(&dev, plane_args, plane_count); + if (plane_count) + atomic_clear_FB(&dev, plane_args, plane_count); + + for (i = 0; i < count; i++) + drmModeSetCrtc(dev.fd, dev.resources->crtcs[i].crtc->crtc_id, @@ -26,17 +26,18 @@ index 26cd9d6..7094762 100644 } drmModeAtomicFree(dev.req); -@@ -2220,6 +2224,10 @@ int main(int argc, char **argv) +@@ -2333,6 +2337,11 @@ int main(int argc, char **argv) - if (count) + if (set_preferred || count) clear_mode(&dev); + + for (i = 0; i < count; i++) + drmModeSetCrtc(dev.fd, dev.resources->crtcs[i].crtc->crtc_id, + 0, 0, 0, 0, 0, NULL); ++ } } -- -2.7.4 +2.25.1 diff --git a/recipes-graphics/drm/libdrm_2.4.101.bbappend b/recipes-graphics/drm/libdrm_2.4.110.bbappend similarity index 66% rename from recipes-graphics/drm/libdrm_2.4.101.bbappend rename to recipes-graphics/drm/libdrm_2.4.110.bbappend index 5b63b63..46429ae 100644 --- a/recipes-graphics/drm/libdrm_2.4.101.bbappend +++ b/recipes-graphics/drm/libdrm_2.4.110.bbappend @@ -1,9 +1,9 @@ # We don't want etnaviv drm package -EXTRA_OECONF_remove_stm32mpcommon += "--enable-etnaviv-experimental-api" +PACKAGECONFIG = "libkms install-test-programs" -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}/:" +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}/:" -SRC_URI_append_stm32mpcommon = " \ +SRC_URI:append:stm32mpcommon = " \ file://0001-tests-modetest-automatic-configuration.patch \ file://0002-tests-util-smtpe-increase-alpha-to-middle-band.patch \ file://0003-tests-modetest-set-property-in-atomic-mode.patch \