From patchwork Thu Jul 5 13:03:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 141121 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1918433ljj; Thu, 5 Jul 2018 06:05:17 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfp93Wzuynl9NDp/moChAz0R7XdUeEl0UnAbCigSjLiNJrhNATqV0ylZM7m00warcksFfr+ X-Received: by 2002:a63:5d58:: with SMTP id o24-v6mr3930910pgm.349.1530795917783; Thu, 05 Jul 2018 06:05:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530795917; cv=none; d=google.com; s=arc-20160816; b=x30pX2dT3p28RcqymNlqLvaUfdKLJzCxCbqs4Aj9IB2ZhuXTZEx/1IMOEC3VeGJBPn s7+u8hbtqVgASx9Ch37JJ6pcCuvbJnqGsZuJWRLC3r1LmsmD4/L/E3+0CbYJozWvPMIn BPAb9jvww+/R4sIrnbjODESgi1RCxsgeX5tci9aN05HtSoWoe4CTKwVww5dD1M3mXUUn 9G/bz6ZlmZp63JUIwcVLS5BNoO/ZqSI702alNik5zP7WZ28ElKISaeew668ss8YCpCY5 heZDwbv4WWpZ6Oc2r1GWhPoBkcZLRJ9j4TqTDMrgbxWhD76Tv/VFHcq45PeFRnvFO4Z1 kB/A== 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=UbbCiS2ZSioyflwFOss9DFknPjYZ/K+XcX6tzEfA1sYmtSEM9WzpBJ8JgR9yMESzHn f7K9VCsh2rEj9n/aUzAB3GM31QLwQKAS1x9ejd1xofBIrrzD0Mvs/xG5xNdYH5cOqP1s Vxt0ZbgvrsAJ8ahaNYNc58aPXdNyklLWC0n8pUxCmFp9NGxygFvCTaARs4PlyqjmLKdp kC08ZflFZOWwBqTiKIlmlWgO+LCi6ugiVvqDXitsmzVquqi1NN6LABGBVLpSi3yZ7QYz rAjJsA7tZ7PmO9RvPbUTqSslk2JAvvdxvTC5vsVRbfsu2qZ1NsW/yxJc3Hkq7tLs0isF KmCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Sxjl44Ch; 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 a10-v6si6165265pln.349.2018.07.05.06.05.17; Thu, 05 Jul 2018 06:05:17 -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=Sxjl44Ch; 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 S1754312AbeGENFQ (ORCPT + 4 others); Thu, 5 Jul 2018 09:05:16 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:33745 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754172AbeGENFO (ORCPT ); Thu, 5 Jul 2018 09:05:14 -0400 Received: by mail-wr1-f66.google.com with SMTP id k7-v6so1138787wrq.0 for ; Thu, 05 Jul 2018 06:05:13 -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=Sxjl44ChUU1xaGXSh8Zizx2qkhpkRjvpO2dUOD8sZkgIzziO8yyJWCtA0t0+W+sY+G 9pj+GSf3MHPK4+mHXAbo1BbgfXg+6zX61J6+iDgXmNEK6Lt3NAvvSFNtpvPbxsdhLp5q 9RXkA8w1oaXus0qQ9ebprLlzb6lHUQu5avSsw= 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=eLJPfHXdhOAx3LkrgBlABDG0Jn9o6l3KsW99cYmBeWreNsb6VhHK1H68cMVhQGev0a cQ35ppxA1eaEpDGWlEy4rnrmk0p/CFSxBIelCxCp5nXuqRt/jOvSw8+o+pUscqKRRp8s tTJ8dJXYpk8EfJo69Km6SoPGvKuDcQfMvxlNE0+N8s6yfnU/vtr6MPd25d6YpdM3IQa9 Hxvqj7m/xwyQKOVrC3pOrPPte0Lo4027NGaALU8F0zwnOSEuJjdGEJyo2rtlgysVA7+O 1E8p+bXSqccg0i15HDXSizZJYsdPUSqt5mOZPyJIXYfqyoniGswlzg5oU/JSB6qq3eCy /8Yg== X-Gm-Message-State: APt69E0Gezu280dEUVMEwHDVgFvoh+yb2xy4ntgGuUfswK3ZLqZoOtlY cBH6tyT4Ndy1MI+f7fS9hH7smA== X-Received: by 2002:adf:e9c1:: with SMTP id l1-v6mr4308779wrn.14.1530795913157; Thu, 05 Jul 2018 06:05:13 -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.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Jul 2018 06:05:12 -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 06/27] venus: hfi: handle buffer output2 type as well Date: Thu, 5 Jul 2018 16:03:40 +0300 Message-Id: <20180705130401.24315-7-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-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 Thu Jul 5 13:03:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 141140 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1927427ljj; Thu, 5 Jul 2018 06:13:16 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcurzIFa4n7k4iSmj2ajEQYwspbUvMfSjIDS4Q3v7oNQLCCXsG3xGL64VP6K38udY8O/7J8 X-Received: by 2002:a17:902:1025:: with SMTP id b34-v6mr6049711pla.112.1530796396142; Thu, 05 Jul 2018 06:13:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530796396; cv=none; d=google.com; s=arc-20160816; b=jzHaNcOEXaBDAvBFC1zZTXwShEVGRUyAkWBCr/i3dyoN1z5YHJHMHugJTKLeKJSzC5 y7diR36Ia3QhyI03ylt5eOIhK7EVZ58N+769sAEfvQx8+9UBSL55eCqf1aCrka5nLBTy FXFtT4abt3raRJq21juUqZKI1QSQc4nL9c8GNrC0hIGchepS+W2zUt9HAlzm6GxwORoe qFB7cc9xOwPMCAQV/Lz0RCHe3fRbzplalW3yagmU0Et0AtjaMZ9tINZtOlI0PRgRoDP3 HRlKcOcXdJBb+7Ntk5iF/w/TMzVokAVNM6gO8jXbNSj8MCOQozDFcPBvBszbrbulUPCY Vv5Q== 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=iP3OBq3KmmkdIHc4ClU6RmJI5t+xyWo9eNZ9y9WZFKg=; b=ifsHTGTOUfh2Z/wE4bHWPX/j94TnRjcZny+LcJCMw3nBmp6UeFARfQRFyAJjreXx0U UMTF4act53dsepevkghLpQhOkRys2ivMzDm5SmP3i240DsYlc6aOzzITi9A1iANbKZ/q Bk6rjtkQ2fas8r+k59ZCQOQtufaY2VldV3zn/N3xRgcGd5P9sRab9jnf9rTD0mME/M5E S9hPOjs7oh76AQV7e/rHphJ985akQl6kYCFLSpGuRmHDFQNEHKrhe7mRsi2SCCaeC/Zl 5eCq0dQWyXD9P4rdmIJ8yYEBvLxwH8/p71gjBanHJbmHleVsAFKaXtLi1od4K0hz/t/Z gtMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Wj6BqHz/"; 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 i126-v6si6238004pfc.296.2018.07.05.06.13.15; Thu, 05 Jul 2018 06:13: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="Wj6BqHz/"; 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 S1754576AbeGENNO (ORCPT + 4 others); Thu, 5 Jul 2018 09:13:14 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:55011 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754335AbeGENFR (ORCPT ); Thu, 5 Jul 2018 09:05:17 -0400 Received: by mail-wm0-f65.google.com with SMTP id i139-v6so10961048wmf.4 for ; Thu, 05 Jul 2018 06:05:17 -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=iP3OBq3KmmkdIHc4ClU6RmJI5t+xyWo9eNZ9y9WZFKg=; b=Wj6BqHz/6uOQqXGNAt2gEk12LfFBh7wTeo9oNw+TI7HVV8kPdabQPXSDfI7+6xIULm ue16H3oK6OGpUcjRcKtWigD0+2PESCrGgR3vvwFgIRWzFYlVZA/a0J2BrsWrLSNNRe7W j/W87PrKAMJT285Dv8ZsNM8TXS2/iGeReEIBc= 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=iP3OBq3KmmkdIHc4ClU6RmJI5t+xyWo9eNZ9y9WZFKg=; b=SCEQixOnsXUy9WbYkSJFpZEkT+xSe7hZ0Kyi6VnHAMRx5GWif2MC7XnmGCrBZ3P2+X lFCXncGVc/HYqivb1wL5f5vqwI+yXPhAXRcd+BwYvvOt5GyLUgxVXj8cLH3itB7nRuU0 idR+RTT63hyqujdvJYNOtYsFeIr82tocFbtrzyMrCRM0DDTxxHGGsycLAGsCH7ygqRoP BTwv3mfwqHF5D5oXLZTKqSl+H1YOam1ERoYwflNlvMw/nI7EXZsEqyvMCV3+TCtQ8T3B ljdYJeY2Ljr16uN4O4kzIPZVZTulrGhJffK17LoMLfQgv22i86PuQgQbKf3kmavPnPXZ 7DJA== X-Gm-Message-State: APt69E2mLOm+RleshR/QOsPm4cJR2jox4Fsp/BmMcM046LL3Hnf55kqk 1s/LpRpNBhcOi26zvKDgbiuPUw== X-Received: by 2002:adf:c00b:: with SMTP id z11-v6mr4394146wre.268.1530795916640; Thu, 05 Jul 2018 06:05:16 -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.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Jul 2018 06:05: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 , Alexandre Courbot , Stanimir Varbanov Subject: [PATCH v5 09/27] venus: hfi_venus: move set of default properties to core init Date: Thu, 5 Jul 2018 16:03:43 +0300 Message-Id: <20180705130401.24315-10-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-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org This moves setting of default properties (firmware debug, idle indicator and low power mode) from session init to core init. All of those properties are need to be enabled/disabled early so that they could be used before the clients are even initialized. The other reason is to set idle indicator property early before we enter into venus_suspend function where we need to check for ARM9 WFI. Signed-off-by: Stanimir Varbanov Reviewed-by: Tomasz Figa --- drivers/media/platform/qcom/venus/hfi_venus.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 2.14.1 diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c index 72a8547eab39..7a83e967a8ea 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -1091,6 +1091,10 @@ static int venus_core_init(struct venus_core *core) if (ret) dev_warn(dev, "failed to send image version pkt to fw\n"); + ret = venus_sys_set_default_properties(hdev); + if (ret) + return ret; + return 0; } @@ -1135,10 +1139,6 @@ static int venus_session_init(struct venus_inst *inst, u32 session_type, struct hfi_session_init_pkt pkt; int ret; - ret = venus_sys_set_default_properties(hdev); - if (ret) - return ret; - ret = pkt_session_init(&pkt, inst, session_type, codec); if (ret) goto err; From patchwork Thu Jul 5 13:03:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 141123 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1918731ljj; Thu, 5 Jul 2018 06:05:31 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeQUnI/zes9hyU0xzhRV7/zydqtJJ+y9PvRJcSqs7g3mJOCFAW7kpunUOvLf3dEwUSoTT7T X-Received: by 2002:a17:902:d692:: with SMTP id v18-v6mr6181573ply.59.1530795931083; Thu, 05 Jul 2018 06:05:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530795931; cv=none; d=google.com; s=arc-20160816; b=rUsbm3SmelfamAWUotM8tKQEymOpHLGrOyf8wU+SRu3uWgom0w0KAppgjLiqX8JTkN poCxbgr8cEO68OT44canWJc5FE92sKhXhDgCnK/VMi/pfGcBYBXmbY8E0H0cz4T4qtnv HRFTUOQIVkJRs5UenSNyWlMKc5S3HxFZZcZ3RwvMFJj4I11YVcDnlTXUlCLutDEYUNz9 zceJDXsYMn/M07xzFNmFZDlKwDJSsoLueXoEBi+/edmr549nodao+l3aP+EaMGS8gyNV RBWrkBFWWFErbfapj9uUBebMztmcgjcgtmx+IAf1DdlSQ8HZFRDU5QV5c/TEFWSi/66s 7tYw== 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=m7EbUSCixlczjT8GRHqc9JZ/Q677zWmKsckfCGoGQ9s=; b=APeA3de85fOmWgqPFGLjDuNbGJSI8ffvNl9NRPvgMGD/GNmWX6jcG9To8db182A8lT 0yaJGZR6G56gfvfp0Ezc68Q7k8jjReHU2d45NxxRz0NbRBExsWU0SqNjJ+xG/mgGnOFV eo3zB/kLPKYeSQb+qISIMQDAO3eQAh0gYzm6/YWTnFL0TTQxZd7pIGMeEEcp3hZHghcK i98fhh6Ap0Hvk/4T47p4wNA8DoKcrQKgRnpg5vsGauD24Wlzf3fZiJ3VTyXCcC2s38iT 9YbvsDGcZRVe7YYUtV2Pkvka18X3Bb9qIWSsOEEfTpTF4dJ/94Gfi1ZzDk3F2bufGVDj uTag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UiKoYQI1; 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 p73-v6si6415628pfl.57.2018.07.05.06.05.30; Thu, 05 Jul 2018 06:05:31 -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=UiKoYQI1; 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 S1754462AbeGENF1 (ORCPT + 4 others); Thu, 5 Jul 2018 09:05:27 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:50235 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754364AbeGENFY (ORCPT ); Thu, 5 Jul 2018 09:05:24 -0400 Received: by mail-wm0-f66.google.com with SMTP id v25-v6so11042374wmc.0 for ; Thu, 05 Jul 2018 06:05:24 -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=m7EbUSCixlczjT8GRHqc9JZ/Q677zWmKsckfCGoGQ9s=; b=UiKoYQI1QtgF0V0kAasHM99HSqOqngH7Nzf/1EvOZfaESKoiVVO2BJmaT5UN5AdQym afCNwYoGoK+o3aDLoIQrzDNJzDozI7vp0MrZdGrn3HwGwKEQj2cCrFPL3vgpmU45H833 +ybF8XcA9/Vsjoy8g8me65S+0Xn0Yl3xDFmyc= 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=m7EbUSCixlczjT8GRHqc9JZ/Q677zWmKsckfCGoGQ9s=; b=mCPzbf4mDYiNuknS32JdW2tarWxumLVzb8q8IwvsKTWpcTg71jLAbHTW219t7vDzAm qBYob8+wTpESLqC6DYrADdrgqNyfDhbF/4XLcCdKTt3WVGyVtN2zDWOaoQSNhXfH2sS7 5LIMeUn5CygFVu7sQabLNyeLUcoZI2eEQucZRr8iTZ2bIPtEVwe8R09DkUK6lj5Ok809 egqUgtmMBOUlW8+48AaA1jvWdjvGNTsOSj3IkDDBX9TOPw7RwVpt8oKxxyHoOFoPNXuB xZcyVMQ5XrdTaPNYH1q4iIS5T1ESGii2Htc/a8WGXgUWsDDZW2ggPGih7tZIv587BGv4 d0Rg== X-Gm-Message-State: APt69E3NxmiZuuzrzCg6z1sd45a92KMu9jZ4LCrLV0SZDLTc2XX9ZUZZ pAklnEPG094R8LR+vFQV8jOKvA== X-Received: by 2002:adf:9485:: with SMTP id 5-v6mr4848877wrr.82.1530795923393; Thu, 05 Jul 2018 06:05:23 -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.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Jul 2018 06:05:22 -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 15/27] venus: helpers: add helper function to set actual buffer size Date: Thu, 5 Jul 2018 16:03:49 +0300 Message-Id: <20180705130401.24315-16-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-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 29cc84777125..6fd7458f390a 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -546,6 +546,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) +{ + const 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 c37779d82fec..d2a53c0eab86 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 Thu Jul 5 13:03:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 141130 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1920245ljj; Thu, 5 Jul 2018 06:06:45 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdyBxAW/He1ECWg3JDAVlj/KBTxs3sry48TrxM/9nzT5hOVoRcolWx/I7Uxma8sgKESP5jX X-Received: by 2002:a17:902:6b86:: with SMTP id p6-v6mr6170804plk.75.1530796005161; Thu, 05 Jul 2018 06:06:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530796005; cv=none; d=google.com; s=arc-20160816; b=INKK0wwLl29df6xLbxTNQsvJwbdWOY3P6D/5RS60LTcvunoaA+EZtZtVry9qA7oOHn JLuAmVVWZpV1/9ctGJI/KtktVG7EqjJ5vPKnOng2bjxzg/NdjNc8wxWb1+l9CxmfsN6F 6N7h4jZ6PxC70W9xWqA++GAtRVuZZsm/WFqhAxACRB/v7pCw/3ySPLWLvADiN5FbS3XE hZxacxM8B0xG+yczAl2NYH8sidShlUetUZwoFnhYRs2are/oE2HI89w13lodK6qebQZs y634GMcM2ANIHFNPqiz9MgdVlfwApEjFaD3j6tQU81ubqRAF41i6dBe0BtpJcmDsXH6Y lRfQ== 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=rLJrcqwr+U5qiHZwf9V1nV8FSGGmPF39OlgIgvisi0Y=; b=A2zznUbjXUItk1hH08pOOLFspgTBStPhBY4tq8fLzi6Jr1wGeiteovrckHg1VV6siJ wVAy0IBIjNGsApRtUq9Nu/JgIhG9QWNwLbz+R45FKDJRdbkkAwgsDWL1q65rkkp1e7Hq U2GRLYl4/v/5jZgc4qW6+56hwThq8PN6z8QyIZ4M/F0vDKS7oNGNIqLA3sRWZtM0DQyV LOqSeG4QKHBMHxA7yqXNsKVOpM2wpPsGlbAPjoQZjjL9+HS7bwne08rmBoGARuFpv7NH 6kyS/t9wSsXH7L06Zc9FDeECCjNGGkmG/WTeACr+AIZXewEQAHcJwaP1BzZ/13ELlSGm zXcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=W8h3Sbse; 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 144-v6si5614291pge.406.2018.07.05.06.06.44; Thu, 05 Jul 2018 06:06:45 -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=W8h3Sbse; 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 S1754511AbeGENGm (ORCPT + 4 others); Thu, 5 Jul 2018 09:06:42 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:42515 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754514AbeGENFd (ORCPT ); Thu, 5 Jul 2018 09:05:33 -0400 Received: by mail-wr1-f68.google.com with SMTP id p1-v6so1140637wrs.9 for ; Thu, 05 Jul 2018 06:05:33 -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=rLJrcqwr+U5qiHZwf9V1nV8FSGGmPF39OlgIgvisi0Y=; b=W8h3Sbseb4M64faQQYVpYCbdPFDK2sCzxH6W9HJ/1gIxHkW8YGwfAHAf8xPw3KoPwA SPdtQITGN7GqvSXfP5Z1YpcALRpd6Toea1eNjgAUWbELsfj1yIc3B1EtVOF9b5y3U7FT zFU7coTLaWYJTwNZqPbZ88O85maTjP3EZbsMI= 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=rLJrcqwr+U5qiHZwf9V1nV8FSGGmPF39OlgIgvisi0Y=; b=c3FWclUJnYSCvYSUq+N6XnQk96s/wBBFeLvCMkDGX6FKn5kGuV8evjD6kv3Z/Ylvui HZW5s1mvv6qOzmnkbTfzae27eM5kjs0YNfbrvv3UNqkO/Pe5qaJrY9eeCnqbU0rlv4nD KbxrizeUug+ebou/Ik9EN/4YB9FNSTa6CZvw9gRrDSoz8SxPSCOnK8sHZTaG8xh+SNBb iuNnapOkjEYLyGh0sUumXs6/fdeV8LQbtbex8aXprzEXBBbj6XszXy3PWlksUu5YCiGX d1PIbUYJ3ZsZq9FgXhC5MuqFhD3fyuSL3jTYGzIIjj4SYrCDI9R/Ny9Fbx6By4stSp6H G4QQ== X-Gm-Message-State: APt69E3HXUMfB7zj8yqIZbuHYI2BzUsdw2P1uAZZPPhjkU2Egn/GQsuU MCmGMMCE85eQ41fKL7m9R1TyiA== X-Received: by 2002:adf:9f0f:: with SMTP id l15-v6mr4654445wrf.206.1530795932574; Thu, 05 Jul 2018 06:05:32 -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.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Jul 2018 06:05:32 -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 23/27] venus: vdec: a new function for output configuration Date: Thu, 5 Jul 2018 16:03:57 +0300 Message-Id: <20180705130401.24315-24-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-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Make a new function vdec_output_conf() for decoder output configuration. vdec_output_conf() will set properties via HFI interface related to the output configuration, and keep vdec_set_properties() which will set properties related to decoding parameters. Signed-off-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/vdec.c | 34 ++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 15 deletions(-) -- 2.14.1 diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index c98084f51e5e..11db3074d1a5 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -545,6 +545,22 @@ static const struct v4l2_ioctl_ops vdec_ioctl_ops = { static int vdec_set_properties(struct venus_inst *inst) { struct vdec_controls *ctr = &inst->controls.dec; + struct hfi_enable en = { .enable = 1 }; + u32 ptype; + int ret; + + if (ctr->post_loop_deb_mode) { + ptype = HFI_PROPERTY_CONFIG_VDEC_POST_LOOP_DEBLOCKER; + ret = hfi_session_set_property(inst, ptype, &en); + if (ret) + return ret; + } + + return 0; +} + +static int vdec_output_conf(struct venus_inst *inst) +{ struct venus_core *core = inst->core; struct hfi_enable en = { .enable = 1 }; u32 ptype; @@ -569,14 +585,6 @@ static int vdec_set_properties(struct venus_inst *inst) if (ret) return ret; - if (ctr->post_loop_deb_mode) { - ptype = HFI_PROPERTY_CONFIG_VDEC_POST_LOOP_DEBLOCKER; - en.enable = 1; - ret = hfi_session_set_property(inst, ptype, &en); - if (ret) - return ret; - } - return 0; } @@ -724,7 +732,6 @@ static int vdec_verify_conf(struct venus_inst *inst) 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; int ret; mutex_lock(&inst->lock); @@ -753,12 +760,9 @@ static int vdec_start_streaming(struct vb2_queue *q, unsigned int count) if (ret) goto deinit_sess; - if (core->res->hfi_version == HFI_VERSION_3XX) { - ret = venus_helper_set_bufsize(inst, inst->output_buf_size, - HFI_BUFFER_OUTPUT); - if (ret) - goto deinit_sess; - } + ret = vdec_output_conf(inst); + if (ret) + goto deinit_sess; ret = vdec_verify_conf(inst); if (ret)