From patchwork Wed Jun 13 15:07: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: 138503 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp855372lji; Wed, 13 Jun 2018 08:15:10 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJjqAuO92tycuTPBEbh478rRvNy4hhMygA12kUWbo5cx6chV+rGlsDlP7xzYS/huLu88l7l X-Received: by 2002:a62:c45a:: with SMTP id y87-v6mr5393461pff.190.1528902910001; Wed, 13 Jun 2018 08:15:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528902909; cv=none; d=google.com; s=arc-20160816; b=FGSgc0rFujumPYfDKGXYTvjv18Pg7teTWRjsS+WXTORM1vd/UJdl8+FpZVzCkXbMHc lYoiqKrQq5LFwKqZwK+Yt4Emk1hRRGp9HXxATmSP1EJROrMXe2E86scPLaaCnmQ1GwDD Sy2r2t5IFtL+xmrc4es6euEEkmnOaHNbF5Ub33asv76xmTZxTZwsc2hnmvvrj39Zmn3c +VhiIIvl8YIiEcGTuJQikSUMdkIGELrcJfGxEEt0RsdE84hI8vOvTwW5//4y2lASwJCk NWsBiuWNBB8xMZ/0dMtdUM+hfqBjseUbSh27WqXABACCJ0Us54mPZvSa0b46r5t0DN0Y FMMg== 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=Cy/HDysir2FFHtxN9vKRyaLp8y32qoq+nHZx9dn3m2pHhXGW3WJP+30F8UeLB85lKU Oti76J+SCd0yOJmy1B3phNG8H3T2d16iwJA3xo7JCJ7YbzmALnAHffhlTJ0x68GEAqCJ weM7OAtxtlQ7RFgaclpLh41jEX9pnRHcd+EG0UT1QEdmAi7wJ6XajV81jWTVJ1Min0ZB icaipDX4yu1wZox9y8DRF0iATEglHJXnbbO7l9jbvSW+0kAc1yfWiN8SARwyBdaeCAYF Be2qKDOqfwudosih2jtG0F/lpozkc6oaAjeKrVAFT2qyEXN2s0+cXL0lCh8LjAanp9Rz 3UVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WYahaee9; 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 l190-v6si2654716pgl.198.2018.06.13.08.15.09; Wed, 13 Jun 2018 08:15:09 -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=WYahaee9; 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 S935815AbeFMPPI (ORCPT + 4 others); Wed, 13 Jun 2018 11:15:08 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:40535 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936010AbeFMPJV (ORCPT ); Wed, 13 Jun 2018 11:09:21 -0400 Received: by mail-wr0-f194.google.com with SMTP id l41-v6so3135452wre.7 for ; Wed, 13 Jun 2018 08:09:21 -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=WYahaee9FKtN9RHnrOnFKlknZvB2h0rYgwo/5nedys4o7g2YZYgQRAdBQ2GhGH/712 JsC0sFJRZLEZM+P8FYfehiho8g9UjKvTg3m1t8NoMTie3nZ5Kz2U+bpbPBW2U3FNpQ6o Z0PSeSnIQKuROVwvjRr07jbLFfEibnFT3BXNk= 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=jYbMB3hPTUiEtBDOWy91t4Xn8oP281L9RfoBAEU1lX5QW8t9cfGMKSnjG4eEhWDjoA v0LloNRxDxzvlnBI2xfLOOhUiJxMLnoikxnJfu3ISc+GxzNriHEEuhRJmig6AmX2DWmP OpSXWi43oR6+mXiHJU8NavGMYnvdTY9qr4PFH19LJq4n+x2/IEjwfqBpyig6wySR2NlE H/+Q7XITIVyesX8RFuJKJgV98dSSJFGW4CG/WSLg1jzMqkPzGPnLPvTqmx2dDIbmXrLu VkhjJWF1W6v1poPV1jxbzd8tm0Xb0EjVYbQ7/GfJ6mpXMUXUz+0j8ezRqzjE+LrFi8y5 a0Mg== X-Gm-Message-State: APt69E32aNEmG//QeLrMDy5528uvk7ny8cd6noaoLS4eGhW6r7XLmaaq BFxm42B7Awf2Z8Ns5k0iffbg6w== X-Received: by 2002:adf:c00b:: with SMTP id z11-v6mr4284919wre.268.1528902560453; Wed, 13 Jun 2018 08:09:20 -0700 (PDT) Received: from mms-0440.qualcomm.mm-sol.com ([37.157.136.206]) by smtp.gmail.com with ESMTPSA id e13-v6sm2886548wrm.45.2018.06.13.08.09.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Jun 2018 08:09:20 -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 v3 10/27] venus: hfi_venus: add suspend functionality for Venus 4xx Date: Wed, 13 Jun 2018 18:07:44 +0300 Message-Id: <20180613150801.11702-11-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180613150801.11702-1-stanimir.varbanov@linaro.org> References: <20180613150801.11702-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);