Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp269059imm; Tue, 15 May 2018 01:10:46 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqr2msTKjx6FjWiNKKIwWFVEWaznfwoXnpExv4BhVyI/HlGaFFTyw9lxP3rDbLCeOiA94Zm X-Received: by 2002:a17:902:5952:: with SMTP id e18-v6mr13581959plj.351.1526371846818; Tue, 15 May 2018 01:10:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526371846; cv=none; d=google.com; s=arc-20160816; b=ki9If8NQ8CpdqqF2x2PEdLDOmGAjChFwtueRjLRdbYag7JX4pVqXo9X/uQTzAsZAbe j975zbGOFpVnxM5W6HRUIfGvu4W0ikVf1UOpZRRe5X14kL6ZeUGTjyp2UF97rasSl5V5 qy5FnfXBJVBAJAwujZjgGmc8aCyiZabU25Eu6HO486lPzvFR4UTijGRZsrXcQNLHrto3 +qaFnBwty6qAD85RQJmcCOJ666JAWupwlGLBjcLBbw9UgM+pYmeWXWcc+8+7nm+2S5hu T0yk1cLZuBU2GrUoxSNEiCcNBRYslAlSqqpconGT1RvMMm+tcCNnCIoBge9qXe+/N0se bHXg== 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=psrZUZRpOwKC0BVo5tp5Mf75Yw10D/F5fd+ybANaAVXKyOePIngN3a9vcAyg9XskJW a13HE1WmSQrR0le1XZVCwPfOl5BSudzNTnd6rrYh6d6LfoeLAy//X9agQaHu/MbFJwlN OnZ32USO4BgHB4dnfx06N/5qRqV1YWRRRBZhmhY6AY/f0taTHDxlAjzIi+iQTOH+A+Dw kpXOB6c2aJ/LqtlMKPID1d5X6uGV2sjjN3T0EW+TljDCBu4hVwZD66cYs+o1eVDU8PHl dK/ovcT7qUC6Hn9iyIWzI1yLjp3Rgb7VcVxn9FbItuuqlr7DBgEhO6pzLfBenw5ylj9A 9/gw== 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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 s20-v6si9046393pgv.668.2018.05.15.01.10.32; Tue, 15 May 2018 01:10:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S1752757AbeEOIJl (ORCPT + 99 others); Tue, 15 May 2018 04:09:41 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:51595 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752531AbeEOH7i (ORCPT ); Tue, 15 May 2018 03:59:38 -0400 Received: by mail-wm0-f68.google.com with SMTP id j4-v6so17707251wme.1 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=mxth7Y7sk2adXhEz8hihgZJa4XWirXVOcHbNr7vEGUpMcEVrkp5/RhmIThOgI7rMRS BNsmFAfewycDJnECYFktlYuG7zTiinkSq/NUeiViUSmb2vwOBH9GO/lr0XLyNA9CNXt2 2H/8NHMvOpn/WenICSO0Akd9A3yZv3K1aZB1TnzlEnwvG9Q0aHW9jXjTA+EinJQ11plr BHBXYZoVn/gdf5l/KYU9yEjX/JDUGV/8ccx2KYAMQbbMKxIPI/23WfCTYEYIdtkzJKcE c565PIUJQnkeibrO8RtEbzbR54vXP1xOL4wxQnVQ1JORsNo73K50/1js+Fq6RBYYgsS9 W6zQ== X-Gm-Message-State: ALKqPwd1wnQeJE7UuG0YgzzrkZqz5mIsf/Nh8eQTLoWCb5zZ703SqpcW Y3p1apFF5xDt/TSWTFbkkOzZ9w== 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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(-) 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); -- 2.14.1