From patchwork Tue May 15 07:58:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 135832 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp668226lji; Tue, 15 May 2018 00:59:47 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqTrsYAsOkeKkQofODmDt5tEaVK185mfkofoY4UVxekJTGtk+ZbNeg8bw1BOR1HO659xWoa X-Received: by 2002:a63:6807:: with SMTP id d7-v6mr11337204pgc.332.1526371187789; Tue, 15 May 2018 00:59:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526371187; cv=none; d=google.com; s=arc-20160816; b=A3AGK0nN8HEIcMkRZUlP0FFYDup9Og0aSdVuZgL8Oe/KYu2cT3WlYyQRgjrjS+yVTF DRT+ydCRBzioeeF6pwJ2w2ejhaET+KHTVl35hH2GhJKVRLtjzDRTYVIzUOH7Ujs/Dh7Z hHkM7U0vczw82ClSYXHGPXncjWBoekRaX5h5YzO95NvrG9JVcuH+JmRCEIcAIvImclfd AAedC5SMmo7rni2poHTBdq4QZuhixpBYiblcz435LFsblKvLyhwxfmmHjPfCKS1T7XBt 1W2xNtuTHnmKFBfPb0fS27yGP4VffX7z/GGspVqZgw6UJKcfu+tco7dVpQe1tf2xFW1e y/1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=CFcHnBnr24I9Zi3qrvCW8fiEJK7L0zJPfCU7moSvXLI=; b=IM72SAFI4YURK3+N0Eb85qIDnrg40eyXQ0tRtrh71FE+esMZsajVkoh6IxuYDpMXaw crZlGWQEfYnQTq5ekyEl9lsJTMW/zRw+bWdYMUqPnS4Vc+yWijUtmSrH0vuCZHyrY295 HpZdFgqgKlf36MXc5WwwKungNnMaLMudpvZ2IRWANAbYz8HK+K8xs3Qypb2BJ4uAzY0h N/C9aK2kYnKwzGmA5PyR7TcEXccbubWpj3LNRPSW0zpqDP0iKwbJXbOu7h7w3Dt6ToGI GEnA5PT35iEWlUeN5kZWDJRpCz/A+0Ch5yEQDv9xCz0gpqwRIatOt0gvarhDRpTGW5jn xkww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jBpVM9CT; spf=pass (google.com: best guess record for domain of linux-media-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-media-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v12-v6si6045050pgs.538.2018.05.15.00.59.47; Tue, 15 May 2018 00:59:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-media-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jBpVM9CT; spf=pass (google.com: best guess record for domain of linux-media-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-media-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752554AbeEOH7o (ORCPT + 4 others); Tue, 15 May 2018 03:59:44 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:39651 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752485AbeEOH7i (ORCPT ); Tue, 15 May 2018 03:59:38 -0400 Received: by mail-wm0-f68.google.com with SMTP id f8-v6so19700982wmc.4 for ; Tue, 15 May 2018 00:59:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=CFcHnBnr24I9Zi3qrvCW8fiEJK7L0zJPfCU7moSvXLI=; b=jBpVM9CTcotG6mpDxL7iGFOac9d40Aa9eo5eeqO4MEiT6Un+vjSIZYNu2+b0armIHA EDCTssUlnV2DgyEBW9jE25XN3yyVGuqh8CoR0T8ufCbos7GWA/dz8Wuj01bnSw+mKCih qwjt+g4AoLk/CT6cepOwh+xIV22pFtFYv/Za0= 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:in-reply-to :references; bh=CFcHnBnr24I9Zi3qrvCW8fiEJK7L0zJPfCU7moSvXLI=; b=lMYfXIYUcSqNauyLJGznupSvioPch1TlLkAlyLRG7YT4YrCCQDxLraScCOWO9WynxS 17Iz048Tm7AcVHZwtQBN6oEzDDrwTV61TX++3jsM6lyHZsdIKZ755RRr9zzwhoSTmtjl uQ+FPNMXhuu7RNqn1wvVBosGYRalOn8Ijau6LABnOQ7ORrjp1gvF/cIOQ9yJ8tXf/AD5 FXy/qmz5OSGoFdVl9SxT637BdSzHmwXSf6WOHrnwn5Itl5w7WWUKunaLKAwImV++c5cO hSdoKfFapHMHwXeBgz69YuvHnAE3fTlnsB4pGN/O/uT9Mqyxm+565GmiTuoPULp+7gYs LFmA== X-Gm-Message-State: ALKqPweb3ZB+j0S2TuXqHUdcKay0rhtuwPKHn4FY6DI9FRD4xWPz0kdZ ZDWF5xnDcSEwzcclBWvPhlqEsw== X-Received: by 2002:a1c:1c85:: with SMTP id c127-v6mr7627441wmc.69.1526371177747; Tue, 15 May 2018 00:59:37 -0700 (PDT) Received: from mms-0440.qualcomm.mm-sol.com ([37.157.136.206]) by smtp.gmail.com with ESMTPSA id 4-v6sm10918510wmg.40.2018.05.15.00.59.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 May 2018 00:59:37 -0700 (PDT) From: Stanimir Varbanov To: Mauro Carvalho Chehab , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Vikash Garodia , Stanimir Varbanov Subject: [PATCH v2 10/29] venus: hfi_venus: add suspend functionality for Venus 4xx Date: Tue, 15 May 2018 10:58:40 +0300 Message-Id: <20180515075859.17217-11-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180515075859.17217-1-stanimir.varbanov@linaro.org> References: <20180515075859.17217-1-stanimir.varbanov@linaro.org> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org This adds suspend (power collapse) functionality by reusing the suspend function for Venus 3xx and also enables idle indicator property for Venus 4xx (where it is disabled by default). Signed-off-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/hfi_venus.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) -- 2.14.1 diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c index 284da69eb81b..109116e1545d 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -878,6 +878,14 @@ static int venus_sys_set_default_properties(struct venus_hfi_device *hdev) if (ret) dev_warn(dev, "setting fw debug msg ON failed (%d)\n", ret); + /* + * Idle indicator is disabled by default on some 4xx firmware versions, + * enable it explicitly in order to make suspend functional by checking + * WFI (wait-for-interrupt) bit. + */ + if (IS_V4(hdev->core)) + venus_sys_idle_indicator = true; + ret = venus_sys_set_idle_message(hdev, venus_sys_idle_indicator); if (ret) dev_warn(dev, "setting idle response ON failed (%d)\n", ret); @@ -1525,7 +1533,8 @@ static int venus_suspend_3xx(struct venus_core *core) static int venus_suspend(struct venus_core *core) { - if (core->res->hfi_version == HFI_VERSION_3XX) + if (core->res->hfi_version == HFI_VERSION_3XX || + core->res->hfi_version == HFI_VERSION_4XX) return venus_suspend_3xx(core); return venus_suspend_1xx(core);