From 1c35920d85e424b3f65aa6df1dbde689dd6ec007 Mon Sep 17 00:00:00 2001 From: Nobuhiro Iwamatsu Date: Wed, 25 Mar 2015 10:47:45 +0900 Subject: commit BSP v1.8.0 Signed-off-by: Nobuhiro Iwamatsu --- ...d-the-possibility-to-select-the-refresh-f.patch | 118 +++++++++++++++++++++ .../drm/libdrm/GNU_SOURCE_definition.patch | 30 ++++++ .../recipes-graphics/drm/libdrm/installtests.patch | 23 ++++ 3 files changed, 171 insertions(+) create mode 100644 common/recipes-graphics/drm/libdrm/0001-modetest-add-the-possibility-to-select-the-refresh-f.patch create mode 100644 common/recipes-graphics/drm/libdrm/GNU_SOURCE_definition.patch create mode 100644 common/recipes-graphics/drm/libdrm/installtests.patch (limited to 'common/recipes-graphics/drm/libdrm') diff --git a/common/recipes-graphics/drm/libdrm/0001-modetest-add-the-possibility-to-select-the-refresh-f.patch b/common/recipes-graphics/drm/libdrm/0001-modetest-add-the-possibility-to-select-the-refresh-f.patch new file mode 100644 index 0000000..090cc00 --- /dev/null +++ b/common/recipes-graphics/drm/libdrm/0001-modetest-add-the-possibility-to-select-the-refresh-f.patch @@ -0,0 +1,118 @@ +From de0970203091618834e4753c14d5169770797800 Mon Sep 17 00:00:00 2001 +From: Vincent ABRIOU +Date: Fri, 10 Jan 2014 11:02:33 +0100 +Subject: [PATCH] modetest: add the possibility to select the refresh + frequency for a mode + +When mode is selected we only give the name of the mode as parameter. +But sometime, two different modes have the same name but not +the same vrefresh frequency. +This patch give the possibility to select a mode by its name +and optionally by its refresh frequency. + +Signed-off-by: Vincent Abriou +Acked-by: Laurent Pinchart +Signed-off-by: Rob Clark +--- + tests/modetest/modetest.c | 35 +++++++++++++++++++++++++++-------- + 1 file changed, 27 insertions(+), 8 deletions(-) + +diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c +index 0afd1c8..12365d4 100644 +--- a/tests/modetest/modetest.c ++++ b/tests/modetest/modetest.c +@@ -753,6 +753,7 @@ struct pipe_arg { + uint32_t crtc_id; + char mode_str[64]; + char format_str[5]; ++ unsigned int vrefresh; + unsigned int fourcc; + drmModeModeInfo *mode; + struct crtc *crtc; +@@ -774,7 +775,8 @@ struct plane_arg { + }; + + static drmModeModeInfo * +-connector_find_mode(struct device *dev, uint32_t con_id, const char *mode_str) ++connector_find_mode(struct device *dev, uint32_t con_id, const char *mode_str, ++ const unsigned int vrefresh) + { + drmModeConnector *connector; + drmModeModeInfo *mode; +@@ -786,8 +788,16 @@ connector_find_mode(struct device *dev, uint32_t con_id, const char *mode_str) + + for (i = 0; i < connector->count_modes; i++) { + mode = &connector->modes[i]; +- if (!strcmp(mode->name, mode_str)) +- return mode; ++ if (!strcmp(mode->name, mode_str)) { ++ /* If the vertical refresh frequency is not specified then return the ++ * first mode that match with the name. Else, return the mode that match ++ * the name and the specified vertical refresh frequency. ++ */ ++ if (vrefresh == 0) ++ return mode; ++ else if (mode->vrefresh == vrefresh) ++ return mode; ++ } + } + + return NULL; +@@ -849,7 +859,7 @@ static int pipe_find_crtc_and_mode(struct device *dev, struct pipe_arg *pipe) + + for (i = 0; i < (int)pipe->num_cons; i++) { + mode = connector_find_mode(dev, pipe->con_ids[i], +- pipe->mode_str); ++ pipe->mode_str, pipe->vrefresh); + if (mode == NULL) { + fprintf(stderr, + "failed to find mode \"%s\" for connector %u\n", +@@ -1175,8 +1185,8 @@ static void set_mode(struct device *dev, struct pipe_arg *pipes, unsigned int co + if (pipe->mode == NULL) + continue; + +- printf("setting mode %s@%s on connectors ", +- pipe->mode_str, pipe->format_str); ++ printf("setting mode %s-%dHz@%s on connectors ", ++ pipe->mode_str, pipe->mode->vrefresh, pipe->format_str); + for (j = 0; j < pipe->num_cons; ++j) + printf("%u, ", pipe->con_ids[j]); + printf("crtc %d\n", pipe->crtc->crtc->crtc_id); +@@ -1308,6 +1318,7 @@ static int parse_connector(struct pipe_arg *pipe, const char *arg) + const char *p; + char *endp; + ++ pipe->vrefresh = 0; + pipe->crtc_id = (uint32_t)-1; + strcpy(pipe->format_str, "XR24"); + +@@ -1342,11 +1353,19 @@ static int parse_connector(struct pipe_arg *pipe, const char *arg) + + arg = endp + 1; + +- p = strchrnul(arg, '@'); ++ /* Search for the vertical refresh or the format. */ ++ p = strpbrk(arg, "-@"); ++ if (p == NULL) ++ p = arg + strlen(arg); + len = min(sizeof pipe->mode_str - 1, (unsigned int)(p - arg)); + strncpy(pipe->mode_str, arg, len); + pipe->mode_str[len] = '\0'; + ++ if (*p == '-') { ++ pipe->vrefresh = strtoul(p + 1, &endp, 10); ++ p = endp; ++ } ++ + if (*p == '@') { + strncpy(pipe->format_str, p + 1, 4); + pipe->format_str[4] = '\0'; +@@ -1434,7 +1453,7 @@ static void usage(char *name) + + fprintf(stderr, "\n Test options:\n\n"); + fprintf(stderr, "\t-P [@]:x[++][@]\tset a plane\n"); +- fprintf(stderr, "\t-s [,][@]:[@]\tset a mode\n"); ++ fprintf(stderr, "\t-s [,][@]:[-][@]\tset a mode\n"); + fprintf(stderr, "\t-v\ttest vsynced page flipping\n"); + fprintf(stderr, "\t-w ::\tset property\n"); + diff --git a/common/recipes-graphics/drm/libdrm/GNU_SOURCE_definition.patch b/common/recipes-graphics/drm/libdrm/GNU_SOURCE_definition.patch new file mode 100644 index 0000000..8eb1d5e --- /dev/null +++ b/common/recipes-graphics/drm/libdrm/GNU_SOURCE_definition.patch @@ -0,0 +1,30 @@ +uclibc headers need to know if _GNU_SOURCE is defined or not and its defined +in config.h so include it first to get the definition if its there fixed build +problems on uclibc + +test_decode.c:107:2: error: implicit declaration of function 'open_memstream' [-Werror=implicit-function-declaration] + +Signed-off-by: Khem Raj +Upstream-Status: Pending + +Index: libdrm-2.4.30/intel/test_decode.c +=================================================================== +--- libdrm-2.4.30.orig/intel/test_decode.c 2012-02-03 14:28:46.409355918 -0800 ++++ libdrm-2.4.30/intel/test_decode.c 2012-02-03 14:29:02.357356689 -0800 +@@ -21,6 +21,8 @@ + * IN THE SOFTWARE. + */ + ++#include "config.h" ++ + #include + #include + #include +@@ -31,7 +33,6 @@ + #include + #include + +-#include "config.h" + #include "intel_bufmgr.h" + #include "intel_chipset.h" + diff --git a/common/recipes-graphics/drm/libdrm/installtests.patch b/common/recipes-graphics/drm/libdrm/installtests.patch new file mode 100644 index 0000000..7d443af --- /dev/null +++ b/common/recipes-graphics/drm/libdrm/installtests.patch @@ -0,0 +1,23 @@ +tests: also install tests app + +Upstream-Status: Inappropriate [configuration] + +Signed-off-by: Yu Ke + +diff --git a/tests/Makefile.am b/tests/Makefile.am +index bf1987f..d909e19 100644 +--- a/tests/Makefile.am ++++ b/tests/Makefile.am +@@ -6,10 +6,11 @@ AM_CPPFLAGS = \ + + LDADD = $(top_builddir)/libdrm.la + +-check_PROGRAMS = \ ++bin_PROGRAMS = \ + dristat \ + drmstat + ++check_PROGRAMS = + SUBDIRS = modeprint + + if HAVE_LIBKMS -- cgit 1.2.3-korg