summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTobias Jakobi <tjakobi@math.uni-bielefeld.de>2015-04-20 21:50:45 +0200
committerEmil Velikov <emil.l.velikov@gmail.com>2015-04-28 11:23:14 +0100
commitb1d19de76468fdb4ae7cb87791c77d1f8839a573 (patch)
tree014233f11e183551041346eaa49c989db07407a2 /tests
parent0c8db0a563857239cfe2b38df1590c571db5a1f1 (diff)
modetest: initialize handles/pitches in set_plane()
Only the 'offsets' array was initialized to zero. Since bo_create only sets the handles which are necessary, were we passing garbage data to the kernel when calling drmModeAddFB2 later. The issue only seems to appear when passing e.g. NV12 data to the kernel, a case where not only handles[0] is used. I therefore also removed the corresponding comment. v2: Do the same for set_mode(), set_cursors() and test_page_flip(). Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/modetest/modetest.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c
index 63d2059c..e646790b 100644
--- a/tests/modetest/modetest.c
+++ b/tests/modetest/modetest.c
@@ -970,7 +970,7 @@ page_flip_handler(int fd, unsigned int frame,
static int set_plane(struct device *dev, struct plane_arg *p)
{
drmModePlane *ovr;
- uint32_t handles[4], pitches[4], offsets[4] = {0}; /* we only use [0] */
+ uint32_t handles[4] = {0}, pitches[4] = {0}, offsets[4] = {0};
uint32_t plane_id = 0;
struct bo *plane_bo;
uint32_t plane_flags = 0;
@@ -1052,7 +1052,7 @@ static int set_plane(struct device *dev, struct plane_arg *p)
static void set_mode(struct device *dev, struct pipe_arg *pipes, unsigned int count)
{
- uint32_t handles[4], pitches[4], offsets[4] = {0}; /* we only use [0] */
+ uint32_t handles[4] = {0}, pitches[4] = {0}, offsets[4] = {0};
unsigned int fb_id;
struct bo *bo;
unsigned int i;
@@ -1131,7 +1131,7 @@ static void set_planes(struct device *dev, struct plane_arg *p, unsigned int cou
static void set_cursors(struct device *dev, struct pipe_arg *pipes, unsigned int count)
{
- uint32_t handles[4], pitches[4], offsets[4] = {0}; /* we only use [0] */
+ uint32_t handles[4] = {0}, pitches[4] = {0}, offsets[4] = {0};
struct bo *bo;
unsigned int i;
int ret;
@@ -1171,7 +1171,7 @@ static void clear_cursors(struct device *dev)
static void test_page_flip(struct device *dev, struct pipe_arg *pipes, unsigned int count)
{
- uint32_t handles[4], pitches[4], offsets[4] = {0}; /* we only use [0] */
+ uint32_t handles[4] = {0}, pitches[4] = {0}, offsets[4] = {0};
unsigned int other_fb_id;
struct bo *other_bo;
drmEventContext evctx;