From patchwork Wed Jun 27 15:27:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 140351 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1032283ljj; Wed, 27 Jun 2018 08:34:47 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeXZG5SPb+OcdgCR9cCM2EP97MyS3vwF2eRQSU5j5opM8g1iyoYU2GGPEI+k1SqWeK/0vBD X-Received: by 2002:a65:5004:: with SMTP id f4-v6mr5651516pgo.54.1530113687741; Wed, 27 Jun 2018 08:34:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530113687; cv=none; d=google.com; s=arc-20160816; b=FmjBdDEofiNPwG9X8DajGwFkxUPQRfG+TflWAsPnvEH9uGlw1nJp0RUBnqqnMZUOCf NAu74jbl13VfagLJ67jWPT0+Uox38SdW7mRdB8Twt1ltIiMRY0fBchnAzMO2b6mouNDZ pAR9r/7ITm6284MBeHICtbO+xcDiLapG5OUJnyyS8PJhakpyWwGJHzWa9nycjKODePo4 eweapXISUCPvAxS6bhOxuYy3r7P1GUeVN+8QuNps7x+XDgxaDF5UJcZ2EuYceI+jJzeK UIEn/J8hi4UD6TBZDi4DdXoHKv3eMFhC4enm3/fP7M62J7+HofbR+Wkn2YTcsg123Ijg wWVQ== 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=DopT6tfRa5ZXddiWA2KYWqHxQ5fQ330DwA7mzNfZ1z4=; b=Hv+CE6ij9KP6I/QIzD/Fk3Ze1RPxkF5RyhJ0byX2UzenLUcJ4OTzxoMbCOaj14rwPE bO64gkzvewyg6TFNPfCAjQj1UJ/pHVPKFa4TcDsohRkVm+AHhGIRrFE2Q058xK0o5nXm 5uDV6jsfavOHTFJ8AhdNCCfLehwIouKIMD70+46yfuSbFG6CPHuj+InSOC9JkGBu9op6 BI8rBY+W1fHphTo+yFzxmgOdojdHmCjTZwL2N+TahVZfREFbixeOsxRrfTQgXDcpJOk+ eHfCrQrBiIZ1y7MFcfjFERboFk2IUPNe309hYynDQ8IueNGHWdFkzvppd9pY5cFdRtgR gZ5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RTTIUh1N; 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 t4-v6si3779273pgc.572.2018.06.27.08.34.47; Wed, 27 Jun 2018 08:34: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=RTTIUh1N; 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 S934867AbeF0P2K (ORCPT + 4 others); Wed, 27 Jun 2018 11:28:10 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:46814 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934841AbeF0P2F (ORCPT ); Wed, 27 Jun 2018 11:28:05 -0400 Received: by mail-wr0-f193.google.com with SMTP id t6-v6so2460654wrq.13 for ; Wed, 27 Jun 2018 08:28:05 -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=DopT6tfRa5ZXddiWA2KYWqHxQ5fQ330DwA7mzNfZ1z4=; b=RTTIUh1NszVoP/tmJF2cGpBKo3PWNyEcYbh7tdayfs5Z+EgDM4BA0/5xTEokTLG/LY /95pr2bp4ocyxMdG6PcNQhuwWys59pCt0g7vM3t6EA1xpm9BGqkpU/jqzuD++JJEUxOS Wy8DFHjD3HOZG1iH4Avy5Fvm1GL+c3wh7CaPc= 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=DopT6tfRa5ZXddiWA2KYWqHxQ5fQ330DwA7mzNfZ1z4=; b=qBUfXAS9FjM+VFOmuIzUsi3vdwOWO8yYl5sEAxqlyWjcHtjQ65hsWtRx6YdqyeQr9i h+7x1iqUMLORDf0mGELLjWBT+JA3MJvAyTsVUzotKY83yDlIOP3D5cFJjbr6W3BfmN62 duxMFL9sv8LjDlNH2RGuhknXqkQiDl0hOqCKTYf+iZBi9PbZrmu78iJibS3p1Nk9E/2f hmTIVH/Jk1QUUBs59g8ZApNo39ik41FEejC4fvePw0VBZ751B0x6R/qDtvbAytfzDszV u6pcov18PvMX9cU8/EiCGofh2WzcenYQG76uUcSub9dSkVJXnAUVmO0QYTxSALn/BsL5 WqMw== X-Gm-Message-State: APt69E2b8AylPAdcOJBs3xzUZuojXRjmXwHOC1Y2KvK3FxZZmWx+03qi CUTpF/mdl4kmgPvgtBsKMFUr6g== X-Received: by 2002:adf:e590:: with SMTP id l16-v6mr5281175wrm.190.1530113284727; Wed, 27 Jun 2018 08:28:04 -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.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Jun 2018 08:28:04 -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 06/27] venus: hfi: handle buffer output2 type as well Date: Wed, 27 Jun 2018 18:27:04 +0300 Message-Id: <20180627152725.9783-7-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 handling of buffers of type OUTPUT2 which is needed to support Venus 4xx version. Signed-off-by: Stanimir Varbanov Reviewed-by: Tomasz Figa --- drivers/media/platform/qcom/venus/hfi.c | 3 ++- drivers/media/platform/qcom/venus/hfi_msgs.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) -- 2.14.1 diff --git a/drivers/media/platform/qcom/venus/hfi.c b/drivers/media/platform/qcom/venus/hfi.c index cbc6fad05e47..a570fdad0de0 100644 --- a/drivers/media/platform/qcom/venus/hfi.c +++ b/drivers/media/platform/qcom/venus/hfi.c @@ -473,7 +473,8 @@ int hfi_session_process_buf(struct venus_inst *inst, struct hfi_frame_data *fd) if (fd->buffer_type == HFI_BUFFER_INPUT) return ops->session_etb(inst, fd); - else if (fd->buffer_type == HFI_BUFFER_OUTPUT) + else if (fd->buffer_type == HFI_BUFFER_OUTPUT || + fd->buffer_type == HFI_BUFFER_OUTPUT2) return ops->session_ftb(inst, fd); return -EINVAL; diff --git a/drivers/media/platform/qcom/venus/hfi_msgs.c b/drivers/media/platform/qcom/venus/hfi_msgs.c index 54cd41e5837c..c0f3bef8299f 100644 --- a/drivers/media/platform/qcom/venus/hfi_msgs.c +++ b/drivers/media/platform/qcom/venus/hfi_msgs.c @@ -823,7 +823,8 @@ static void hfi_session_ftb_done(struct venus_core *core, error = HFI_ERR_SESSION_INVALID_PARAMETER; } - if (buffer_type != HFI_BUFFER_OUTPUT) + if (buffer_type != HFI_BUFFER_OUTPUT && + buffer_type != HFI_BUFFER_OUTPUT2) goto done; if (hfi_flags & HFI_BUFFERFLAG_EOS) From patchwork Wed Jun 27 15:27:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 140332 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1024405ljj; Wed, 27 Jun 2018 08:28:16 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeagyuUJvFRN2mS2ElyzgQy6NuYpHABB8PopT8Xe/NGGpGC3bQROEzCAmbSRtPnulz8kvMZ X-Received: by 2002:a62:ca99:: with SMTP id y25-v6mr6277781pfk.187.1530113296160; Wed, 27 Jun 2018 08:28:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530113296; cv=none; d=google.com; s=arc-20160816; b=SbrFWkGJfna0y9YC0PzZKit3xjSdSP/Yd1fB3bO+AIjyY2YFjXD+CmYIS7UavWmpON E8l5d7J8c4SWh70RxnWPfiMtg6GzDZdxh8SuSx3qT0m/YSVgQ41xOAPL6f/7XAARb338 35yr5ATnZliqz7dP71ueAJIbikWBu3Y+jGxj7++3mlft+1VrPiCJOzdYJbLFZq+RrXb7 v5vbxxuLF22AGLRKh2JrrebEi7SqECAYZFeZKOSO9lCce7ONu9LZ9SZzMSGI5d0UB/K9 AbUyuILnck4Qg1Hj6bPUJR8AHyIwLZPL5hmElerrj2tn1VM9QBQZLkYlLhZFP/S43aTe TiPQ== 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=JTs56AHvy6n4KWdfQCk5+mkf+fJThH/BkJrEXFnLkOk=; b=Zzwm6UcaclAMV+OlNRTMZnO8LLbY0kwOLUNTSkZ64WIILjnUY+SBVrQjG9hqEgPVXD 6a8NfWD537oKkbbvkxzy0P0QvFu7sAr2NTUVosUNv9imiBDAvDch01K29I7n/J79epm2 fvdpviGVLF4pXF1gp2e/HmCUyFVVOGbtUnKd5hvjaWjqHiNCdVl1yyfrnZn1r9TKOZQ4 38ccT+t1rBW0jOSLxyMV0gcrkxJD9adSaNjdDtyVgiq1exWyg55DKPj7A0tEzweKj1Jx ZA9+LZO+P5ZWI0s2fLBnXeit7thwmHe2/gvZtaynvT+ZZZ6Ma75kEf9y0hEDqbiLqg/i YJnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KIEUNa0Z; 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 h128-v6si4141015pfc.211.2018.06.27.08.28.15; Wed, 27 Jun 2018 08:28:16 -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=KIEUNa0Z; 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 S934894AbeF0P2N (ORCPT + 4 others); Wed, 27 Jun 2018 11:28:13 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:40605 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934850AbeF0P2H (ORCPT ); Wed, 27 Jun 2018 11:28:07 -0400 Received: by mail-wm0-f66.google.com with SMTP id z13-v6so5958757wma.5 for ; Wed, 27 Jun 2018 08:28:06 -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=JTs56AHvy6n4KWdfQCk5+mkf+fJThH/BkJrEXFnLkOk=; b=KIEUNa0Zj98zU6QZS9HRyNaM8Rm2DMHuM4kWqpNCFGn0qivw1VH6Um3baqHDfw3Fw0 31YKr11rvEQhst25ULi37Eb7tbUEFPGQ+lsr61tuic/MAMwtQDqN9NAMWg9QCikusPMO gKikJDIlFp2Xup/ytCo5IKE9r+HGVwltbXS4E= 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=JTs56AHvy6n4KWdfQCk5+mkf+fJThH/BkJrEXFnLkOk=; b=tGRAW1N/uBjlI5xPBD0vd/sIrWTFnNvlJzvPvBvC6Ih2rlJYkbA4G8EcDJRQjp8V0o 4o0Asgy4o95yVM7r+xDdhq6IQBHa7oQ4r9sKtFWLEDnZJzFXdXgDXvLoigpSBIgJVYSA JjtDanujCpaiqhR2vkZNrulyzbMthzJ3L038xaL4mKULvDcN1kIi5frBFlbFfUYahYBZ M5b+hVpv7XwMOdUKm8WPI4cmfexaX4/IVUWn7zWR87ItvPp+xPoEDZuGsy7j0zAGqRok RrDpb2jqS9DPWdnMCbWolRoxm01bjqSMKR/3upsj38wCOfCuC41s95AFgQmC+uDVTrQz R/Kw== X-Gm-Message-State: APt69E3p/3vnLK34cGtgaXQvNm5+gFXD0wQy6uU0BePoV+2V7janYe4f CVufqDfUEDDkVy3X267IHTqfYQ== X-Received: by 2002:a1c:4a9d:: with SMTP id n29-v6mr5039453wmi.46.1530113285944; Wed, 27 Jun 2018 08:28:05 -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.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Jun 2018 08:28:05 -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 07/27] venus: hfi_venus: add halt AXI support for Venus 4xx Date: Wed, 27 Jun 2018 18:27:05 +0300 Message-Id: <20180627152725.9783-8-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 Add AXI halt support for version 4xx by using venus wrapper registers. Signed-off-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/hfi_venus.c | 18 ++++++++++++++++++ drivers/media/platform/qcom/venus/hfi_venus_io.h | 2 ++ 2 files changed, 20 insertions(+) -- 2.14.1 diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c index 734ce11b0ed0..784b3ad1a9f6 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -532,6 +532,24 @@ static int venus_halt_axi(struct venus_hfi_device *hdev) u32 val; int ret; + if (IS_V4(hdev->core)) { + val = venus_readl(hdev, WRAPPER_CPU_AXI_HALT); + val |= WRAPPER_CPU_AXI_HALT_HALT; + venus_writel(hdev, WRAPPER_CPU_AXI_HALT, val); + + ret = readl_poll_timeout(base + WRAPPER_CPU_AXI_HALT_STATUS, + val, + val & WRAPPER_CPU_AXI_HALT_STATUS_IDLE, + POLL_INTERVAL_US, + VBIF_AXI_HALT_ACK_TIMEOUT_US); + if (ret) { + dev_err(dev, "AXI bus port halt timeout\n"); + return ret; + } + + return 0; + } + /* Halt AXI and AXI IMEM VBIF Access */ val = venus_readl(hdev, VBIF_AXI_HALT_CTRL0); val |= VBIF_AXI_HALT_CTRL0_HALT_REQ; diff --git a/drivers/media/platform/qcom/venus/hfi_venus_io.h b/drivers/media/platform/qcom/venus/hfi_venus_io.h index d327b5cea334..c0b18de1e396 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus_io.h +++ b/drivers/media/platform/qcom/venus/hfi_venus_io.h @@ -104,7 +104,9 @@ #define WRAPPER_CPU_CLOCK_CONFIG (WRAPPER_BASE + 0x2000) #define WRAPPER_CPU_AXI_HALT (WRAPPER_BASE + 0x2008) +#define WRAPPER_CPU_AXI_HALT_HALT BIT(16) #define WRAPPER_CPU_AXI_HALT_STATUS (WRAPPER_BASE + 0x200c) +#define WRAPPER_CPU_AXI_HALT_STATUS_IDLE BIT(24) #define WRAPPER_CPU_CGC_DIS (WRAPPER_BASE + 0x2010) #define WRAPPER_CPU_STATUS (WRAPPER_BASE + 0x2014) 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); From patchwork Wed Jun 27 15:27:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 140340 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1026499ljj; Wed, 27 Jun 2018 08:30:07 -0700 (PDT) X-Google-Smtp-Source: AAOMgpel7Xu9frQL+zItV8DMPK7gLFWhaJlWcjoMjfxpD4G7ktFAuCh7z/t3VQULm2jXR8MLl+p6 X-Received: by 2002:a63:b00f:: with SMTP id h15-v6mr5161490pgf.442.1530113406973; Wed, 27 Jun 2018 08:30:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530113406; cv=none; d=google.com; s=arc-20160816; b=kTGFURc0I6eE/DAq9oCS7XWb1Dfktm82bf89RkRBx/2P0UTrD5XKVI11ChZ7Rgqvcu fifxwRxJv2G7ugLFYUsuf/hi7TAPQTz7QxRQWn3tW0qur8PdcKLFui3IuURQOWLPpGjg ie6axUr5GgGNvcIVM9BCAP4+sE6/V4uEnggLUayZ2vI8PO9HLJeVirfNXGY/7lDrmz1B R7qfFVMC4mWqpJGtQP3a2EiE6Ca2C0b0Aq6CySrd8YK4Vk7WgoNbFkbhBtuQs5JYQaT6 RCLeg5fZOKShbOiuYyUGQF3Pwexs9jh/xi4dtzmHdQkiHWWmP/qQOjygHdlIWMBpw+tp JJ8g== 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=+ssufRupM9PR8pPvQwm/oq0OgQo86xh959S5/coLDU0=; b=IyOkuuvQhg771jS+xDzoZMbyhWJrF8oqjBb/7/JR2mrUctDer5eB5rFIHd+aHMvwYk SEt3PA2MXvzUxwRF4IXt44h3clakxUTGOaOxPTqsjxCp9uSMBA2JvN9I1CASq0BEMzvJ 1ztwWfIFy6snSEF7j636EL4rSWhklfJ+0mWNcfHQJDx4HQCo+pI05fLOPa/w6NwOGy4g H46UbcO8PxrMzIWe2EXRmkKNdODe/PPRhaj5rPsABQwJgpGnzqrq2KZAs0H/KAhIcOwo ruztMZiVzmgl0jTwSCFX1K5E552kURfn6WzQTAb41nmGYjapgcvOfNx9ZstcxtZ01D1d h+BQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FRDJndGe; 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 j10-v6si3940956pff.269.2018.06.27.08.30.06; Wed, 27 Jun 2018 08:30:06 -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=FRDJndGe; 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 S965245AbeF0P2Z (ORCPT + 4 others); Wed, 27 Jun 2018 11:28:25 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:52283 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934924AbeF0P2R (ORCPT ); Wed, 27 Jun 2018 11:28:17 -0400 Received: by mail-wm0-f65.google.com with SMTP id e69-v6so3402161wme.2 for ; Wed, 27 Jun 2018 08:28:16 -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=+ssufRupM9PR8pPvQwm/oq0OgQo86xh959S5/coLDU0=; b=FRDJndGeLO6T30aFBXt+ka12bRhUi4mBx3XxdjQDypdkW8l3fgdngkKvKySig+4QrS y9TwB6jrKDV2AOjjTbDMBO7ieTFQfuNpjgf4b36OI5zmwDpzEHQo9yHUVYF61ALC6r79 ylYEP/wB/WjqFfVxxbsejhp/+8U1WkCAU6EQk= 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=+ssufRupM9PR8pPvQwm/oq0OgQo86xh959S5/coLDU0=; b=oGj40U2Cxxx5iiPL1XJTdLqpFaRX/HebMxumOU7ZI5RbMPyvBrwCDUNp4o3YaWoDpV 01GFDb1RfNbdu1B7kU3Kb7TZuiDGG2kyeeFjGc6UxQ+kdWRSMRM9pbXXt3uV5M95Lx81 2M1Bia8S/rR9g35xGiCylUrLpOIzU0/p0vODjLoZNNT1/hnbCREmSndVHSc3I3IIvYIc Aax3iiSRbbunTXq3nLZJfDlKmPSnVLQlUFdY+YdzdFjqAsnlR4pjZxtCNH29L0A0CrZT ZDNq1KKFAseESC5qlVaxKLBso7iBuhNDAu4cHwPGiSfMMO1pmLFzvVRl16yAtOTPvm1D 5fhA== X-Gm-Message-State: APt69E39k2eRkFD4zKSGzVmHNjKOKw0dcbGBhq124YnZfWjORAuPvRWG 1Yz4wPUEt/QReZRhwI8OHoHzOQ== X-Received: by 2002:a1c:b590:: with SMTP id e138-v6mr2406569wmf.154.1530113296331; Wed, 27 Jun 2018 08:28:16 -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.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Jun 2018 08:28:15 -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 15/27] venus: helpers: add helper function to set actual buffer size Date: Wed, 27 Jun 2018 18:27:13 +0300 Message-Id: <20180627152725.9783-16-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 Add and use a helper function to set actual buffer size for particular buffer type. This is also preparation to use the second decoder output. Signed-off-by: Stanimir Varbanov Reviewed-by: Tomasz Figa --- drivers/media/platform/qcom/venus/helpers.c | 12 ++++++++++++ drivers/media/platform/qcom/venus/helpers.h | 1 + drivers/media/platform/qcom/venus/vdec.c | 10 ++-------- 3 files changed, 15 insertions(+), 8 deletions(-) -- 2.14.1 diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c index e3dc2772946f..0cce664f093d 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -541,6 +541,18 @@ int venus_helper_set_dyn_bufmode(struct venus_inst *inst) } EXPORT_SYMBOL_GPL(venus_helper_set_dyn_bufmode); +int venus_helper_set_bufsize(struct venus_inst *inst, u32 bufsize, u32 buftype) +{ + u32 ptype = HFI_PROPERTY_PARAM_BUFFER_SIZE_ACTUAL; + struct hfi_buffer_size_actual bufsz; + + bufsz.type = buftype; + bufsz.size = bufsize; + + return hfi_session_set_property(inst, ptype, &bufsz); +} +EXPORT_SYMBOL_GPL(venus_helper_set_bufsize); + static void delayed_process_buf_func(struct work_struct *work) { struct venus_buffer *buf, *n; diff --git a/drivers/media/platform/qcom/venus/helpers.h b/drivers/media/platform/qcom/venus/helpers.h index 52b961ed491e..cd306bd8978f 100644 --- a/drivers/media/platform/qcom/venus/helpers.h +++ b/drivers/media/platform/qcom/venus/helpers.h @@ -41,6 +41,7 @@ int venus_helper_set_num_bufs(struct venus_inst *inst, unsigned int input_bufs, unsigned int output_bufs); int venus_helper_set_color_format(struct venus_inst *inst, u32 fmt); int venus_helper_set_dyn_bufmode(struct venus_inst *inst); +int venus_helper_set_bufsize(struct venus_inst *inst, u32 bufsize, u32 buftype); void venus_helper_acquire_buf_ref(struct vb2_v4l2_buffer *vbuf); void venus_helper_release_buf_ref(struct venus_inst *inst, unsigned int idx); void venus_helper_init_instance(struct venus_inst *inst); diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index 92669a358a90..eae9c651ac91 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -710,7 +710,6 @@ static int vdec_start_streaming(struct vb2_queue *q, unsigned int count) { struct venus_inst *inst = vb2_get_drv_priv(q); struct venus_core *core = inst->core; - u32 ptype; int ret; mutex_lock(&inst->lock); @@ -740,13 +739,8 @@ static int vdec_start_streaming(struct vb2_queue *q, unsigned int count) goto deinit_sess; if (core->res->hfi_version == HFI_VERSION_3XX) { - struct hfi_buffer_size_actual buf_sz; - - ptype = HFI_PROPERTY_PARAM_BUFFER_SIZE_ACTUAL; - buf_sz.type = HFI_BUFFER_OUTPUT; - buf_sz.size = inst->output_buf_size; - - ret = hfi_session_set_property(inst, ptype, &buf_sz); + ret = venus_helper_set_bufsize(inst, inst->output_buf_size, + HFI_BUFFER_OUTPUT); if (ret) goto deinit_sess; } From patchwork Wed Jun 27 15:27:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 140338 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1026119ljj; Wed, 27 Jun 2018 08:29:49 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLEVmTw7rtVeyCmku1FPvV+vzOuxbmw2MJFpcAcJzeY/d/Irvzj17EqkwX5ea/iavFGuWwE X-Received: by 2002:a17:902:8b86:: with SMTP id ay6-v6mr6631744plb.295.1530113389417; Wed, 27 Jun 2018 08:29:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530113389; cv=none; d=google.com; s=arc-20160816; b=D68CfPHQYGP1hD9nUkATm7Nf6S8epdZ2d8DuzGrVOIXkpvVsILz0RJmwMEL2dV1dt3 L/7qfsNoWn/Jnz9/1mZV1HO3D6tdDxWQMD4ZImiJm/i1hj2NWbWe24S58jgbYQqW1zsD c8bDTIg+thoan77UPcqPLcTgoOVxyFm+iFfjlCPmfaXVVC5Ddh9B04+7Eq5CgpnIp71R 6KKza7E3T2nen4u1K/I+7tC2CyJej5FTtlO9x3MHfZBYNCMw3f6KFMFKl7oRpziHoeKn BpziYSiBkUktpr2C2Wh60Uf76TWPuxfflm8RHHVp2uPSEVxP4ZuHtvK6tioisy3w/fXW BpFA== 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=fvphImxtYi/pZ1ibjMA94jz0O9EQMA8I8Ho1rpQimyE=; b=eX5lD6HwY3AKrBL01MUTdHJHLSpz8RcVNmPWd8p7h5uCzzNzr1OJwN45dCm2tv8wJF h2yyJCMlRocnPud9aqbAL/UoEnlAumK6fNflBp3F/zPizQIYHym2JowKHinM4szBgDO2 UuJFCeuH2Z/UoohdVdWtQ57VJTIpf9b5ARXGI1OL5AHBv2EtU2kIV+lDnkSnNs9aCXtl jaIMx0jbPtkzHBhTu3oa6yFqa/YK8KcpaU7CdoMoU1A14FEweet8TYXWB+txQuCqW9dF Cr8TyLI99imQnXFHWSoslD38iw3V3V+LXWI521r2eFKwoMVGR8MDarfoqLz1VQV+AnDQ NuIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="TAAX/5OY"; 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 b8-v6si4191721plm.202.2018.06.27.08.29.49; Wed, 27 Jun 2018 08:29:49 -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="TAAX/5OY"; 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 S934703AbeF0P20 (ORCPT + 4 others); Wed, 27 Jun 2018 11:28:26 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:40622 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934927AbeF0P2S (ORCPT ); Wed, 27 Jun 2018 11:28:18 -0400 Received: by mail-wm0-f68.google.com with SMTP id z13-v6so5959400wma.5 for ; Wed, 27 Jun 2018 08:28: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=fvphImxtYi/pZ1ibjMA94jz0O9EQMA8I8Ho1rpQimyE=; b=TAAX/5OYls5Fb0SufmcRtV9BCLZDMhjfq6rk4sT3ISDsixoLsOlZl4RfzQg6EcsP08 H+VIGGABSI7FjgXUwRebaY42+zFFBA4X70pVAa4zh/pJXZRcR78HjzpmX9FDLMkgCuxG syjXSAKCErqIe/1T+JPq4iahU/lmNXUae23gs= 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=fvphImxtYi/pZ1ibjMA94jz0O9EQMA8I8Ho1rpQimyE=; b=eyviKG/PpdhZARKnyN799U83RvQeXog3FEDyS82nzx0Q6Fi9vo+MTIQL7t6A4TWpQI 39yRQbfOd9f+41REjQHFLmpjuTyAYVoLFQWC++V5jj35bMvy1/8t4UIDwAYFmazMbZku ys7fa+FBaQWWTDko3T9dXVYgySUQHpZnzWLuulIwWrunFo2kJHvXN5ED9GW59luhXrde Z+ILFEVRfkrcGNPIqUQsVFrqT2JmkJ9dt9ZO6gQUdA0ju18CoGYHcJKaofmOkqIendy5 1poiGE/RxUrYGIfA3tn3IMsNNn+7bqN8PzcMtDZHsRrw/6uWBxWAIMASWeW6ipFz1/Id rqsg== X-Gm-Message-State: APt69E1ZugDaeu3rjc+rX/p7aEf1YvuAqpV0CQfhygr+kpHt3n2Sq6qV R2QCsXzBLZlmdrLSSMhXKQYzXg== X-Received: by 2002:a1c:78b:: with SMTP id 133-v6mr5669838wmh.59.1530113297475; Wed, 27 Jun 2018 08:28:17 -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.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Jun 2018 08:28:16 -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 16/27] venus: core: delete not used buffer mode flags Date: Wed, 27 Jun 2018 18:27:14 +0300 Message-Id: <20180627152725.9783-17-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 Delete not used flag for capture buffer allocation mode and no longer used cap_bufs_mode_dynamic from instance structure. Signed-off-by: Stanimir Varbanov Reviewed-by: Tomasz Figa --- drivers/media/platform/qcom/venus/core.h | 4 ---- drivers/media/platform/qcom/venus/hfi_parser.c | 11 +++-------- 2 files changed, 3 insertions(+), 12 deletions(-) -- 2.14.1 diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h index b995d1601c87..1d1a59a5d343 100644 --- a/drivers/media/platform/qcom/venus/core.h +++ b/drivers/media/platform/qcom/venus/core.h @@ -255,8 +255,6 @@ struct venus_buffer { * @priv: a private for HFI operations callbacks * @session_type: the type of the session (decoder or encoder) * @hprop: a union used as a holder by get property - * @cap_bufs_mode_static: buffers allocation mode capability - * @cap_bufs_mode_dynamic: buffers allocation mode capability */ struct venus_inst { struct list_head list; @@ -305,8 +303,6 @@ struct venus_inst { const struct hfi_inst_ops *ops; u32 session_type; union hfi_get_property hprop; - bool cap_bufs_mode_static; - bool cap_bufs_mode_dynamic; }; #define IS_V1(core) ((core)->res->hfi_version == HFI_VERSION_1XX) diff --git a/drivers/media/platform/qcom/venus/hfi_parser.c b/drivers/media/platform/qcom/venus/hfi_parser.c index 8d284cfbba7a..5f1aedc0ef5a 100644 --- a/drivers/media/platform/qcom/venus/hfi_parser.c +++ b/drivers/media/platform/qcom/venus/hfi_parser.c @@ -60,8 +60,7 @@ fill_buf_mode(struct venus_caps *cap, const void *data, unsigned int num) } static void -parse_alloc_mode(struct venus_core *core, struct venus_inst *inst, u32 codecs, - u32 domain, void *data) +parse_alloc_mode(struct venus_core *core, u32 codecs, u32 domain, void *data) { struct hfi_buffer_alloc_mode_supported *mode = data; u32 num_entries = mode->num_entries; @@ -74,13 +73,9 @@ parse_alloc_mode(struct venus_core *core, struct venus_inst *inst, u32 codecs, while (num_entries--) { if (mode->buffer_type == HFI_BUFFER_OUTPUT || - mode->buffer_type == HFI_BUFFER_OUTPUT2) { - if (*type == HFI_BUFFER_MODE_DYNAMIC && inst) - inst->cap_bufs_mode_dynamic = true; - + mode->buffer_type == HFI_BUFFER_OUTPUT2) for_each_codec(core->caps, ARRAY_SIZE(core->caps), codecs, domain, fill_buf_mode, type, 1); - } type++; } @@ -267,7 +262,7 @@ u32 hfi_parser(struct venus_core *core, struct venus_inst *inst, parse_profile_level(core, codecs, domain, data); break; case HFI_PROPERTY_PARAM_BUFFER_ALLOC_MODE_SUPPORTED: - parse_alloc_mode(core, inst, codecs, domain, data); + parse_alloc_mode(core, codecs, domain, data); break; default: break; From patchwork Wed Jun 27 15:27:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 140345 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1028060ljj; Wed, 27 Jun 2018 08:31:14 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcl7nbEDeMeVJVd7GFX7XOmZlr1gOayBAIQg1BCdfLt3KUoYLm+A4XoYSs8Qesv0gFV7p3A X-Received: by 2002:a62:820a:: with SMTP id w10-v6mr6233500pfd.71.1530113474621; Wed, 27 Jun 2018 08:31:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530113474; cv=none; d=google.com; s=arc-20160816; b=p+G7eK6QH7Dq1Nr/m0xM5dvn684+KxqMEK880+hJIkuj99Z0rS5p8rmkxLdeTfPwU6 rR7sPg+xs+8Y82qUTCCyHXrAl/i7U/TP9FKztp//4BUVz0kFdzjPi8MqUlyBfo3rKs2t nQRIjzV62PiIpkIk202Io26HmjYcuQaDN6DeGSKEXq8SGl3zo1e0iZON/eh5VHL6DZgE sws6CZulVcUXHhCtVwRTTquOPeV58AIeKkQPjHUj9xnFC29hpwoiXguLYF5YnoaeRYgG +Y8eMUIHAKHIkCV5m/w9hzmbxIFLLAjB3KTbn2T7jIDLfwK46a7GJc96C7JRbakLXCXj kUyg== 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=dBNFMYHtBk25cq657W5saatgm8VT3r2BxDc+quPr6ks=; b=P64Zzceh3MHPkiV2cghuLjMNT5hXVVAeaY8RpHPxdW1wNUzLw1y1aD+vPdMcKfCVRG 4IPC5z1Cusq9al0kk3FF+7SSJCQnQNz3kgv0yXcSsxsCwLWhP0IBfaNlHRhPvJfSNtZY uf5iapDf1qQcLCJ1JO9nrIZeY0D36NHBcvts4BImNloJFDRUoR7e5UTkeipHd4CgFfde 8dFO7g9O3Y7zB90r0zmei9W6CbozFya5/GeamLVwPCXgiGxIxhXKyxue7JfDbVA8jreQ ZjO5Sp33Npqu+MWXXbDs4XuYL/bOE8JVW216n/8PDmRu2DMqggzR2bVA09Sp1XjIaXSQ Shyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="PAX/j7JN"; 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 g5-v6si3819352pgp.91.2018.06.27.08.31.14; Wed, 27 Jun 2018 08:31:14 -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="PAX/j7JN"; 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 S965578AbeF0PbL (ORCPT + 4 others); Wed, 27 Jun 2018 11:31:11 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:56072 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934938AbeF0P2V (ORCPT ); Wed, 27 Jun 2018 11:28:21 -0400 Received: by mail-wm0-f66.google.com with SMTP id v16-v6so6340635wmv.5 for ; Wed, 27 Jun 2018 08:28:20 -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=dBNFMYHtBk25cq657W5saatgm8VT3r2BxDc+quPr6ks=; b=PAX/j7JN8AxISUMxyJyg51rqePRavoKFk9K917ZcvsOszrJJWk5qqfB6t8SzWmAlcd ECUN2FQ+m9JZ7/3JfrB9+Y5CIgVJ5bZ8gHn9tzvFej1xW1sZG3lQfdWrBsKyM6wY+dGt Erzpmy9rGRAQzuPFO43CkRegVJejuSnvEkNoI= 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=dBNFMYHtBk25cq657W5saatgm8VT3r2BxDc+quPr6ks=; b=CH0AeDs3xgHaqrqKT0mev1V9/Zghi+5lADd3Lar2MKgtUHJVUxaLPPRJv2SQVjksO8 WsobwVZhHw/Ay+2BD3uwRjquZaKjP1IBave4TLfs2YLUnygIyw59fJ4uF3+DpiQt2+pi /xb06n9bHRaC4+dV9TNqAzWCoGrPDpp/miD0ZKfHXrQospNORlx8KTvR8beHkdO8Wa6C lBSBNMdW3WHqLT+Jp/mvHlJOvFG1S3j0YQpqvZ/e2ljewv7RWHhLZ4RFYUqEMquDMbz2 5IawyKQEuIrSXEHQUUPmMxMka0IP7gv7FxFN0p0BToalU3VZdmcR0In9zT2/ujvKPAWR 96Eg== X-Gm-Message-State: APt69E2Wwe8zKC2WkkaaFzNqr3W6bMm53zhGLfCd4G2fSkmxIUwi1qD3 TfcA/6RDcqec42f8hWh56HNddA== X-Received: by 2002:a1c:aa12:: with SMTP id t18-v6mr5219571wme.54.1530113299674; Wed, 27 Jun 2018 08:28:19 -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.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Jun 2018 08:28:19 -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 18/27] venus: helpers: add a new helper to set raw format Date: Wed, 27 Jun 2018 18:27:16 +0300 Message-Id: <20180627152725.9783-19-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 The new helper will has one more argument for buffer type, that way the decoder can configure the format on it's secondary output. Signed-off-by: Stanimir Varbanov Reviewed-by: Tomasz Figa --- drivers/media/platform/qcom/venus/helpers.c | 52 ++++++++++++++++++----------- drivers/media/platform/qcom/venus/helpers.h | 2 ++ 2 files changed, 35 insertions(+), 19 deletions(-) -- 2.14.1 diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c index 2eeb243e4dbe..a1590d5cc921 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -407,6 +407,20 @@ static int session_register_bufs(struct venus_inst *inst) return ret; } +static u32 to_hfi_raw_fmt(u32 v4l2_fmt) +{ + switch (v4l2_fmt) { + case V4L2_PIX_FMT_NV12: + return HFI_COLOR_FORMAT_NV12; + case V4L2_PIX_FMT_NV21: + return HFI_COLOR_FORMAT_NV21; + default: + break; + } + + return 0; +} + int venus_helper_get_bufreq(struct venus_inst *inst, u32 type, struct hfi_buffer_requirements *req) { @@ -488,35 +502,35 @@ int venus_helper_set_num_bufs(struct venus_inst *inst, unsigned int input_bufs, } EXPORT_SYMBOL_GPL(venus_helper_set_num_bufs); -int venus_helper_set_color_format(struct venus_inst *inst, u32 pixfmt) +int venus_helper_set_raw_format(struct venus_inst *inst, u32 hfi_format, + u32 buftype) { - struct hfi_uncompressed_format_select fmt; u32 ptype = HFI_PROPERTY_PARAM_UNCOMPRESSED_FORMAT_SELECT; - int ret; + struct hfi_uncompressed_format_select fmt; + + fmt.buffer_type = buftype; + fmt.format = hfi_format; + + return hfi_session_set_property(inst, ptype, &fmt); +} +EXPORT_SYMBOL_GPL(venus_helper_set_raw_format); + +int venus_helper_set_color_format(struct venus_inst *inst, u32 pixfmt) +{ + u32 hfi_format, buftype; if (inst->session_type == VIDC_SESSION_TYPE_DEC) - fmt.buffer_type = HFI_BUFFER_OUTPUT; + buftype = HFI_BUFFER_OUTPUT; else if (inst->session_type == VIDC_SESSION_TYPE_ENC) - fmt.buffer_type = HFI_BUFFER_INPUT; + buftype = HFI_BUFFER_INPUT; else return -EINVAL; - switch (pixfmt) { - case V4L2_PIX_FMT_NV12: - fmt.format = HFI_COLOR_FORMAT_NV12; - break; - case V4L2_PIX_FMT_NV21: - fmt.format = HFI_COLOR_FORMAT_NV21; - break; - default: + hfi_format = to_hfi_raw_fmt(pixfmt); + if (!hfi_format) return -EINVAL; - } - ret = hfi_session_set_property(inst, ptype, &fmt); - if (ret) - return ret; - - return 0; + return venus_helper_set_raw_format(inst, hfi_format, buftype); } EXPORT_SYMBOL_GPL(venus_helper_set_color_format); diff --git a/drivers/media/platform/qcom/venus/helpers.h b/drivers/media/platform/qcom/venus/helpers.h index 0de9989adcdb..79af7845efbd 100644 --- a/drivers/media/platform/qcom/venus/helpers.h +++ b/drivers/media/platform/qcom/venus/helpers.h @@ -40,6 +40,8 @@ int venus_helper_set_output_resolution(struct venus_inst *inst, u32 buftype); int venus_helper_set_num_bufs(struct venus_inst *inst, unsigned int input_bufs, unsigned int output_bufs); +int venus_helper_set_raw_format(struct venus_inst *inst, u32 hfi_format, + u32 buftype); int venus_helper_set_color_format(struct venus_inst *inst, u32 fmt); int venus_helper_set_dyn_bufmode(struct venus_inst *inst); int venus_helper_set_bufsize(struct venus_inst *inst, u32 bufsize, u32 buftype); From patchwork Wed Jun 27 15:27:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 140335 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1025195ljj; Wed, 27 Jun 2018 08:28:56 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe1WW1M2vwiE2RbGiVHsbFXEr3q1mw18e5e3f/ejmgyWg1sCPm86O5IoHym9Gat6E5sgk1u X-Received: by 2002:a62:4715:: with SMTP id u21-v6mr6376444pfa.89.1530113336665; Wed, 27 Jun 2018 08:28:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530113336; cv=none; d=google.com; s=arc-20160816; b=sT995MyzdOwavAVRlI7Mr78RNzO5tlO9BtmGTvCrCUVkH3Iax6+6QydeLSxE9Cf34V Q4TXtnOWKlYqgKiOTjRXjqRUGmkefc3vJQ0R8eW6GdzRfP8SZWIjprZDuAhBTFYuP9r+ jVizxHjqziZ2y6LpTHamBfg/Td2yVg7qE0C73++z6MxFZ+5UXLGDHaqywFWhYyD70vtb MrAsf/1LebU4xdzTeUDZQ0Mfd+lWvRJrKZtFpuhUZtpjDIM0NmyKYGiU39Cjd176vaI9 qwE7iYGybmEqWREKwyjoT7tkMC7J0MOgT09UDAQ0YIMlF6PF5nLJHNQLE1HQ/sDPivGo 9P7Q== 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=/ThhxevIU3epv9lgxlCyqJq5OSMzAnmUAMY3rX7cEds=; b=qxitARgZJpYsdHIxMg/r/lmuENXpfaxrF8SFDH0GZov9wp+mpwz6U/HSmPFknqxoex aboBmhXp9J+Rnfru50DI0wFcE8xyRhZJkJUyF2k3LsnkhlkkA9fzIIuL3lDx1Q8jJcJD WBBeoMUoW3Jc4hczrhAiTPFLf18ESzw/pKulNzwGFxZRHofM8U//hhhX81TjdcXQCP23 xFQ2P4S00TFLJUr/36PH34izApxJi96Yye/9Sl6X1Tzsm4jNyG/K2yKNUAQp0VR5bTBU Z/gAwmSxXyAToe5v34ofQENRUR6TBbyxeIUYLf4Bs362CHwQTOBvsN3BLkVszwEcV4rV 0Mbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kqKttLXt; 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 bj12-v6si4052316plb.137.2018.06.27.08.28.56; Wed, 27 Jun 2018 08:28:56 -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=kqKttLXt; 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 S965451AbeF0P2z (ORCPT + 4 others); Wed, 27 Jun 2018 11:28:55 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:45631 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965307AbeF0P23 (ORCPT ); Wed, 27 Jun 2018 11:28:29 -0400 Received: by mail-wr0-f193.google.com with SMTP id u7-v6so2464556wrn.12 for ; Wed, 27 Jun 2018 08:28:29 -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=/ThhxevIU3epv9lgxlCyqJq5OSMzAnmUAMY3rX7cEds=; b=kqKttLXtWlwynBGpetiSwDEInrvnGlExomqQ0eXXLx75B7dByD8TUBFz9yH3AvtO6o Oa561AwyMYsTR+3nEkbz4X/yVdnwMF9wWcL4gomFwhKERK3dxebO72DRrljqYy4jRt6E k28iDwZEbrkbol3gjFIwuM0wpgJ61K377uZTo= 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=/ThhxevIU3epv9lgxlCyqJq5OSMzAnmUAMY3rX7cEds=; b=QU9CFlDOxuY4HcxC1rcy4mFdCa70K5pOt0rB0pDDY/k+jCs4P7mhThJIhyJ61gYOV2 Jv48sT64sQOVAuetfWPfqW9B0NHxyakg0mvhFqhh53DJ9ZwA+A5VfI6KC+3g15bZVax9 0Jojbl4q2YXm2/Bx4qCisU+zFi3HyIEOi0B9bvXQZ4ewQkvwh3A9wj+L3nmMZX0ZkowD 1RQWUUfG1xpByV4FhXNDeLpdPoPuryKjwfn8pxb+lek6DKQUTCDnqg9a8QI9MMllGJ1u 5RVu0cVT2lb9/ksb71zEZqV2cbe1F/MB0V7yp58okhG08OF54AsNbZRM7/uMU6OZqv0g fa5g== X-Gm-Message-State: APt69E1uJaWshX1pS8Pkif3dR8Ek64kDgNEoLn/nEhcTLLjHREFTgsPA JbZMxWMKfnFafHpRdMQsjWLCwg== X-Received: by 2002:adf:83c5:: with SMTP id 63-v6mr5421441wre.220.1530113308623; Wed, 27 Jun 2018 08:28:28 -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.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Jun 2018 08:28:28 -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 26/27] venus: core: add sdm845 DT compatible and resource data Date: Wed, 27 Jun 2018 18:27:24 +0300 Message-Id: <20180627152725.9783-27-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 sdm845 DT compatible string with it's resource data table. Signed-off-by: Stanimir Varbanov Reviewed-by: Rob Herring --- .../devicetree/bindings/media/qcom,venus.txt | 1 + drivers/media/platform/qcom/venus/core.c | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) -- 2.14.1 diff --git a/Documentation/devicetree/bindings/media/qcom,venus.txt b/Documentation/devicetree/bindings/media/qcom,venus.txt index 2693449daf73..00d0d1bf7647 100644 --- a/Documentation/devicetree/bindings/media/qcom,venus.txt +++ b/Documentation/devicetree/bindings/media/qcom,venus.txt @@ -6,6 +6,7 @@ Definition: Value should contain one of: - "qcom,msm8916-venus" - "qcom,msm8996-venus" + - "qcom,sdm845-venus" - reg: Usage: required Value type: diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index 381bfdd688db..bb6add9d340e 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -450,9 +450,31 @@ static const struct venus_resources msm8996_res = { .fwname = "qcom/venus-4.2/venus.mdt", }; +static const struct freq_tbl sdm845_freq_table[] = { + { 1944000, 380000000 }, /* 4k UHD @ 60 */ + { 972000, 320000000 }, /* 4k UHD @ 30 */ + { 489600, 200000000 }, /* 1080p @ 60 */ + { 244800, 100000000 }, /* 1080p @ 30 */ +}; + +static const struct venus_resources sdm845_res = { + .freq_tbl = sdm845_freq_table, + .freq_tbl_size = ARRAY_SIZE(sdm845_freq_table), + .clks = {"core", "iface", "bus" }, + .clks_num = 3, + .max_load = 2563200, + .hfi_version = HFI_VERSION_4XX, + .vmem_id = VIDC_RESOURCE_NONE, + .vmem_size = 0, + .vmem_addr = 0, + .dma_mask = 0xe0000000 - 1, + .fwname = "qcom/venus-5.2/venus.mdt", +}; + static const struct of_device_id venus_dt_match[] = { { .compatible = "qcom,msm8916-venus", .data = &msm8916_res, }, { .compatible = "qcom,msm8996-venus", .data = &msm8996_res, }, + { .compatible = "qcom,sdm845-venus", .data = &sdm845_res, }, { } }; MODULE_DEVICE_TABLE(of, venus_dt_match);