From patchwork Thu Jul 5 13:03:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 141139 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1927000ljj; Thu, 5 Jul 2018 06:12:53 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd2tId49n6exGxA9praxE5UkOOJts3cTsU+C7ja/AP10dqbvkVjBvnwEdeWMJei2s5JkmmV X-Received: by 2002:a65:60cd:: with SMTP id r13-v6mr5649796pgv.232.1530796373272; Thu, 05 Jul 2018 06:12:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530796373; cv=none; d=google.com; s=arc-20160816; b=JFHf0xvZJRXoGuPtTM/rQ+8z5hAn1b9rID80qzzMXrjDB//xn7fHKCeVHf9DyezLPm C7nQFeE40yXFXTHN7Nn4GC1fBeEGxmofRmMvexNj2v3u7xwstOsZlBpRlbigP7mWvtuC nUVTqXpsCFDhYbk92Rjw1HJO6C8OLV5sgJvBMZp7TP49ChuB6ouC3pRx5rH2OMA4joak tZFOu7wnm63jnKaHLnMMPMncKMxlsNoHoanf46guvYTmcjcsimoEx98hPLUMhqzRaOEc PrM/ZRrvXhZgyPxXXwZiTjCZ0JLDETnXAIQR2GEvfemOYGikzGJx3V4gDYGiC++h73AH LaFQ== 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=0MKE00JaWerRp2/nQ0l2U1l97a+GwZN1ggGadoc+uKY=; b=j+eEDRqv+De61PdZJg9Gtznb+26Kk7OzKNw5Y3y0xS4gtfTe8PTyjZNa/5nV3dR3/h vkNOqdYojz5K4puzd2c5GX2q7jIT34a2rc7X1m+qPkc0TWKK1daHO+CrykIZUqbvxDel LGbhCI4E7lgLq3U+AbqQROYbuZV1J40OWJ9ZF5zOhc5cyuhN0nd5uPscfhx+qyeP78+B ONKyjpN8u+Z9WkA+bR9Jr+CrMn2BYjZPTz+3WGPudDJobfJtjdjwYncYLO+0+O4lmo+X FVQgq8W7Pan5Vm3DRGhIs8HCOGqklSdQOfIV7v5j+1drg/D2CdGfwDpO9/veOdi3LDpt rDKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Y+tsa2Kg; 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 i126-v6si6238004pfc.296.2018.07.05.06.12.52; Thu, 05 Jul 2018 06:12:53 -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=Y+tsa2Kg; 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 S1754675AbeGENMv (ORCPT + 31 others); Thu, 5 Jul 2018 09:12:51 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:45771 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754342AbeGENFT (ORCPT ); Thu, 5 Jul 2018 09:05:19 -0400 Received: by mail-wr1-f68.google.com with SMTP id u7-v6so1137735wrn.12 for ; Thu, 05 Jul 2018 06:05:18 -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=0MKE00JaWerRp2/nQ0l2U1l97a+GwZN1ggGadoc+uKY=; b=Y+tsa2Kgng9NIpvHg6lzwny2cePlCJmo68eKAkvZ/n6P7oGZ9uglsTSl3c6Psm09ao IaezgHVRYpSiEag/EIiewAtPSsBi1KxExBTPg+/0aQbeaMQH5nukXvWjUVlUHBOcHei7 VCCggFIwfbBCRZcVuE3RTOxtgOPSvjypnkg0k= 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=0MKE00JaWerRp2/nQ0l2U1l97a+GwZN1ggGadoc+uKY=; b=EIC/2y1lfSl0uSlH2DlT+cVi2R68kC0zSy8LdsrwGcl9qwt6gh13JVusjeqdKax4rw F/alnzXkF6ZrQC23N71sDqtN9Tj+H2bFyTNLXxpBj1oEHVH5Ti8tZCxzvJ+ZTIO+m8qq ULY8KqUBqRpZyfWa6a9uuF8Z4D65a9j2aEGga++6rIi1N45CNJhrC4LacaTOVXrSHRFL 7o83BQsiFNNcborA8OF7SBUg8VJvxfdBXr4r3lkI8pGCwZ8DPiynepc1n26tza341HDr d2BmAJPGF24uqtgUgmrg+VJkcAYGv2dXtnN3qfl8unsa/Xltu1FwNV1z86RVvDz4vcMB LHDw== X-Gm-Message-State: APt69E0KMde9fYJDErsmpS0nmi0WvzHtO4RzktaKMg92PTgO7I5y97Du PSECRhZ9wYuFydFWnYaj7081cw== X-Received: by 2002:adf:9f0f:: with SMTP id l15-v6mr4653674wrf.206.1530795917786; Thu, 05 Jul 2018 06:05:17 -0700 (PDT) Received: from mms-0440.qualcomm.mm-sol.com ([37.157.136.206]) by smtp.gmail.com with ESMTPSA id 11-v6sm2109102wrw.67.2018.07.05.06.05.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Jul 2018 06:05:17 -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 , Tomasz Figa , Alexandre Courbot , Stanimir Varbanov Subject: [PATCH v5 10/27] venus: hfi_venus: add suspend functionality for Venus 4xx Date: Thu, 5 Jul 2018 16:03:44 +0300 Message-Id: <20180705130401.24315-11-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180705130401.24315-1-stanimir.varbanov@linaro.org> References: <20180705130401.24315-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 Reviewed-by: Tomasz Figa --- drivers/media/platform/qcom/venus/hfi_venus.c | 10 +++++++++- 1 file changed, 9 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 7a83e967a8ea..124085556b94 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -879,6 +879,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); @@ -1533,7 +1541,7 @@ 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 (IS_V3(core) || IS_V4(core)) return venus_suspend_3xx(core); return venus_suspend_1xx(core);