From patchwork Mon Apr 20 18:46:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Jakobi X-Patchwork-Id: 6243891 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5398F9F313 for ; Mon, 20 Apr 2015 18:46:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9748B20435 for ; Mon, 20 Apr 2015 18:46:17 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 0723E20421 for ; Mon, 20 Apr 2015 18:46:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2202E6E4C6; Mon, 20 Apr 2015 11:46:15 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from smtp.math.uni-bielefeld.de (smtp.math.uni-bielefeld.de [129.70.45.10]) by gabe.freedesktop.org (Postfix) with ESMTP id 2F0D66E4C6 for ; Mon, 20 Apr 2015 11:46:12 -0700 (PDT) Received: from leena.entropy (unknown [5.147.63.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client did not present a certificate) by smtp.math.uni-bielefeld.de (Postfix) with ESMTPSA id CB7866013D; Mon, 20 Apr 2015 20:46:10 +0200 (CEST) From: Tobias Jakobi To: dri-devel@lists.freedesktop.org Subject: [PATCH] modetest: initialize handles/pitches in set_plane() Date: Mon, 20 Apr 2015 20:46:00 +0200 Message-Id: <1429555560-6479-1-git-send-email-tjakobi@math.uni-bielefeld.de> X-Mailer: git-send-email 2.0.5 Cc: Tobias Jakobi , emil.l.velikov@gmail.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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. Signed-off-by: Tobias Jakobi --- tests/modetest/modetest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c index 53dfe05..34d86d0 100644 --- a/tests/modetest/modetest.c +++ b/tests/modetest/modetest.c @@ -969,7 +969,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;