From patchwork Wed Jun 27 15:27:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 140350 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1031911ljj; Wed, 27 Jun 2018 08:34:30 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLWzoEk0AsBxAp842Bi+sjXUd7Sq+PdENQ9D8tkurZsOaueD28sbhVqw6C7w9GL5xwBJ9dQ X-Received: by 2002:a63:4346:: with SMTP id q67-v6mr5596346pga.328.1530113670455; Wed, 27 Jun 2018 08:34:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530113670; cv=none; d=google.com; s=arc-20160816; b=uPzaxZd4KCbjbt97fgfB+UA0Ws1E81beEOEkYziSG8K0V2sCd6zvNQ8wVoUBNv6yrk k3BWeoYTkFDLNbXTTXco7pmwkImh++eZ5s6N+X5MGFXsmJN7VaGfvos7oejY20wi4lXZ xhf8rhV8g9UEIqH7YupNO3J4uoiGs5QLjmMX2RMPoYQCQQAS1rzMcnLYP9XxyCHy7ajO elTlmpl0/o5BYf0lGTFB3JImNPWJmRGoWwfLi5WslnXAcfwNBgiJa7Y2sznOWd7+iYlG jsNJn5hPprRMY+qGaa2lRmbfXAl51MRrtmRR4Y6j42nj4ZPsdh5Bq4mxQuaLvdZvfXT0 FlNw== 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=uzFPQjolv+jdPi2Rzia1jtwxKrkKgXp+JYTymg81g5w=; b=Fyjx2gIVYloT/cHhKz10oeEz/Tf4CydrEhWM+Ime8dkqxM4AyOXWNIiXsBIRyHFVdZ 4hbtY6bQhIQCQZp8bLjoc1jBrCsU9ydW/HU4XYLePKW0dJXVY+xgNPZ6Ezpp2nwhfKdJ JxKiyQrM7ucWx4dR62kIBFaKNwKqS4/AZMCDiTs+Vyq74TjQAzDjdUv1d7F3Vh4+o/19 mkAtO+KYS//Mr0XSc7cLhEv/puiaQwcoFuCS8s2XMwd6uVUU2qofn8sPL10ZXmAbMInC bLvR3441mHMqvQgcXpHLDrKHUek2+R8JVuzyYIiFthwwz05gPwcJKupuaAJzt45Z0W1N 69WQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JnltAuit; 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 71-v6si4500811plc.164.2018.06.27.08.34.30; Wed, 27 Jun 2018 08:34:30 -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=JnltAuit; 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 S1754858AbeF0Pe2 (ORCPT + 4 others); Wed, 27 Jun 2018 11:34:28 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:35862 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934746AbeF0P2K (ORCPT ); Wed, 27 Jun 2018 11:28:10 -0400 Received: by mail-wr0-f195.google.com with SMTP id f16-v6so2477164wrm.3 for ; Wed, 27 Jun 2018 08:28:09 -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=uzFPQjolv+jdPi2Rzia1jtwxKrkKgXp+JYTymg81g5w=; b=JnltAuitirgIaqipM2se+1wW3dps/iJYTdkVv4qb0qWUxT1EndUm8AAoV8nbADoGrC bKDbksHWCiJEGSQUbGSHGmVmlZ8ZZcO9775XaQjghcKXNOO2gR0E/DdTs+NDLSYGR2YV b46pwB+RAWziqSia40I4PLO3/EPBy1uRl7bnk= 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=uzFPQjolv+jdPi2Rzia1jtwxKrkKgXp+JYTymg81g5w=; b=YLk2XG2xUGG119nuAOJZ+r4m4/Nzgf+43E/BlyjkvzGKngeWdntVY8RiA3QBDuBFyh pzuP+SOG1VCTr4J1N8G3Bl6T9IMSpIwhOJ4s3cawmAXFncwN2RoWdRbGfHrnQtXfVNPz uEx/9QKpXZNAMyBuH74+dtmjbcXMy8UQEa3wvj2M53iEwUWcxSX2Qub4u2FYWAL7OoGn +rPQnOOBeC9Kan68ppW1B2GRC25qc2iQ/8FHhagqFfI+h+0oma9NWl+mAUjWreK9F5Fy XIZnwCnrRyArM0Aw3ISIb64iuEp1/sJzr2baLF62IBKewCY+rhMfj/Cq2OE4lFBXLmPv mNJA== X-Gm-Message-State: APt69E0x27ehFKA8qngxmT18jnq0loxIrkkF+gD4UKzoVjMfrslE98dn AnAOCHFycsfaLr2kR2+bEWR3Lg== X-Received: by 2002:adf:c44c:: with SMTP id a12-v6mr5854279wrg.20.1530113289340; Wed, 27 Jun 2018 08:28:09 -0700 (PDT) Received: from mms-0440.qualcomm.mm-sol.com ([37.157.136.206]) by smtp.gmail.com with ESMTPSA id o203-v6sm2916075wmd.30.2018.06.27.08.28.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Jun 2018 08:28:08 -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 , Stanimir Varbanov Subject: [PATCH v4 10/27] venus: hfi_venus: add suspend functionality for Venus 4xx Date: Wed, 27 Jun 2018 18:27:08 +0300 Message-Id: <20180627152725.9783-11-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180627152725.9783-1-stanimir.varbanov@linaro.org> References: <20180627152725.9783-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 Reviewed-by: Tomasz Figa --- 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 7a83e967a8ea..9366dae16b0a 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,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);