From patchwork Fri Nov 1 10:10:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Gmeiner X-Patchwork-Id: 11222817 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EB1641668 for ; Fri, 1 Nov 2019 09:11:13 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C642C21835 for ; Fri, 1 Nov 2019 09:11:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C642C21835 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CD3AB6F79D; Fri, 1 Nov 2019 09:11:12 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7ED486EE7F; Fri, 1 Nov 2019 09:11:11 +0000 (UTC) Received: by mail-wr1-x443.google.com with SMTP id t1so3066861wrv.4; Fri, 01 Nov 2019 02:11:11 -0700 (PDT) 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:mime-version :content-transfer-encoding; bh=Vhjdwd9OjDgZKFYAiqq3M747PlQxCBQAkRBjkbyP7ZE=; b=bwH56m0f1fNwZjVPV8GOca65OywNgEUgX/4utGz0mZCRmdv2d+CkMIQ5+lZ8RU1KU8 ykl/E6XyPbqSl1gH+PlWuVOckPLRplQVbknTukFOhJXKOIXY9RPIy5dR7OA95g+L8g+5 IEhoQOr0z03jUEKBMUbn4lQijqxP5dD4BwSlgI0VO7DxPlV6cGUN0rU5gME5yFQoFlUi UVPdgwYrI03LDTnc0gwdILXTODZ/2MxqETuwphQnd0fos9i47oIu0EKhBQLrBzkoa4Ig 9aN66F7QRknS0vAr8cvA7f8g1CULLKJDwWXnFrGf8V+qljr1obzwk6ciasCnoUx7Ligv Lx/w== X-Gm-Message-State: APjAAAXY7D40hNjPBbB7AEKA7GPKSKyC9tUR1xx3jw9KCX9IR3lr20o2 5dXf2xHQ2pySgedgRLQl7Kg= X-Google-Smtp-Source: APXvYqwucsVTviL1wqTqOub9YHhpaHgCtVJWjyxDGuPZN3ErAUCBvnC3v/Sq43iK8ecfBp/JazKKkw== X-Received: by 2002:adf:b1c6:: with SMTP id r6mr10165019wra.48.1572599469966; Fri, 01 Nov 2019 02:11:09 -0700 (PDT) Received: from localhost.localdomain ([62.178.82.229]) by smtp.gmail.com with ESMTPSA id y2sm6655648wmy.2.2019.11.01.02.11.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Nov 2019 02:11:08 -0700 (PDT) From: Christian Gmeiner To: linux-kernel@vger.kernel.org Subject: [PATCH] drm/etnaviv: correct ETNA_MAX_PIPE define Date: Fri, 1 Nov 2019 11:10:48 +0100 Message-Id: <20191101101110.10105-1-christian.gmeiner@gmail.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Vhjdwd9OjDgZKFYAiqq3M747PlQxCBQAkRBjkbyP7ZE=; b=ghjSVKpLhAM8ISXDDeFz9y/C6z6EwrwhVPWoJcoRy3cWjxomwNmYtyo2mo2va4jcmA ckgLhb1TMEgBPs6z+5cGziauek9PwpjPtF9bNS9UVjN2MWI0TP8XxzM0rIWMYzpe68kt cYoCQTDKl0gEYC6UpIDUrjXTC3m2l3cLykNr6n4zH6dhxG0XiiQ5aG5sniB0hCjHSd0b XMZQjt+/Vn6NY/B2wd6eewneXLbkji3K/hGNMJSzzs9ysAkpI6byIBnsh/jqluU1PhqP R6A4YyDNezfGsHiu66yGzf2lRv9g/RKoBR+MA8dhlif+AaKhzpLwS9VQgtQPRrLKhPCe mB/g== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , etnaviv@lists.freedesktop.org, stable@vger.kernel.org, dri-devel@lists.freedesktop.org, Russell King , Dan Carpenter Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" etnaviv supports the following pipe types: ETNA_PIPE_3D 0x00 ETNA_PIPE_2D 0x01 ETNA_PIPE_VG 0x02 The current used value of 4 for ETNA_MAX_PIPES is wrong and caueses some troubles in the combination with perf counters. Lets have a look at the function etnaviv_pm_query_dom(..): If domain->pipe is 3 then we are one element beyond the end of the array. The easiest way to fix this issue is to provide a correct value for ETNA_MAX_PIPES. Reported-by: Dan Carpenter Fixes: a8c21a5451d8 ("drm/etnaviv: add initial etnaviv DRM driver") Cc: stable@vger.kernel.org Signed-off-by: Christian Gmeiner --- include/uapi/drm/etnaviv_drm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/uapi/drm/etnaviv_drm.h b/include/uapi/drm/etnaviv_drm.h index 09d0df8b71c5..5a62228298d1 100644 --- a/include/uapi/drm/etnaviv_drm.h +++ b/include/uapi/drm/etnaviv_drm.h @@ -75,7 +75,7 @@ struct drm_etnaviv_timespec { #define ETNAVIV_PARAM_GPU_NUM_VARYINGS 0x1a #define ETNAVIV_PARAM_SOFTPIN_START_ADDR 0x1b -#define ETNA_MAX_PIPES 4 +#define ETNA_MAX_PIPES 3 struct drm_etnaviv_param { __u32 pipe; /* in */