From patchwork Fri Mar 12 17:30:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 398664 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1383412jai; Fri, 12 Mar 2021 09:30:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJwtFyRofHMZEC3OeGkGWFDXjeLiRIqTbPEb+pEPfF/k5VgpI6OTQbo4zXURjWzz54yUrggl X-Received: by 2002:aa7:df86:: with SMTP id b6mr15467272edy.294.1615570199939; Fri, 12 Mar 2021 09:29:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615570199; cv=none; d=google.com; s=arc-20160816; b=kSTzqrjDHLumBa+xAWHVTCudfIZuHOOXwk9jXo6PvF0rTKAWeMKsf6OmIfOTbGRW0k DrK1zloe8qAedy47pxUwc6X9ROd8WTNBu4/Cvf/7Di0+qQkeh8MhSHewQQAQi9q32n2i vMyhH9zGjPaFl4S5kmYPkgf5kD7l/DE1jw8HbAZNWckeGXYdjuMmydIuRxU9eeeZXGwj 2uv8O/6xx/sAJ8z1vHqovd6rvMNz2NqAooqKVi4BheBTKmX1VLa0gHa9WMsDJGWE2Jzh mq7EAYzCFWEGnZW4efGAz6BYyQ7FSt7YDlzdC4bb7ad6GwruDeESQQfmEiBaM3HNBgb9 kE4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=7D6lkspcofvjWGkPuH5XFGkauH881L6IwSvfokYi6CI=; b=EAv6hCmWA+U/8tAXbuR8I6eeIYZjgN9aZ6yjMgvC00w96I1sVlhuBxvYHKHkyvAJv3 6Z2+km308RYLXRe6wlmbQzyN6Wsk9T9Jfn1XjeRuPGqOjXH8iutHzplghRanPTeYiqKl jOdbqzr6mMRZQTp20RmRDTobcD0e8dg9/xk7UhnlHtxuRX7VflpOJZ1oUOgTnQJSYalH zjEW6C/KyoW+Q84BUJKZiW1tHp6jfm1bZy4KtdvUG+viLGWB8Em2/hLiKjNBGR25X3ow qEx2FVFjfkgiXw6CQ6hW2FGQ06yaaq+eB5zcI6XajX5t7CrUG6mX2Z53UK54SCvI6fDV uTGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VcizTwID; spf=pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id ot6si4540497ejb.337.2021.03.12.09.29.59; Fri, 12 Mar 2021 09:29:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VcizTwID; spf=pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 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 S232537AbhCLR3Y (ORCPT + 3 others); Fri, 12 Mar 2021 12:29:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232138AbhCLR3O (ORCPT ); Fri, 12 Mar 2021 12:29:14 -0500 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BFCB8C061762 for ; Fri, 12 Mar 2021 09:29:13 -0800 (PST) Received: by mail-wm1-x32d.google.com with SMTP id c76-20020a1c9a4f0000b029010c94499aedso16268326wme.0 for ; Fri, 12 Mar 2021 09:29:13 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=7D6lkspcofvjWGkPuH5XFGkauH881L6IwSvfokYi6CI=; b=VcizTwID4JmsJdLjuz9vNMxWLLO/2WEU7oZGS8nD8zBdq6MkJ1KpLgqfYsi/co1u6R yDkadCl67Na35Esj2ddKtWz2MXNYfZUFZdSAc59Cn40PP7tokJUxPK7PKdrG4IveHrm2 626v/c2psj/LzTOnUScCwgpfbg7MwXyhpcdReLZW6KwUdHfm8T2vppfXZsPHZdnDnXDE sUHDSBKb4K39jXykIfosQ7i+eQI2GN9GlZBuL0gNrFXlu689KaiiV1zaRv/rxSo3sWWp kAxM9ru6gq+qLLmhe5XQ/k5qqii661AiK7QvS0XCecN3XFWGnUKexQZ31NqEkWp7FTX5 DZHg== 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:mime-version:content-transfer-encoding; bh=7D6lkspcofvjWGkPuH5XFGkauH881L6IwSvfokYi6CI=; b=Jj22b3UhByPcaX6htvr8NuADhmWHHzG+01BAoHii82niVdZMRDUwzHGxxuy3liKKLd Nn4qXq3gRJWKcDpGhHxPv6PR3S0Wm8vX7xOIaV7VrNhjZvpr3l5Ja5DsioFpsiEpKsom 5+JMfrVPRBvVt9Z6W9KIcMbL06lruOTo1NEu2VZbJmkJ6KKqB/QYx3e0YXAGDRinQtH/ eRm2fWBw+Ls4jeOVnChMwdm8FNQuV8Dydog6g+muHpRVV5S4Z1vg+Cl7M8OkeQyg1oFF 7ArJqjHPjGLsRLqlOkEqCT4KLQlppFLyNrqJbGRlGgrgxMUgUdok0alZd1yVRre2dWxe C/0w== X-Gm-Message-State: AOAM533zCn2gyMsPtwR5ywmb0UfkzwfhbSVAXdcxnp1U6dyBOCi9z/7w vECqhc8Ksh5FBbDoDFzhNJpO7g== X-Received: by 2002:a1c:e244:: with SMTP id z65mr14163783wmg.130.1615570152399; Fri, 12 Mar 2021 09:29:12 -0800 (PST) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id 18sm2876375wmj.21.2021.03.12.09.29.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 09:29:11 -0800 (PST) From: Bryan O'Donoghue To: stanimir.varbanov@linaro.org, agross@kernel.org, bjorn.andersson@linaro.org, mchehab@kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: bryan.odonoghue@linaro.org, dikshita@codeaurora.org, jonathan@marek.ca, vgarodia@codeaurora.org Subject: [PATCH v2 01/25] media: venus: Update v6 buffer descriptors Date: Fri, 12 Mar 2021 17:30:15 +0000 Message-Id: <20210312173039.1387617-2-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210312173039.1387617-1-bryan.odonoghue@linaro.org> References: <20210312173039.1387617-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Currently hfi_platform_v6.c adds a bunch of capability parameters. Reviewing downstream we can see a number of these need to be updated. techpack/video/msm/vidc/msm_vidc_platform.c :: kona_capabilities[] Signed-off-by: Bryan O'Donoghue --- .../platform/qcom/venus/hfi_platform_v6.c | 138 +++++++++--------- 1 file changed, 69 insertions(+), 69 deletions(-) -- 2.30.1 diff --git a/drivers/media/platform/qcom/venus/hfi_platform_v6.c b/drivers/media/platform/qcom/venus/hfi_platform_v6.c index 2278be13cb90..dd1a03911b6c 100644 --- a/drivers/media/platform/qcom/venus/hfi_platform_v6.c +++ b/drivers/media/platform/qcom/venus/hfi_platform_v6.c @@ -9,15 +9,15 @@ static const struct hfi_plat_caps caps[] = { .codec = HFI_VIDEO_CODEC_H264, .domain = VIDC_SESSION_TYPE_DEC, .cap_bufs_mode_dynamic = true, - .caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 96, 5760, 1}, - .caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 96, 5760, 1}, + .caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 128, 8192, 1}, + .caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 128, 8192, 1}, /* ((5760 * 2880) / 256) */ - .caps[2] = {HFI_CAPABILITY_MBS_PER_FRAME, 36, 64800, 1}, - .caps[3] = {HFI_CAPABILITY_BITRATE, 1, 200000000, 1}, + .caps[2] = {HFI_CAPABILITY_MBS_PER_FRAME, 64, 138240, 1}, + .caps[3] = {HFI_CAPABILITY_BITRATE, 1, 220000000, 1}, .caps[4] = {HFI_CAPABILITY_SCALE_X, 65536, 65536, 1}, .caps[5] = {HFI_CAPABILITY_SCALE_Y, 65536, 65536, 1}, - .caps[6] = {HFI_CAPABILITY_MBS_PER_SECOND, 36, 1958400, 1}, - .caps[7] = {HFI_CAPABILITY_FRAMERATE, 1, 480, 1}, + .caps[6] = {HFI_CAPABILITY_MBS_PER_SECOND, 64, 7833600, 1}, + .caps[7] = {HFI_CAPABILITY_FRAMERATE, 1, 960, 1}, .caps[8] = {HFI_CAPABILITY_MAX_VIDEOCORES, 0, 1, 1}, .num_caps = 9, .pl[0] = {HFI_H264_PROFILE_BASELINE, HFI_H264_LEVEL_52}, @@ -35,15 +35,15 @@ static const struct hfi_plat_caps caps[] = { .codec = HFI_VIDEO_CODEC_HEVC, .domain = VIDC_SESSION_TYPE_DEC, .cap_bufs_mode_dynamic = true, - .caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 96, 4096, 1}, - .caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 96, 4096, 1}, - .caps[2] = {HFI_CAPABILITY_MBS_PER_FRAME, 1, 36864, 1}, - .caps[3] = {HFI_CAPABILITY_BITRATE, 1, 120000000, 1}, - .caps[4] = {HFI_CAPABILITY_SCALE_X, 4096, 65536, 1}, - .caps[5] = {HFI_CAPABILITY_SCALE_Y, 4096, 65536, 1}, - .caps[6] = {HFI_CAPABILITY_MBS_PER_SECOND, 1, 2073600, 1}, - .caps[7] = {HFI_CAPABILITY_FRAMERATE, 1, 480, 1}, - .caps[8] = {HFI_CAPABILITY_MAX_VIDEOCORES, 1, 2, 1}, + .caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 128, 8192, 1}, + .caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 128, 8192, 1}, + .caps[2] = {HFI_CAPABILITY_MBS_PER_FRAME, 64, 138240, 1}, + .caps[3] = {HFI_CAPABILITY_BITRATE, 1, 220000000, 1}, + .caps[4] = {HFI_CAPABILITY_SCALE_X, 65536, 65536, 1}, + .caps[5] = {HFI_CAPABILITY_SCALE_Y, 65536, 65536, 1}, + .caps[6] = {HFI_CAPABILITY_MBS_PER_SECOND, 64, 7833600, 1}, + .caps[7] = {HFI_CAPABILITY_FRAMERATE, 1, 960, 1}, + .caps[8] = {HFI_CAPABILITY_MAX_VIDEOCORES, 0, 1, 1}, .caps[9] = {HFI_CAPABILITY_MAX_WORKMODES, 1, 3, 1}, .num_caps = 10, .pl[0] = {HFI_HEVC_PROFILE_MAIN, HFI_HEVC_LEVEL_6 | HFI_HEVC_TIER_HIGH0}, @@ -61,15 +61,15 @@ static const struct hfi_plat_caps caps[] = { .codec = HFI_VIDEO_CODEC_VP8, .domain = VIDC_SESSION_TYPE_DEC, .cap_bufs_mode_dynamic = true, - .caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 96, 4096, 1}, - .caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 96, 4096, 1}, - .caps[2] = {HFI_CAPABILITY_MBS_PER_FRAME, 1, 36864, 1}, - .caps[3] = {HFI_CAPABILITY_BITRATE, 1, 120000000, 1}, - .caps[4] = {HFI_CAPABILITY_SCALE_X, 4096, 65536, 1}, - .caps[5] = {HFI_CAPABILITY_SCALE_Y, 4096, 65536, 1}, - .caps[6] = {HFI_CAPABILITY_MBS_PER_SECOND, 1, 2073600, 1}, - .caps[7] = {HFI_CAPABILITY_FRAMERATE, 1, 480, 1}, - .caps[8] = {HFI_CAPABILITY_MAX_VIDEOCORES, 1, 2, 1}, + .caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 128, 4096, 1}, + .caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 128, 4096, 1}, + .caps[2] = {HFI_CAPABILITY_MBS_PER_FRAME, 64, 36864, 1}, + .caps[3] = {HFI_CAPABILITY_BITRATE, 1, 100000000, 1}, + .caps[4] = {HFI_CAPABILITY_SCALE_X, 65536, 65536, 1}, + .caps[5] = {HFI_CAPABILITY_SCALE_Y, 65536, 65536, 1}, + .caps[6] = {HFI_CAPABILITY_MBS_PER_SECOND, 64, 4423680, 1}, + .caps[7] = {HFI_CAPABILITY_FRAMERATE, 1, 120, 1}, + .caps[8] = {HFI_CAPABILITY_MAX_VIDEOCORES, 0, 1, 1}, .caps[9] = {HFI_CAPABILITY_MAX_WORKMODES, 1, 3, 1}, .num_caps = 10, .pl[0] = {HFI_VPX_PROFILE_MAIN, HFI_VPX_LEVEL_VERSION_0}, @@ -86,15 +86,15 @@ static const struct hfi_plat_caps caps[] = { .codec = HFI_VIDEO_CODEC_VP9, .domain = VIDC_SESSION_TYPE_DEC, .cap_bufs_mode_dynamic = true, - .caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 96, 4096, 1}, - .caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 96, 4096, 1}, - .caps[2] = {HFI_CAPABILITY_MBS_PER_FRAME, 1, 36864, 1}, - .caps[3] = {HFI_CAPABILITY_BITRATE, 1, 120000000, 1}, - .caps[4] = {HFI_CAPABILITY_SCALE_X, 4096, 65536, 1}, - .caps[5] = {HFI_CAPABILITY_SCALE_Y, 4096, 65536, 1}, - .caps[6] = {HFI_CAPABILITY_MBS_PER_SECOND, 1, 2073600, 1}, - .caps[7] = {HFI_CAPABILITY_FRAMERATE, 1, 480, 1}, - .caps[8] = {HFI_CAPABILITY_MAX_VIDEOCORES, 1, 2, 1}, + .caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 128, 8192, 1}, + .caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 128, 8192, 1}, + .caps[2] = {HFI_CAPABILITY_MBS_PER_FRAME, 64, 138240, 1}, + .caps[3] = {HFI_CAPABILITY_BITRATE, 1, 220000000, 1}, + .caps[4] = {HFI_CAPABILITY_SCALE_X, 65536, 65536, 1}, + .caps[5] = {HFI_CAPABILITY_SCALE_Y, 65536, 65536, 1}, + .caps[6] = {HFI_CAPABILITY_MBS_PER_SECOND, 64, 7833600, 1}, + .caps[7] = {HFI_CAPABILITY_FRAMERATE, 1, 960, 1}, + .caps[8] = {HFI_CAPABILITY_MAX_VIDEOCORES, 0, 1, 1}, .caps[9] = {HFI_CAPABILITY_MAX_WORKMODES, 1, 3, 1}, .num_caps = 10, .pl[0] = {HFI_VP9_PROFILE_P0, 200}, @@ -112,15 +112,15 @@ static const struct hfi_plat_caps caps[] = { .codec = HFI_VIDEO_CODEC_MPEG2, .domain = VIDC_SESSION_TYPE_DEC, .cap_bufs_mode_dynamic = true, - .caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 96, 1920, 1}, - .caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 96, 1920, 1}, - .caps[2] = {HFI_CAPABILITY_MBS_PER_FRAME, 1, 8160, 1}, + .caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 128, 1920, 1}, + .caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 128, 1920, 1}, + .caps[2] = {HFI_CAPABILITY_MBS_PER_FRAME, 64, 8160, 1}, .caps[3] = {HFI_CAPABILITY_BITRATE, 1, 40000000, 1}, - .caps[4] = {HFI_CAPABILITY_SCALE_X, 4096, 65536, 1}, - .caps[5] = {HFI_CAPABILITY_SCALE_Y, 4096, 65536, 1}, - .caps[6] = {HFI_CAPABILITY_MBS_PER_SECOND, 1, 244800, 1}, + .caps[4] = {HFI_CAPABILITY_SCALE_X, 65536, 65536, 1}, + .caps[5] = {HFI_CAPABILITY_SCALE_Y, 65536, 65536, 1}, + .caps[6] = {HFI_CAPABILITY_MBS_PER_SECOND, 64, 7833600, 1}, .caps[7] = {HFI_CAPABILITY_FRAMERATE, 1, 30, 1}, - .caps[8] = {HFI_CAPABILITY_MAX_VIDEOCORES, 1, 2, 1}, + .caps[8] = {HFI_CAPABILITY_MAX_VIDEOCORES, 0, 1, 1}, .caps[9] = {HFI_CAPABILITY_MAX_WORKMODES, 1, 1, 1}, .num_caps = 10, .pl[0] = {HFI_MPEG2_PROFILE_SIMPLE, HFI_MPEG2_LEVEL_H14}, @@ -135,21 +135,21 @@ static const struct hfi_plat_caps caps[] = { .codec = HFI_VIDEO_CODEC_H264, .domain = VIDC_SESSION_TYPE_ENC, .cap_bufs_mode_dynamic = true, - .caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 96, 4096, 16}, - .caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 96, 4096, 16}, - .caps[2] = {HFI_CAPABILITY_MBS_PER_FRAME, 1, 36864, 1}, - .caps[3] = {HFI_CAPABILITY_BITRATE, 1, 120000000, 1}, + .caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 128, 8192, 1}, + .caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 128, 8192, 1}, + .caps[2] = {HFI_CAPABILITY_MBS_PER_FRAME, 64, 138240, 1}, + .caps[3] = {HFI_CAPABILITY_BITRATE, 1, 220000000, 1}, .caps[4] = {HFI_CAPABILITY_SCALE_X, 8192, 65536, 1}, .caps[5] = {HFI_CAPABILITY_SCALE_Y, 8192, 65536, 1}, - .caps[6] = {HFI_CAPABILITY_MBS_PER_SECOND, 1, 1036800, 1}, - .caps[7] = {HFI_CAPABILITY_FRAMERATE, 1, 480, 1}, - .caps[8] = {HFI_CAPABILITY_MAX_VIDEOCORES, 1, 3, 1}, + .caps[6] = {HFI_CAPABILITY_MBS_PER_SECOND, 64, 7833600, 1}, + .caps[7] = {HFI_CAPABILITY_FRAMERATE, 1, 960, 1}, + .caps[8] = {HFI_CAPABILITY_MAX_VIDEOCORES, 0, 1, 1}, .caps[9] = {HFI_CAPABILITY_PEAKBITRATE, 32000, 160000000, 1}, - .caps[10] = {HFI_CAPABILITY_HIER_P_NUM_ENH_LAYERS, 0, 5, 1}, - .caps[11] = {HFI_CAPABILITY_ENC_LTR_COUNT, 0, 4, 1}, + .caps[10] = {HFI_CAPABILITY_HIER_P_NUM_ENH_LAYERS, 0, 6, 1}, + .caps[11] = {HFI_CAPABILITY_ENC_LTR_COUNT, 0, 2, 1}, .caps[12] = {HFI_CAPABILITY_LCU_SIZE, 16, 16, 1}, .caps[13] = {HFI_CAPABILITY_BFRAME, 0, 1, 1}, - .caps[14] = {HFI_CAPABILITY_HIER_P_HYBRID_NUM_ENH_LAYERS, 0, 5, 1}, + .caps[14] = {HFI_CAPABILITY_HIER_P_HYBRID_NUM_ENH_LAYERS, 0, 6, 1}, .caps[15] = {HFI_CAPABILITY_I_FRAME_QP, 0, 51, 1}, .caps[16] = {HFI_CAPABILITY_P_FRAME_QP, 0, 51, 1}, .caps[17] = {HFI_CAPABILITY_B_FRAME_QP, 0, 51, 1}, @@ -172,24 +172,24 @@ static const struct hfi_plat_caps caps[] = { .codec = HFI_VIDEO_CODEC_HEVC, .domain = VIDC_SESSION_TYPE_ENC, .cap_bufs_mode_dynamic = true, - .caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 96, 4096, 16}, - .caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 96, 4096, 16}, - .caps[2] = {HFI_CAPABILITY_MBS_PER_FRAME, 1, 36864, 1}, - .caps[3] = {HFI_CAPABILITY_BITRATE, 1, 120000000, 1}, + .caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 128, 8192, 16}, + .caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 128, 8192, 16}, + .caps[2] = {HFI_CAPABILITY_MBS_PER_FRAME, 64, 138240, 1}, + .caps[3] = {HFI_CAPABILITY_BITRATE, 1, 160000000, 1}, .caps[4] = {HFI_CAPABILITY_SCALE_X, 8192, 65536, 1}, .caps[5] = {HFI_CAPABILITY_SCALE_Y, 8192, 65536, 1}, - .caps[6] = {HFI_CAPABILITY_MBS_PER_SECOND, 1, 1036800, 1}, - .caps[7] = {HFI_CAPABILITY_FRAMERATE, 1, 480, 1}, - .caps[8] = {HFI_CAPABILITY_MAX_VIDEOCORES, 1, 3, 1}, + .caps[6] = {HFI_CAPABILITY_MBS_PER_SECOND, 64, 7833600, 1}, + .caps[7] = {HFI_CAPABILITY_FRAMERATE, 1, 960, 1}, + .caps[8] = {HFI_CAPABILITY_MAX_VIDEOCORES, 0, 1, 1}, .caps[9] = {HFI_CAPABILITY_PEAKBITRATE, 32000, 160000000, 1}, .caps[10] = {HFI_CAPABILITY_HIER_P_NUM_ENH_LAYERS, 0, 5, 1}, - .caps[11] = {HFI_CAPABILITY_ENC_LTR_COUNT, 0, 4, 1}, + .caps[11] = {HFI_CAPABILITY_ENC_LTR_COUNT, 0, 2, 1}, .caps[12] = {HFI_CAPABILITY_LCU_SIZE, 32, 32, 1}, .caps[13] = {HFI_CAPABILITY_BFRAME, 0, 1, 1}, .caps[14] = {HFI_CAPABILITY_HIER_P_HYBRID_NUM_ENH_LAYERS, 0, 5, 1}, - .caps[15] = {HFI_CAPABILITY_I_FRAME_QP, 0, 63, 1}, - .caps[16] = {HFI_CAPABILITY_P_FRAME_QP, 0, 63, 1}, - .caps[17] = {HFI_CAPABILITY_B_FRAME_QP, 0, 63, 1}, + .caps[15] = {HFI_CAPABILITY_I_FRAME_QP, 0, 51, 1}, + .caps[16] = {HFI_CAPABILITY_P_FRAME_QP, 0, 51, 1}, + .caps[17] = {HFI_CAPABILITY_B_FRAME_QP, 0, 51, 1}, .caps[18] = {HFI_CAPABILITY_MAX_WORKMODES, 1, 2, 1}, .caps[19] = {HFI_CAPABILITY_RATE_CONTROL_MODES, 0x1000001, 0x1000005, 1}, .caps[20] = {HFI_CAPABILITY_COLOR_SPACE_CONVERSION, 0, 2, 1}, @@ -209,20 +209,20 @@ static const struct hfi_plat_caps caps[] = { .codec = HFI_VIDEO_CODEC_VP8, .domain = VIDC_SESSION_TYPE_ENC, .cap_bufs_mode_dynamic = true, - .caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 96, 4096, 16}, - .caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 96, 4096, 16}, - .caps[2] = {HFI_CAPABILITY_MBS_PER_FRAME, 1, 36864, 1}, - .caps[3] = {HFI_CAPABILITY_BITRATE, 1, 120000000, 1}, + .caps[0] = {HFI_CAPABILITY_FRAME_WIDTH, 128, 4096, 16}, + .caps[1] = {HFI_CAPABILITY_FRAME_HEIGHT, 128, 4096, 16}, + .caps[2] = {HFI_CAPABILITY_MBS_PER_FRAME, 64, 36864, 1}, + .caps[3] = {HFI_CAPABILITY_BITRATE, 1, 74000000, 1}, .caps[4] = {HFI_CAPABILITY_SCALE_X, 8192, 65536, 1}, .caps[5] = {HFI_CAPABILITY_SCALE_Y, 8192, 65536, 1}, - .caps[6] = {HFI_CAPABILITY_MBS_PER_SECOND, 1, 1036800, 1}, - .caps[7] = {HFI_CAPABILITY_FRAMERATE, 1, 240, 1}, - .caps[8] = {HFI_CAPABILITY_MAX_VIDEOCORES, 1, 3, 1}, + .caps[6] = {HFI_CAPABILITY_MBS_PER_SECOND, 64, 4423680, 1}, + .caps[7] = {HFI_CAPABILITY_FRAMERATE, 1, 120, 1}, + .caps[8] = {HFI_CAPABILITY_MAX_VIDEOCORES, 0, 1, 1}, .caps[9] = {HFI_CAPABILITY_PEAKBITRATE, 32000, 160000000, 1}, .caps[10] = {HFI_CAPABILITY_HIER_P_NUM_ENH_LAYERS, 0, 3, 1}, .caps[11] = {HFI_CAPABILITY_ENC_LTR_COUNT, 0, 2, 1}, .caps[12] = {HFI_CAPABILITY_LCU_SIZE, 16, 16, 1}, - .caps[13] = {HFI_CAPABILITY_BFRAME, 0, 1, 1}, + .caps[13] = {HFI_CAPABILITY_BFRAME, 0, 0, 1}, .caps[14] = {HFI_CAPABILITY_HIER_P_HYBRID_NUM_ENH_LAYERS, 0, 5, 1}, .caps[15] = {HFI_CAPABILITY_I_FRAME_QP, 0, 127, 1}, .caps[16] = {HFI_CAPABILITY_P_FRAME_QP, 0, 127, 1}, From patchwork Fri Mar 12 17:30:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 399117 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8FA22C43332 for ; Fri, 12 Mar 2021 17:29:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6E9D964FD6 for ; Fri, 12 Mar 2021 17:29:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232311AbhCLR3X (ORCPT ); Fri, 12 Mar 2021 12:29:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232689AbhCLR3P (ORCPT ); Fri, 12 Mar 2021 12:29:15 -0500 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B15EEC061761 for ; Fri, 12 Mar 2021 09:29:14 -0800 (PST) Received: by mail-wm1-x331.google.com with SMTP id f22-20020a7bc8d60000b029010c024a1407so16276028wml.2 for ; Fri, 12 Mar 2021 09:29:14 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=x83uovnMOJTdyefGlIGHI08yYtXPvr91w/2f/jSvlJs=; b=XLFeT9DgpJGU0vi3RKLjF+R3QIgBsbcQn2/gV7k9okAcaAvXEh+UVM9GEiUoGpjsiX OWIGNYhuPtEE0ufgzuulkBLtVJKMWZJpy3Pj6Ol5s6QjhcvPuhH5+hJdyot9CfPzErwn u7xZLOwALJjdxsh8I3R8E2+AzaTJ2Lbd0nvzd0+jlZyLo8PAHC4LSxV0OsxWKCMsAspW KSekZ3ka34AugII3VrYu74RSyJDmv6/N96ejGzUD7U6P3zDg9zl6m8YqknQjiGQZeUlx IFBY0FFl0xpzytnkz15h0oKgVkUdPtHks2PQJ4Qp+Vhj+nBcJVJLWf3urHjnCD2CuHYF 6XQQ== 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:mime-version:content-transfer-encoding; bh=x83uovnMOJTdyefGlIGHI08yYtXPvr91w/2f/jSvlJs=; b=WmP8/oicyFSHxXKe/NbF0Fokm00vkRGQlioxZ1PRM9M3JCvg0H+RDejYfhRROUS6X+ zKZZd0Ki/fPHCseIIVErpuD4950dGy2Vm0gTZ2gOW8vFz+Ta4GUzS5w7g8HOBfiMPC5T wB+U41STL0FOHhsl4p3YH/P4MzbCUiaj7Bho09MqEvYGjGWo2M55U8m8w09SdqWyVIp7 vCcoUt0YCEdbqL0xdrQYbvaSfIeUosZXnYbZ8E4yIs26ohw1ZccGrFZkdPWJpI4UuIzy OdU2iWCJXrjgaacehvSS90I9j2OVstPVuiqKULKkuBXGdUQKwFnhhzfnboRsgCvcRFxy jeDg== X-Gm-Message-State: AOAM530Gol6o6Ha6VaAaEjsUy9EA08mGTtAIbRGoTgg68VIpBTaNP5nk MKaekc3tOmRe9uBmuy2UQoP8uA== X-Google-Smtp-Source: ABdhPJwFzFLe8cxyr98kuCRyqV2ZgtpD1Ae922PrMW+4s6y0ehRD+WPXtrxtADHC//o1fqetwXhsFQ== X-Received: by 2002:a05:600c:220d:: with SMTP id z13mr14177471wml.1.1615570153435; Fri, 12 Mar 2021 09:29:13 -0800 (PST) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id 18sm2876375wmj.21.2021.03.12.09.29.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 09:29:12 -0800 (PST) From: Bryan O'Donoghue To: stanimir.varbanov@linaro.org, agross@kernel.org, bjorn.andersson@linaro.org, mchehab@kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: bryan.odonoghue@linaro.org, dikshita@codeaurora.org, jonathan@marek.ca, vgarodia@codeaurora.org Subject: [PATCH v2 02/25] media: venus: core,pm: Add handling for resets Date: Fri, 12 Mar 2021 17:30:16 +0000 Message-Id: <20210312173039.1387617-3-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210312173039.1387617-1-bryan.odonoghue@linaro.org> References: <20210312173039.1387617-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Stanimir Varbanov The Venus driver has to control two reset signals related to gcc video_axi0 and videocc mvs0c for v6. Add it. Signed-off-by: Stanimir Varbanov Signed-off-by: Bryan O'Donoghue --- drivers/media/platform/qcom/venus/core.h | 4 ++ .../media/platform/qcom/venus/pm_helpers.c | 60 +++++++++++++++++++ 2 files changed, 64 insertions(+) diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h index 13c18c49714d..0a90cd79104b 100644 --- a/drivers/media/platform/qcom/venus/core.h +++ b/drivers/media/platform/qcom/venus/core.h @@ -24,6 +24,7 @@ #define VIDC_CLKS_NUM_MAX 4 #define VIDC_VCODEC_CLKS_NUM_MAX 2 #define VIDC_PMDOMAINS_NUM_MAX 3 +#define VIDC_RESETS_NUM_MAX 2 extern int venus_fw_debug; @@ -64,6 +65,8 @@ struct venus_resources { unsigned int vcodec_pmdomains_num; const char **opp_pmdomain; unsigned int vcodec_num; + const char * const resets[VIDC_RESETS_NUM_MAX]; + unsigned int resets_num; enum hfi_version hfi_version; u32 max_load; unsigned int vmem_id; @@ -130,6 +133,7 @@ struct venus_core { struct device *pmdomains[VIDC_PMDOMAINS_NUM_MAX]; struct device_link *opp_dl_venus; struct device *opp_pmdomain; + struct reset_control *resets[VIDC_RESETS_NUM_MAX]; struct video_device *vdev_dec; struct video_device *vdev_enc; struct v4l2_device v4l2_dev; diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c index 95b4d40ff6a5..794c2d6f0543 100644 --- a/drivers/media/platform/qcom/venus/pm_helpers.c +++ b/drivers/media/platform/qcom/venus/pm_helpers.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include @@ -847,6 +848,52 @@ static void vcodec_domains_put(struct venus_core *core) dev_pm_opp_detach_genpd(core->opp_table); } +static int core_resets_reset(struct venus_core *core) +{ + const struct venus_resources *res = core->res; + unsigned char i; + int ret; + + if (!res->resets_num) + return 0; + + for (i = 0; i < res->resets_num; i++) { + ret = reset_control_assert(core->resets[i]); + if (ret) + goto err; + + usleep_range(150, 250); + ret = reset_control_deassert(core->resets[i]); + if (ret) + goto err; + } + +err: + return ret; +} + +static int core_resets_get(struct venus_core *core) +{ + struct device *dev = core->dev; + const struct venus_resources *res = core->res; + unsigned char i; + int ret; + + if (!res->resets_num) + return 0; + + for (i = 0; i < res->resets_num; i++) { + core->resets[i] = + devm_reset_control_get_exclusive(dev, res->resets[i]); + if (IS_ERR(core->resets[i])) { + ret = PTR_ERR(core->resets[i]); + return ret; + } + } + + return 0; +} + static int core_get_v4(struct venus_core *core) { struct device *dev = core->dev; @@ -870,6 +917,10 @@ static int core_get_v4(struct venus_core *core) if (ret) return ret; + ret = core_resets_get(core); + if (ret) + return ret; + if (legacy_binding) return 0; @@ -929,6 +980,13 @@ static int core_power_v4(struct venus_core *core, int on) } } + ret = core_resets_reset(core); + if (ret) { + if (pmctrl) + pm_runtime_put_sync(pmctrl); + return ret; + } + ret = core_clks_enable(core); if (ret < 0 && pmctrl) pm_runtime_put_sync(pmctrl); @@ -939,6 +997,8 @@ static int core_power_v4(struct venus_core *core, int on) core_clks_disable(core); + ret = core_resets_reset(core); + if (pmctrl) pm_runtime_put_sync(pmctrl); } From patchwork Fri Mar 12 17:30:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 398662 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1383400jai; Fri, 12 Mar 2021 09:29:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJx6cox4ga//Inr44/PsgqqQ0xsk1l+J0UxQqyfFs8bas5KcQpf4qoR0UlnbFcdHXoi8bf1/ X-Received: by 2002:a50:fd15:: with SMTP id i21mr15246237eds.384.1615570199108; Fri, 12 Mar 2021 09:29:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615570199; cv=none; d=google.com; s=arc-20160816; b=TLbMuFJDh7tp10JIhyrZWxWm7meebS6mgfvlcMaLKkV8DmXB2DmQbTDsNxTcDLaGyR aH6eev5HOHOQpc80TsZKCV3XDMNPOSRJ4M0I0JqhYgqAQaDwRPnS2+vqr/1VwHIVNrqx WREBDDnuEh6IGJvtYeZAmc6SBvgxhG12EmF9ofeJxZw81CRwksTTwHQwyOvsyhr6TvN9 +xNFTdFwZ+5qECDePt+eBQICLHchOEF9JmgxOwuIhCOMULQdXD9gFVZPkyV61t86mdE5 kKmDOGUVAkFICR2dBsYNZyjtscYic1E1MTmNqVxMpkK2NcGswMuuWpRN8u/H4qzY8sSz IYkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=baSMqShP5W3Zw4aCNa6SmZHYgWuL3HOZVO7fD1Vf2tE=; b=M4SeMZWI0z7RQYxQfS4H1KZZjo5B/ObZ4bkhQjO6btF6xCsfkeQJ/6x+Ur75vBla+1 IryLxlCHWA/xQKlbn6sD7HPv8M5WskIpTlSkf75iIT/zDCgAXJMi1uvwn37DV66aW1jH evQQFDSNF5JUP7iXzj7Cqf6cc0ZWWqdkPkRmjSCaW2aGowc7JC7OFpopyiUMLTfuCcu7 b8tglJ7+DfmPC6Z9yUTldcS6sr3ODLrL1c/pHBPB9KagjT+nMyVmJ1PQC5ott/NaRWPR pFozTLYeZv8DoKQKDvwBzf+tUMz3mwzP2mNvc3Rv/O7OTbJ8OgKd8UHbNWTVokpkGs9C rVxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vJbQeEtg; spf=pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id ot6si4540497ejb.337.2021.03.12.09.29.58; Fri, 12 Mar 2021 09:29:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vJbQeEtg; spf=pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 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 S232547AbhCLR3Y (ORCPT + 3 others); Fri, 12 Mar 2021 12:29:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232699AbhCLR3Q (ORCPT ); Fri, 12 Mar 2021 12:29:16 -0500 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDE30C061574 for ; Fri, 12 Mar 2021 09:29:15 -0800 (PST) Received: by mail-wm1-x335.google.com with SMTP id u5-20020a7bcb050000b029010e9316b9d5so12670655wmj.2 for ; Fri, 12 Mar 2021 09:29:15 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=baSMqShP5W3Zw4aCNa6SmZHYgWuL3HOZVO7fD1Vf2tE=; b=vJbQeEtgWffYfC76tfsRRXDyRunGoQ9OEzeUIvqGIs5LcGGKUsiLM9qB8Z9P77MbMg s2II+y/1YfzFDyASjsdZWkkqlphNtPYRBg5MoMgQGk5yqLo2NrRTXmBuoEBwRgNg823H YPUX9Irmj7IXY0YQuljuSR5JNTbM2mPftGKOSu1IuDyM9H7vgR1IjyBRv4nzSffmSOs7 rZXswmreap1fWnqzODpt7R6lMixzJMiUcoFKBENuPY+wbUYdJ6Em0QUPMH8t6QZND6Lg SAknNepQ6ICiA7bfLoFY3tcabjLCjkZ7wEuyKH+AAndWkC48cyZlwp25VpUYZKzA62ZD i80w== 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:mime-version:content-transfer-encoding; bh=baSMqShP5W3Zw4aCNa6SmZHYgWuL3HOZVO7fD1Vf2tE=; b=XKsAMs/BCVp1C9XElZdV4Rms1t0js4J7oL4WBPQm7vv+ZZ4Ny176XsqjIJlEI/HYin bfZUQJ/y70wO1m7xm+AmCuZsSDDmbvpl4OxxBQiE/M0zriWmBW5uc0wVCR92QesmFdJZ E13FowXcS7TdlJcew79txhra4sgUjLogyVLEgEWIS+5SIb2B+TLfiwKgaADkctOvLPxY EmEmcsIRtu0ORpPCk7yD7Dz0tZQrQz6yw5muZRNKUcxkKMZ+75w1LTTV7fJlqQr6wVBp o9GhfPSYDDTB7QS/yy2n0Bx+Lru8rg5lKb58aUF6+0TYA87hjd3t8Rbq+3Uhtr5/JWtE FJBA== X-Gm-Message-State: AOAM530t91cQK3RDKxcpUpFTEV4hSJIu8wzBSfE6Ql7qvB59h8cg+SgY 43esA9qbHBrhn/J3IC8jan6BrA== X-Received: by 2002:a1c:7210:: with SMTP id n16mr13783227wmc.13.1615570154629; Fri, 12 Mar 2021 09:29:14 -0800 (PST) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id 18sm2876375wmj.21.2021.03.12.09.29.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 09:29:14 -0800 (PST) From: Bryan O'Donoghue To: stanimir.varbanov@linaro.org, agross@kernel.org, bjorn.andersson@linaro.org, mchehab@kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: bryan.odonoghue@linaro.org, dikshita@codeaurora.org, jonathan@marek.ca, vgarodia@codeaurora.org Subject: [PATCH v2 03/25] media: venus: core: add sm8250 DT compatible and resource data Date: Fri, 12 Mar 2021 17:30:17 +0000 Message-Id: <20210312173039.1387617-4-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210312173039.1387617-1-bryan.odonoghue@linaro.org> References: <20210312173039.1387617-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Adds an sm8250 compatible binding to the venus core. Co-developed-by: Jonathan Marek Signed-off-by: Jonathan Marek Co-developed-by: Dikshita Agarwal Signed-off-by: Dikshita Agarwal Signed-off-by: Bryan O'Donoghue Acked-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/core.c | 54 ++++++++++++++++++++++++ 1 file changed, 54 insertions(+) -- 2.30.1 diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index 00d6883d3859..68358a9f3cda 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -627,12 +627,66 @@ static const struct venus_resources sc7180_res = { .fwname = "qcom/venus-5.4/venus.mdt", }; +static const struct freq_tbl sm8250_freq_table[] = { + { 0, 444000000 }, + { 0, 366000000 }, + { 0, 338000000 }, + { 0, 240000000 }, +}; + +static const struct bw_tbl sm8250_bw_table_enc[] = { + { 1944000, 1954000, 0, 3711000, 0 }, /* 3840x2160@60 */ + { 972000, 996000, 0, 1905000, 0 }, /* 3840x2160@30 */ + { 489600, 645000, 0, 977000, 0 }, /* 1920x1080@60 */ + { 244800, 332000, 0, 498000, 0 }, /* 1920x1080@30 */ +}; + +static const struct bw_tbl sm8250_bw_table_dec[] = { + { 2073600, 2403000, 0, 4113000, 0 }, /* 4096x2160@60 */ + { 1036800, 1224000, 0, 2079000, 0 }, /* 4096x2160@30 */ + { 489600, 812000, 0, 998000, 0 }, /* 1920x1080@60 */ + { 244800, 416000, 0, 509000, 0 }, /* 1920x1080@30 */ +}; + +static const struct reg_val sm8250_reg_preset[] = { + { 0xb0088, 0 }, +}; + +static const struct venus_resources sm8250_res = { + .freq_tbl = sm8250_freq_table, + .freq_tbl_size = ARRAY_SIZE(sm8250_freq_table), + .reg_tbl = sm8250_reg_preset, + .reg_tbl_size = ARRAY_SIZE(sm8250_reg_preset), + .bw_tbl_enc = sm8250_bw_table_enc, + .bw_tbl_enc_size = ARRAY_SIZE(sm8250_bw_table_enc), + .bw_tbl_dec = sm8250_bw_table_dec, + .bw_tbl_dec_size = ARRAY_SIZE(sm8250_bw_table_dec), + .clks = {"core", "iface"}, + .clks_num = 2, + .resets = { "bus", "core" }, + .resets_num = 2, + .vcodec0_clks = { "vcodec0_core" }, + .vcodec_clks_num = 1, + .vcodec_pmdomains = { "venus", "vcodec0" }, + .vcodec_pmdomains_num = 2, + .opp_pmdomain = (const char *[]) { "mx", NULL }, + .vcodec_num = 1, + .max_load = 7833600, + .hfi_version = HFI_VERSION_6XX, + .vmem_id = VIDC_RESOURCE_NONE, + .vmem_size = 0, + .vmem_addr = 0, + .dma_mask = 0xe0000000 - 1, + .fwname = "qcom/sm8250/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, }, { .compatible = "qcom,sdm845-venus-v2", .data = &sdm845_res_v2, }, { .compatible = "qcom,sc7180-venus", .data = &sc7180_res, }, + { .compatible = "qcom,sm8250-venus", .data = &sm8250_res, }, { } }; MODULE_DEVICE_TABLE(of, venus_dt_match); From patchwork Fri Mar 12 17:30:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 399863 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0BD60C4321A for ; Fri, 12 Mar 2021 17:29:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DDC0C64FC2 for ; Fri, 12 Mar 2021 17:29:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232562AbhCLR3Y (ORCPT ); Fri, 12 Mar 2021 12:29:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232714AbhCLR3R (ORCPT ); Fri, 12 Mar 2021 12:29:17 -0500 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CEAECC061574 for ; Fri, 12 Mar 2021 09:29:16 -0800 (PST) Received: by mail-wr1-x42d.google.com with SMTP id v15so5245552wrx.4 for ; Fri, 12 Mar 2021 09:29:16 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=A0Hq1qWM/ZGzT0LfPQuVO+plwGRyfpUWLhKq3EzQLwo=; b=LjLRJE3DXbEvEaad1BScgs8pZNKT0YRanrzcpLFHzg3MBgcbKNYIkciXTeXVE4X6gY DmaUrkk8XouL103i2B1JXi4LYCz7JHBiC+6u4MhRcFd6kVsmaW2fE6HqDwWPbwOTCiJU sc7pzm0/KtU+sfTe+sMUemGaSDtMjuANWu/8z3LK4f/lMM2opb8lOk8gr5QYrIFh6916 Tcb1/q3vnjvv/xCL9KSWP3sHsg4wMxaK7TKqcNjXVfxEEDK4fe4shoQa+qciC++TQIia avoetQP13Y+mxOy7JumbV1iRAxAtPczoPftsNxKjNOnGiKm7WT30i3AyiovHGum2FEP3 nJXw== 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:mime-version:content-transfer-encoding; bh=A0Hq1qWM/ZGzT0LfPQuVO+plwGRyfpUWLhKq3EzQLwo=; b=hb55wkCde+lZNody9dJpATHcCj15FKXqwTjtwOfiOzASV8gvV38Mk57QcoBX9XiNu5 cwtXiVwvHk92ZETtx+Ud7Gbe9cL8QRBeJDx57SOYe6ywnBEa7FAiZNWfdnAANlkaQtvO rJMBsFDyFU3JnqFPcYWpC/XYkRdkNN4/FqBGlRoasSKjHxvZXSOttkWODMjFjNwAGSP1 sC+XWkNb3DncgEpCL+ia4+K+uJD7ME5Z4qlweoFOaTz+aRbitpzAhNOZJy2i5NtLhnch sSsRn88NI1SAU2GiJWDKDHqqJ6XGq/sYXGQeLNIgI6AhVq1ObSzBEFl2WwgDH3oB/O6n eWcA== X-Gm-Message-State: AOAM533oC5ugRCkm/5FdsnfS96pgppP+yPtOW/B74iLnoNyHbU8DS0XL o7lv+xK/cCdbCk2AEgdFrcYzjg== X-Google-Smtp-Source: ABdhPJz87PQbHDYVO7qnQP3H7y6C2IxtigQz+3hKual5fcqiWJ2OWYA3ISTmgmfX1GxquWp3zG4l6w== X-Received: by 2002:a5d:5051:: with SMTP id h17mr14860862wrt.80.1615570155561; Fri, 12 Mar 2021 09:29:15 -0800 (PST) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id 18sm2876375wmj.21.2021.03.12.09.29.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 09:29:15 -0800 (PST) From: Bryan O'Donoghue To: stanimir.varbanov@linaro.org, agross@kernel.org, bjorn.andersson@linaro.org, mchehab@kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: bryan.odonoghue@linaro.org, dikshita@codeaurora.org, jonathan@marek.ca, vgarodia@codeaurora.org Subject: [PATCH v2 04/25] media: venus: core: Add io base variables for each block Date: Fri, 12 Mar 2021 17:30:18 +0000 Message-Id: <20210312173039.1387617-5-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210312173039.1387617-1-bryan.odonoghue@linaro.org> References: <20210312173039.1387617-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org New silicon means that the pre-determined offsets we have been using in this driver no longer hold. Existing blocks of registers can exist at different offsets relative to the IO base address. This commit adds a routine to assign the IO base hooks a subsequent commit will convert from absolute to relative addressing. Signed-off-by: Bryan O'Donoghue Acked-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/core.c | 12 ++++++++++++ drivers/media/platform/qcom/venus/core.h | 10 ++++++++++ 2 files changed, 22 insertions(+) diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index 68358a9f3cda..7124d9111001 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -23,6 +23,7 @@ #include "core.h" #include "firmware.h" #include "pm_helpers.h" +#include "hfi_venus_io.h" static void venus_coredump(struct venus_core *core) { @@ -207,6 +208,15 @@ static int venus_enumerate_codecs(struct venus_core *core, u32 type) return ret; } +static void venus_assign_register_offsets(struct venus_core *core) +{ + core->vbif_base = core->base + VBIF_BASE; + core->cpu_base = core->base + CPU_BASE; + core->cpu_cs_base = core->base + CPU_CS_BASE; + core->cpu_ic_base = core->base + CPU_IC_BASE; + core->wrapper_base = core->base + WRAPPER_BASE; +} + static int venus_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -273,6 +283,8 @@ static int venus_probe(struct platform_device *pdev) if (ret) goto err_core_put; + venus_assign_register_offsets(core); + ret = v4l2_device_register(dev, &core->v4l2_dev); if (ret) goto err_core_deinit; diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h index 0a90cd79104b..110287279f05 100644 --- a/drivers/media/platform/qcom/venus/core.h +++ b/drivers/media/platform/qcom/venus/core.h @@ -90,6 +90,11 @@ struct venus_format { * struct venus_core - holds core parameters valid for all instances * * @base: IO memory base address + * @vbif_base IO memory vbif base address + * @cpu_base IO memory cpu base address + * @cpu_cs_base IO memory cpu_cs base address + * @cpu_ic_base IO memory cpu_ic base address + * @wrapper_base IO memory wrapper base address * @irq: Venus irq * @clks: an array of struct clk pointers * @vcodec0_clks: an array of vcodec0 struct clk pointers @@ -122,6 +127,11 @@ struct venus_format { */ struct venus_core { void __iomem *base; + void __iomem *vbif_base; + void __iomem *cpu_base; + void __iomem *cpu_cs_base; + void __iomem *cpu_ic_base; + void __iomem *wrapper_base; int irq; struct clk *clks[VIDC_CLKS_NUM_MAX]; struct clk *vcodec0_clks[VIDC_VCODEC_CLKS_NUM_MAX]; From patchwork Fri Mar 12 17:30:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 398667 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1383459jai; Fri, 12 Mar 2021 09:30:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJxz5Uu+C+dCI3/M6ry5Zl+Vu5SxhxgxmxE8/YGHTEMWIOK571INFq4c4B66vhaiHVshN+wH X-Received: by 2002:a05:6402:3493:: with SMTP id v19mr9880522edc.355.1615570202999; Fri, 12 Mar 2021 09:30:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615570202; cv=none; d=google.com; s=arc-20160816; b=zPrePwHPg40RlAGDVjSKqOtfxPV8YuX5EFQCwvrtBgesv8BVXRrBiZwYd2FH8xqnLf 1oT7W5N9Muuwb2lqxwPcltZcEkLlXAP9YTMCcDGx2q5D0nsK7AyXQaYkx4XDeu/9G29/ sD0cGzDiy7zVUFqGgWyg5jzNX0JTtcGdADruF3YEWpMYCm1tWbsSI/8aV+n/IqFxyDom U808aTzq7okOMs6iiMPtoWUNZ9/XRaG3KvOakQWFAI41MrLBRa+qtDxUo4ZeA7mr7LkS U5aM0qm4zbV5wn02y2+CS+Pi+FJ7hI2stNoT0Nd1U2PinyAkYkysHaY5ZNkwy0eSiS85 lUew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=r3VPHqO4mG67G3XO/qgUwmeeueucvqFjM6Se2njI3O4=; b=PrSKTQHSHhBQSreD1326Rz3Qt+FTpnN/8oJr2HDMo4sLIO8xlQxLWdFJeB3Ea3l+LV iPdpF9OprJZhvXxo/N7Zv/yE1H69vpq+Uvufa4c+5XtfyJdoEcIPHA2m4wtzmKo2hplh ZWzmT2Agha03R5C6OQVWnyujLmukmUlICSBi8jGSRW5aGLsIq7i4pa3x0MfZxHOOZX6s FmdHpfIAwalQr7e+jhOyJpxCBT6adfjv2suKsw/3cxBbw0uaCJ9DSGY4Z24N6ammkxZk UBd86OecdHqqWaTzb+5OcrV624X66bObSfDKspiX4C/kaifin+VcXkJGyrTGe4xHKDDD 7BNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nQq2lHDY; spf=pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id ot6si4540497ejb.337.2021.03.12.09.30.02; Fri, 12 Mar 2021 09:30:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nQq2lHDY; spf=pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 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 S232623AbhCLR3Z (ORCPT + 3 others); Fri, 12 Mar 2021 12:29:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232732AbhCLR3S (ORCPT ); Fri, 12 Mar 2021 12:29:18 -0500 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C06CC061574 for ; Fri, 12 Mar 2021 09:29:18 -0800 (PST) Received: by mail-wm1-x335.google.com with SMTP id o26so4260003wmc.5 for ; Fri, 12 Mar 2021 09:29:18 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=r3VPHqO4mG67G3XO/qgUwmeeueucvqFjM6Se2njI3O4=; b=nQq2lHDYeD5S3p4p6H+Qkx0j+WNhopP7DARMT4YQbKAHMm1Csua3eeQuliKt083nbE zhCta6h7HIr4OfUo3YIwdxq4lp20sLXNSNSacCrtKqSSPIA8/FDXkCf3VgRzn2pYfpoR pTe1OLK9gcnIeXgjjC5TqkpCkAtgr9iKtmnII5HSVo/8QAK0EB+wdwe9CKoEtCwWk7CZ Rawjm9cKEeZkJ8ZJUZWeGP4izccj3t6smVWcsG/fOpDspJUjmZtSa5Y5e+6n4lSk1DAe 4CTx/IoLxda+TRRV1ycQF3t1eTQEMZj/R0S4UrHwN+I1d6rEma3rBef8S1gpFHKBGbY0 eTTw== 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:mime-version:content-transfer-encoding; bh=r3VPHqO4mG67G3XO/qgUwmeeueucvqFjM6Se2njI3O4=; b=JanItOa3aEzkjgxejpR7rlfZn2IgK/TcIgunpgo7l4+oIFLkZxwnnye+ei285FGQ3+ U7+pOwJCl8pi7uLnHWMN7zakPMcSjgkIACw4U9Q8PtzmmS9dk2Tt1SSMLYp4+TYNAwtD D7TjlbA2dMuC+N6K1XeuFAKGkZEkrgEP+ql/5vjaXBOSHRUc7K5nr8EWJOpyqsdIvcjb Oo+7AjqFugAWreDT9sZA086ncIADI3PlQ5mPAkpU55FARCDeNWZ2WPToCKoQeJlR7x5h TVeqanNvf28qh0NXa8XAKrQ16xxh3i2yCI4b3NGG43UYBSNNZoBBrcoRY8PpVqGqN5U3 coVA== X-Gm-Message-State: AOAM533yvmdj89fi+xdK25tUqbQTDZ0eeGI5n0qzb+abmTkNqMEb6UKD YK15FfKbtWCZ/gJBUIlvjaS7dA== X-Received: by 2002:a1c:7d4e:: with SMTP id y75mr14208166wmc.168.1615570156736; Fri, 12 Mar 2021 09:29:16 -0800 (PST) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id 18sm2876375wmj.21.2021.03.12.09.29.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 09:29:16 -0800 (PST) From: Bryan O'Donoghue To: stanimir.varbanov@linaro.org, agross@kernel.org, bjorn.andersson@linaro.org, mchehab@kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: bryan.odonoghue@linaro.org, dikshita@codeaurora.org, jonathan@marek.ca, vgarodia@codeaurora.org Subject: [PATCH v2 05/25] media: venus: hfi, pm, firmware: Convert to block relative addressing Date: Fri, 12 Mar 2021 17:30:19 +0000 Message-Id: <20210312173039.1387617-6-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210312173039.1387617-1-bryan.odonoghue@linaro.org> References: <20210312173039.1387617-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org An upcoming silicon change places a number of existing blocks within the Venus at different relative offsets to the base address of IO region. In order to handle this difference this patch changes the address offsets of the registers to function as offsets relative to the relevant sub-block of registers within the IO region not the base address of the IO region. As a result of this change venus_readl() and venus_writel() are deleted. Co-developed-by: Dikshita Agarwal Signed-off-by: Dikshita Agarwal Signed-off-by: Bryan O'Donoghue Acked-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/firmware.c | 28 +++---- drivers/media/platform/qcom/venus/hfi_venus.c | 82 ++++++++++--------- .../media/platform/qcom/venus/hfi_venus_io.h | 80 +++++++++--------- .../media/platform/qcom/venus/pm_helpers.c | 12 +-- 4 files changed, 105 insertions(+), 97 deletions(-) -- 2.30.1 diff --git a/drivers/media/platform/qcom/venus/firmware.c b/drivers/media/platform/qcom/venus/firmware.c index 2b1d95ecd381..8c2c68114bbd 100644 --- a/drivers/media/platform/qcom/venus/firmware.c +++ b/drivers/media/platform/qcom/venus/firmware.c @@ -27,19 +27,19 @@ static void venus_reset_cpu(struct venus_core *core) { u32 fw_size = core->fw.mapped_mem_size; - void __iomem *base = core->base; + void __iomem *wrapper_base = core->wrapper_base; - writel(0, base + WRAPPER_FW_START_ADDR); - writel(fw_size, base + WRAPPER_FW_END_ADDR); - writel(0, base + WRAPPER_CPA_START_ADDR); - writel(fw_size, base + WRAPPER_CPA_END_ADDR); - writel(fw_size, base + WRAPPER_NONPIX_START_ADDR); - writel(fw_size, base + WRAPPER_NONPIX_END_ADDR); - writel(0x0, base + WRAPPER_CPU_CGC_DIS); - writel(0x0, base + WRAPPER_CPU_CLOCK_CONFIG); + writel(0, wrapper_base + WRAPPER_FW_START_ADDR); + writel(fw_size, wrapper_base + WRAPPER_FW_END_ADDR); + writel(0, wrapper_base + WRAPPER_CPA_START_ADDR); + writel(fw_size, wrapper_base + WRAPPER_CPA_END_ADDR); + writel(fw_size, wrapper_base + WRAPPER_NONPIX_START_ADDR); + writel(fw_size, wrapper_base + WRAPPER_NONPIX_END_ADDR); + writel(0x0, wrapper_base + WRAPPER_CPU_CGC_DIS); + writel(0x0, wrapper_base + WRAPPER_CPU_CLOCK_CONFIG); /* Bring ARM9 out of reset */ - writel(0, base + WRAPPER_A9SS_SW_RESET); + writel(0, wrapper_base + WRAPPER_A9SS_SW_RESET); } int venus_set_hw_state(struct venus_core *core, bool resume) @@ -56,7 +56,7 @@ int venus_set_hw_state(struct venus_core *core, bool resume) if (resume) venus_reset_cpu(core); else - writel(1, core->base + WRAPPER_A9SS_SW_RESET); + writel(1, core->wrapper_base + WRAPPER_A9SS_SW_RESET); return 0; } @@ -159,12 +159,12 @@ static int venus_shutdown_no_tz(struct venus_core *core) size_t unmapped; u32 reg; struct device *dev = core->fw.dev; - void __iomem *base = core->base; + void __iomem *wrapper_base = core->wrapper_base; /* Assert the reset to ARM9 */ - reg = readl_relaxed(base + WRAPPER_A9SS_SW_RESET); + reg = readl_relaxed(wrapper_base + WRAPPER_A9SS_SW_RESET); reg |= WRAPPER_A9SS_SW_RESET_BIT; - writel_relaxed(reg, base + WRAPPER_A9SS_SW_RESET); + writel_relaxed(reg, wrapper_base + WRAPPER_A9SS_SW_RESET); /* Make sure reset is asserted before the mapping is removed */ mb(); diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c index 50e03f8fc278..f95cdd3d530c 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -345,16 +345,6 @@ static void venus_free(struct venus_hfi_device *hdev, struct mem_desc *mem) dma_free_attrs(dev, mem->size, mem->kva, mem->da, mem->attrs); } -static void venus_writel(struct venus_hfi_device *hdev, u32 reg, u32 value) -{ - writel(value, hdev->core->base + reg); -} - -static u32 venus_readl(struct venus_hfi_device *hdev, u32 reg) -{ - return readl(hdev->core->base + reg); -} - static void venus_set_registers(struct venus_hfi_device *hdev) { const struct venus_resources *res = hdev->core->res; @@ -363,12 +353,14 @@ static void venus_set_registers(struct venus_hfi_device *hdev) unsigned int i; for (i = 0; i < count; i++) - venus_writel(hdev, tbl[i].reg, tbl[i].value); + writel(tbl[i].value, hdev->core->base + tbl[i].reg); } static void venus_soft_int(struct venus_hfi_device *hdev) { - venus_writel(hdev, CPU_IC_SOFTINT, BIT(CPU_IC_SOFTINT_H2A_SHIFT)); + void __iomem *cpu_ic_base = hdev->core->cpu_ic_base; + + writel(BIT(CPU_IC_SOFTINT_H2A_SHIFT), cpu_ic_base + CPU_IC_SOFTINT); } static int venus_iface_cmdq_write_nolock(struct venus_hfi_device *hdev, @@ -452,14 +444,16 @@ static int venus_boot_core(struct venus_hfi_device *hdev) static const unsigned int max_tries = 100; u32 ctrl_status = 0; unsigned int count = 0; + void __iomem *cpu_cs_base = hdev->core->cpu_cs_base; + void __iomem *wrapper_base = hdev->core->wrapper_base; int ret = 0; - venus_writel(hdev, VIDC_CTRL_INIT, BIT(VIDC_CTRL_INIT_CTRL_SHIFT)); - venus_writel(hdev, WRAPPER_INTR_MASK, WRAPPER_INTR_MASK_A2HVCODEC_MASK); - venus_writel(hdev, CPU_CS_SCIACMDARG3, 1); + writel(BIT(VIDC_CTRL_INIT_CTRL_SHIFT), cpu_cs_base + VIDC_CTRL_INIT); + writel(WRAPPER_INTR_MASK_A2HVCODEC_MASK, wrapper_base + WRAPPER_INTR_MASK); + writel(1, cpu_cs_base + CPU_CS_SCIACMDARG3); while (!ctrl_status && count < max_tries) { - ctrl_status = venus_readl(hdev, CPU_CS_SCIACMDARG0); + ctrl_status = readl(cpu_cs_base + CPU_CS_SCIACMDARG0); if ((ctrl_status & CPU_CS_SCIACMDARG0_ERROR_STATUS_MASK) == 4) { dev_err(dev, "invalid setting for UC_REGION\n"); ret = -EINVAL; @@ -479,9 +473,11 @@ static int venus_boot_core(struct venus_hfi_device *hdev) static u32 venus_hwversion(struct venus_hfi_device *hdev) { struct device *dev = hdev->core->dev; - u32 ver = venus_readl(hdev, WRAPPER_HW_VERSION); + void __iomem *wrapper_base = hdev->core->wrapper_base; + u32 ver; u32 major, minor, step; + ver = readl(wrapper_base + WRAPPER_HW_VERSION); major = ver & WRAPPER_HW_VERSION_MAJOR_VERSION_MASK; major = major >> WRAPPER_HW_VERSION_MAJOR_VERSION_SHIFT; minor = ver & WRAPPER_HW_VERSION_MINOR_VERSION_MASK; @@ -496,6 +492,7 @@ static u32 venus_hwversion(struct venus_hfi_device *hdev) static int venus_run(struct venus_hfi_device *hdev) { struct device *dev = hdev->core->dev; + void __iomem *cpu_cs_base = hdev->core->cpu_cs_base; int ret; /* @@ -504,12 +501,12 @@ static int venus_run(struct venus_hfi_device *hdev) */ venus_set_registers(hdev); - venus_writel(hdev, UC_REGION_ADDR, hdev->ifaceq_table.da); - venus_writel(hdev, UC_REGION_SIZE, SHARED_QSIZE); - venus_writel(hdev, CPU_CS_SCIACMDARG2, hdev->ifaceq_table.da); - venus_writel(hdev, CPU_CS_SCIACMDARG1, 0x01); + writel(hdev->ifaceq_table.da, cpu_cs_base + UC_REGION_ADDR); + writel(SHARED_QSIZE, cpu_cs_base + UC_REGION_SIZE); + writel(hdev->ifaceq_table.da, cpu_cs_base + CPU_CS_SCIACMDARG2); + writel(0x01, cpu_cs_base + CPU_CS_SCIACMDARG1); if (hdev->sfr.da) - venus_writel(hdev, SFR_ADDR, hdev->sfr.da); + writel(hdev->sfr.da, cpu_cs_base + SFR_ADDR); ret = venus_boot_core(hdev); if (ret) { @@ -524,17 +521,18 @@ static int venus_run(struct venus_hfi_device *hdev) static int venus_halt_axi(struct venus_hfi_device *hdev) { - void __iomem *base = hdev->core->base; + void __iomem *wrapper_base = hdev->core->wrapper_base; + void __iomem *vbif_base = hdev->core->vbif_base; struct device *dev = hdev->core->dev; u32 val; int ret; if (IS_V4(hdev->core)) { - val = venus_readl(hdev, WRAPPER_CPU_AXI_HALT); + val = readl(wrapper_base + WRAPPER_CPU_AXI_HALT); val |= WRAPPER_CPU_AXI_HALT_HALT; - venus_writel(hdev, WRAPPER_CPU_AXI_HALT, val); + writel(val, wrapper_base + WRAPPER_CPU_AXI_HALT); - ret = readl_poll_timeout(base + WRAPPER_CPU_AXI_HALT_STATUS, + ret = readl_poll_timeout(wrapper_base + WRAPPER_CPU_AXI_HALT_STATUS, val, val & WRAPPER_CPU_AXI_HALT_STATUS_IDLE, POLL_INTERVAL_US, @@ -548,12 +546,12 @@ static int venus_halt_axi(struct venus_hfi_device *hdev) } /* Halt AXI and AXI IMEM VBIF Access */ - val = venus_readl(hdev, VBIF_AXI_HALT_CTRL0); + val = readl(vbif_base + VBIF_AXI_HALT_CTRL0); val |= VBIF_AXI_HALT_CTRL0_HALT_REQ; - venus_writel(hdev, VBIF_AXI_HALT_CTRL0, val); + writel(val, vbif_base + VBIF_AXI_HALT_CTRL0); /* Request for AXI bus port halt */ - ret = readl_poll_timeout(base + VBIF_AXI_HALT_CTRL1, val, + ret = readl_poll_timeout(vbif_base + VBIF_AXI_HALT_CTRL1, val, val & VBIF_AXI_HALT_CTRL1_HALT_ACK, POLL_INTERVAL_US, VBIF_AXI_HALT_ACK_TIMEOUT_US); @@ -1046,19 +1044,21 @@ static irqreturn_t venus_isr(struct venus_core *core) { struct venus_hfi_device *hdev = to_hfi_priv(core); u32 status; + void __iomem *cpu_cs_base = hdev->core->cpu_cs_base; + void __iomem *wrapper_base = hdev->core->wrapper_base; if (!hdev) return IRQ_NONE; - status = venus_readl(hdev, WRAPPER_INTR_STATUS); + status = readl(wrapper_base + WRAPPER_INTR_STATUS); if (status & WRAPPER_INTR_STATUS_A2H_MASK || status & WRAPPER_INTR_STATUS_A2HWD_MASK || status & CPU_CS_SCIACMDARG0_INIT_IDLE_MSG_MASK) hdev->irq_status = status; - venus_writel(hdev, CPU_CS_A2HSOFTINTCLR, 1); - venus_writel(hdev, WRAPPER_INTR_CLEAR, status); + writel(1, cpu_cs_base + CPU_CS_A2HSOFTINTCLR); + writel(status, wrapper_base + WRAPPER_INTR_CLEAR); return IRQ_WAKE_THREAD; } @@ -1391,6 +1391,7 @@ static int venus_suspend_1xx(struct venus_core *core) { struct venus_hfi_device *hdev = to_hfi_priv(core); struct device *dev = core->dev; + void __iomem *cpu_cs_base = hdev->core->cpu_cs_base; u32 ctrl_status; int ret; @@ -1425,7 +1426,7 @@ static int venus_suspend_1xx(struct venus_core *core) return -EINVAL; } - ctrl_status = venus_readl(hdev, CPU_CS_SCIACMDARG0); + ctrl_status = readl(cpu_cs_base + CPU_CS_SCIACMDARG0); if (!(ctrl_status & CPU_CS_SCIACMDARG0_PC_READY)) { mutex_unlock(&hdev->lock); return -EINVAL; @@ -1446,10 +1447,12 @@ static int venus_suspend_1xx(struct venus_core *core) static bool venus_cpu_and_video_core_idle(struct venus_hfi_device *hdev) { + void __iomem *wrapper_base = hdev->core->wrapper_base; + void __iomem *cpu_cs_base = hdev->core->cpu_cs_base; u32 ctrl_status, cpu_status; - cpu_status = venus_readl(hdev, WRAPPER_CPU_STATUS); - ctrl_status = venus_readl(hdev, CPU_CS_SCIACMDARG0); + cpu_status = readl(wrapper_base + WRAPPER_CPU_STATUS); + ctrl_status = readl(cpu_cs_base + CPU_CS_SCIACMDARG0); if (cpu_status & WRAPPER_CPU_STATUS_WFI && ctrl_status & CPU_CS_SCIACMDARG0_INIT_IDLE_MSG_MASK) @@ -1460,10 +1463,12 @@ static bool venus_cpu_and_video_core_idle(struct venus_hfi_device *hdev) static bool venus_cpu_idle_and_pc_ready(struct venus_hfi_device *hdev) { + void __iomem *wrapper_base = hdev->core->wrapper_base; + void __iomem *cpu_cs_base = hdev->core->cpu_cs_base; u32 ctrl_status, cpu_status; - cpu_status = venus_readl(hdev, WRAPPER_CPU_STATUS); - ctrl_status = venus_readl(hdev, CPU_CS_SCIACMDARG0); + cpu_status = readl(wrapper_base + WRAPPER_CPU_STATUS); + ctrl_status = readl(cpu_cs_base + CPU_CS_SCIACMDARG0); if (cpu_status & WRAPPER_CPU_STATUS_WFI && ctrl_status & CPU_CS_SCIACMDARG0_PC_READY) @@ -1476,6 +1481,7 @@ static int venus_suspend_3xx(struct venus_core *core) { struct venus_hfi_device *hdev = to_hfi_priv(core); struct device *dev = core->dev; + void __iomem *cpu_cs_base = hdev->core->cpu_cs_base; u32 ctrl_status; bool val; int ret; @@ -1492,7 +1498,7 @@ static int venus_suspend_3xx(struct venus_core *core) return -EINVAL; } - ctrl_status = venus_readl(hdev, CPU_CS_SCIACMDARG0); + ctrl_status = readl(cpu_cs_base + CPU_CS_SCIACMDARG0); if (ctrl_status & CPU_CS_SCIACMDARG0_PC_READY) goto power_off; diff --git a/drivers/media/platform/qcom/venus/hfi_venus_io.h b/drivers/media/platform/qcom/venus/hfi_venus_io.h index 3b52f98478db..4c392b67252c 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus_io.h +++ b/drivers/media/platform/qcom/venus/hfi_venus_io.h @@ -8,27 +8,28 @@ #define VBIF_BASE 0x80000 -#define VBIF_AXI_HALT_CTRL0 (VBIF_BASE + 0x208) -#define VBIF_AXI_HALT_CTRL1 (VBIF_BASE + 0x20c) +#define VBIF_AXI_HALT_CTRL0 0x208 +#define VBIF_AXI_HALT_CTRL1 0x20c #define VBIF_AXI_HALT_CTRL0_HALT_REQ BIT(0) #define VBIF_AXI_HALT_CTRL1_HALT_ACK BIT(0) #define VBIF_AXI_HALT_ACK_TIMEOUT_US 500000 #define CPU_BASE 0xc0000 + #define CPU_CS_BASE (CPU_BASE + 0x12000) #define CPU_IC_BASE (CPU_BASE + 0x1f000) -#define CPU_CS_A2HSOFTINTCLR (CPU_CS_BASE + 0x1c) +#define CPU_CS_A2HSOFTINTCLR 0x1c -#define VIDC_CTRL_INIT (CPU_CS_BASE + 0x48) +#define VIDC_CTRL_INIT 0x48 #define VIDC_CTRL_INIT_RESERVED_BITS31_1_MASK 0xfffffffe #define VIDC_CTRL_INIT_RESERVED_BITS31_1_SHIFT 1 #define VIDC_CTRL_INIT_CTRL_MASK 0x1 #define VIDC_CTRL_INIT_CTRL_SHIFT 0 /* HFI control status */ -#define CPU_CS_SCIACMDARG0 (CPU_CS_BASE + 0x4c) +#define CPU_CS_SCIACMDARG0 0x4c #define CPU_CS_SCIACMDARG0_MASK 0xff #define CPU_CS_SCIACMDARG0_SHIFT 0x0 #define CPU_CS_SCIACMDARG0_ERROR_STATUS_MASK 0xfe @@ -39,42 +40,43 @@ #define CPU_CS_SCIACMDARG0_INIT_IDLE_MSG_MASK BIT(30) /* HFI queue table info */ -#define CPU_CS_SCIACMDARG1 (CPU_CS_BASE + 0x50) +#define CPU_CS_SCIACMDARG1 0x50 /* HFI queue table address */ -#define CPU_CS_SCIACMDARG2 (CPU_CS_BASE + 0x54) +#define CPU_CS_SCIACMDARG2 0x54 /* Venus cpu */ -#define CPU_CS_SCIACMDARG3 (CPU_CS_BASE + 0x58) +#define CPU_CS_SCIACMDARG3 0x58 -#define SFR_ADDR (CPU_CS_BASE + 0x5c) -#define MMAP_ADDR (CPU_CS_BASE + 0x60) -#define UC_REGION_ADDR (CPU_CS_BASE + 0x64) -#define UC_REGION_SIZE (CPU_CS_BASE + 0x68) +#define SFR_ADDR 0x5c +#define MMAP_ADDR 0x60 +#define UC_REGION_ADDR 0x64 +#define UC_REGION_SIZE 0x68 -#define CPU_IC_SOFTINT (CPU_IC_BASE + 0x18) +/* Relative to CPU_IC_BASE */ +#define CPU_IC_SOFTINT 0x18 #define CPU_IC_SOFTINT_H2A_MASK 0x8000 #define CPU_IC_SOFTINT_H2A_SHIFT 0xf /* Venus wrapper */ #define WRAPPER_BASE 0x000e0000 -#define WRAPPER_HW_VERSION (WRAPPER_BASE + 0x00) +#define WRAPPER_HW_VERSION 0x00 #define WRAPPER_HW_VERSION_MAJOR_VERSION_MASK 0x78000000 #define WRAPPER_HW_VERSION_MAJOR_VERSION_SHIFT 28 #define WRAPPER_HW_VERSION_MINOR_VERSION_MASK 0xfff0000 #define WRAPPER_HW_VERSION_MINOR_VERSION_SHIFT 16 #define WRAPPER_HW_VERSION_STEP_VERSION_MASK 0xffff -#define WRAPPER_CLOCK_CONFIG (WRAPPER_BASE + 0x04) +#define WRAPPER_CLOCK_CONFIG 0x04 -#define WRAPPER_INTR_STATUS (WRAPPER_BASE + 0x0c) +#define WRAPPER_INTR_STATUS 0x0c #define WRAPPER_INTR_STATUS_A2HWD_MASK 0x10 #define WRAPPER_INTR_STATUS_A2HWD_SHIFT 0x4 #define WRAPPER_INTR_STATUS_A2H_MASK 0x4 #define WRAPPER_INTR_STATUS_A2H_SHIFT 0x2 -#define WRAPPER_INTR_MASK (WRAPPER_BASE + 0x10) +#define WRAPPER_INTR_MASK 0x10 #define WRAPPER_INTR_MASK_A2HWD_BASK 0x10 #define WRAPPER_INTR_MASK_A2HWD_SHIFT 0x4 #define WRAPPER_INTR_MASK_A2HVCODEC_MASK 0x8 @@ -82,41 +84,41 @@ #define WRAPPER_INTR_MASK_A2HCPU_MASK 0x4 #define WRAPPER_INTR_MASK_A2HCPU_SHIFT 0x2 -#define WRAPPER_INTR_CLEAR (WRAPPER_BASE + 0x14) +#define WRAPPER_INTR_CLEAR 0x14 #define WRAPPER_INTR_CLEAR_A2HWD_MASK 0x10 #define WRAPPER_INTR_CLEAR_A2HWD_SHIFT 0x4 #define WRAPPER_INTR_CLEAR_A2H_MASK 0x4 #define WRAPPER_INTR_CLEAR_A2H_SHIFT 0x2 -#define WRAPPER_POWER_STATUS (WRAPPER_BASE + 0x44) -#define WRAPPER_VDEC_VCODEC_POWER_CONTROL (WRAPPER_BASE + 0x48) -#define WRAPPER_VENC_VCODEC_POWER_CONTROL (WRAPPER_BASE + 0x4c) -#define WRAPPER_VDEC_VENC_AHB_BRIDGE_SYNC_RESET (WRAPPER_BASE + 0x64) +#define WRAPPER_POWER_STATUS 0x44 +#define WRAPPER_VDEC_VCODEC_POWER_CONTROL 0x48 +#define WRAPPER_VENC_VCODEC_POWER_CONTROL 0x4c +#define WRAPPER_VDEC_VENC_AHB_BRIDGE_SYNC_RESET 0x64 -#define WRAPPER_CPU_CLOCK_CONFIG (WRAPPER_BASE + 0x2000) -#define WRAPPER_CPU_AXI_HALT (WRAPPER_BASE + 0x2008) +#define WRAPPER_CPU_CLOCK_CONFIG 0x2000 +#define WRAPPER_CPU_AXI_HALT 0x2008 #define WRAPPER_CPU_AXI_HALT_HALT BIT(16) -#define WRAPPER_CPU_AXI_HALT_STATUS (WRAPPER_BASE + 0x200c) +#define WRAPPER_CPU_AXI_HALT_STATUS 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) +#define WRAPPER_CPU_CGC_DIS 0x2010 +#define WRAPPER_CPU_STATUS 0x2014 #define WRAPPER_CPU_STATUS_WFI BIT(0) -#define WRAPPER_SW_RESET (WRAPPER_BASE + 0x3000) -#define WRAPPER_CPA_START_ADDR (WRAPPER_BASE + 0x1020) -#define WRAPPER_CPA_END_ADDR (WRAPPER_BASE + 0x1024) -#define WRAPPER_FW_START_ADDR (WRAPPER_BASE + 0x1028) -#define WRAPPER_FW_END_ADDR (WRAPPER_BASE + 0x102C) -#define WRAPPER_NONPIX_START_ADDR (WRAPPER_BASE + 0x1030) -#define WRAPPER_NONPIX_END_ADDR (WRAPPER_BASE + 0x1034) -#define WRAPPER_A9SS_SW_RESET (WRAPPER_BASE + 0x3000) +#define WRAPPER_SW_RESET 0x3000 +#define WRAPPER_CPA_START_ADDR 0x1020 +#define WRAPPER_CPA_END_ADDR 0x1024 +#define WRAPPER_FW_START_ADDR 0x1028 +#define WRAPPER_FW_END_ADDR 0x102C +#define WRAPPER_NONPIX_START_ADDR 0x1030 +#define WRAPPER_NONPIX_END_ADDR 0x1034 +#define WRAPPER_A9SS_SW_RESET 0x3000 #define WRAPPER_A9SS_SW_RESET_BIT BIT(4) /* Venus 4xx */ -#define WRAPPER_VCODEC0_MMCC_POWER_STATUS (WRAPPER_BASE + 0x90) -#define WRAPPER_VCODEC0_MMCC_POWER_CONTROL (WRAPPER_BASE + 0x94) +#define WRAPPER_VCODEC0_MMCC_POWER_STATUS 0x90 +#define WRAPPER_VCODEC0_MMCC_POWER_CONTROL 0x94 -#define WRAPPER_VCODEC1_MMCC_POWER_STATUS (WRAPPER_BASE + 0x110) -#define WRAPPER_VCODEC1_MMCC_POWER_CONTROL (WRAPPER_BASE + 0x114) +#define WRAPPER_VCODEC1_MMCC_POWER_STATUS 0x110 +#define WRAPPER_VCODEC1_MMCC_POWER_CONTROL 0x114 #endif diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c index 794c2d6f0543..ccbbac2036d2 100644 --- a/drivers/media/platform/qcom/venus/pm_helpers.c +++ b/drivers/media/platform/qcom/venus/pm_helpers.c @@ -323,9 +323,9 @@ vcodec_control_v3(struct venus_core *core, u32 session_type, bool enable) void __iomem *ctrl; if (session_type == VIDC_SESSION_TYPE_DEC) - ctrl = core->base + WRAPPER_VDEC_VCODEC_POWER_CONTROL; + ctrl = core->wrapper_base + WRAPPER_VDEC_VCODEC_POWER_CONTROL; else - ctrl = core->base + WRAPPER_VENC_VCODEC_POWER_CONTROL; + ctrl = core->wrapper_base + WRAPPER_VENC_VCODEC_POWER_CONTROL; if (enable) writel(0, ctrl); @@ -401,11 +401,11 @@ static int vcodec_control_v4(struct venus_core *core, u32 coreid, bool enable) int ret; if (coreid == VIDC_CORE_ID_1) { - ctrl = core->base + WRAPPER_VCODEC0_MMCC_POWER_CONTROL; - stat = core->base + WRAPPER_VCODEC0_MMCC_POWER_STATUS; + ctrl = core->wrapper_base + WRAPPER_VCODEC0_MMCC_POWER_CONTROL; + stat = core->wrapper_base + WRAPPER_VCODEC0_MMCC_POWER_STATUS; } else { - ctrl = core->base + WRAPPER_VCODEC1_MMCC_POWER_CONTROL; - stat = core->base + WRAPPER_VCODEC1_MMCC_POWER_STATUS; + ctrl = core->wrapper_base + WRAPPER_VCODEC1_MMCC_POWER_CONTROL; + stat = core->wrapper_base + WRAPPER_VCODEC1_MMCC_POWER_STATUS; } if (enable) { From patchwork Fri Mar 12 17:30:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 399116 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 48F05C4360C for ; Fri, 12 Mar 2021 17:29:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2812D64F6D for ; Fri, 12 Mar 2021 17:29:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232659AbhCLR3Z (ORCPT ); Fri, 12 Mar 2021 12:29:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232176AbhCLR3T (ORCPT ); Fri, 12 Mar 2021 12:29:19 -0500 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3CB68C061761 for ; Fri, 12 Mar 2021 09:29:19 -0800 (PST) Received: by mail-wr1-x429.google.com with SMTP id j7so2205128wrd.1 for ; Fri, 12 Mar 2021 09:29:19 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=//Lf2E+FwfUxhoM1H7CSX+v4f8W4Os22eBseL5ilxQ4=; b=tEjisLsOKcUreRdPy2nqewRCnH+dXcnokK94YS9w3cNsWtXaDlU9EDeIYWzZutQR4Y inOtu4FCE7y6VALgXCgYoRCoAj06Re9tLMzs6OCJCxOJ7BcjrENmHUfoBQ5wDKBtHmUB Z932ZbI78UdiVhExYMyvhNFoJfBHpzUaLa4Q87oZY9kL/cf6EfOjjyfwFnw0VKQZ0PYL 6ParJ/2GOfpDKFICNifPd2kVTLVvcoPG1W3bGiHi8Ch0qdM36ZwzW+hurxE/TllLmoTn MloZxF0sunwxM5HWM7sE4XoIUfJhEjjkpHp5AQ1dDtHRU3Wlb4C5N1tMFcZTPqEhnW3n Oh8Q== 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:mime-version:content-transfer-encoding; bh=//Lf2E+FwfUxhoM1H7CSX+v4f8W4Os22eBseL5ilxQ4=; b=iEOWKz4hgNtPRr+Z4EGTrPirchU5U8Brbc+OJg2/fiQWLOzWYwrjCeWM1ifHl4Q4PR /L42ogI08tFQ1hVCEoNjIck6PDgyh/o0Oql0GdfR0rveiK4wGRvm0mu7tHv7Nxa3w5To Bd0RRnW2FpwHAnc45raF/aHL3VEtoXVJnRYg4zTNwfo360cQh56MmGanJfzbsAe3TgdY hg2GnlPT5TLjoblnKndX9hQsvmapOWDa9FYU+LPn39B/uPYSBa9KvamVOSc59AjBDeD6 tMdlAoNwFLyUJwQ4wfLw/3JiM7gFcmwqOYKLYPOjpigf1EynddyrKYPc8SlJ3Lw7uvA9 bMgA== X-Gm-Message-State: AOAM532/LpxJLfl8vqOO2o9qS4ObCzi47qeTmnBgrrP8GcOMKoVKG7T8 klJNSTDjIEtXBmr65R+hSJRiag== X-Google-Smtp-Source: ABdhPJzwL9M4cvWyMnjfJMI6giXJ1Rk2URlH+FC0YBSBXT/QEJd/rzmJqBSp8FCYzlQoRTWz28eZhA== X-Received: by 2002:adf:bc01:: with SMTP id s1mr15269477wrg.240.1615570157988; Fri, 12 Mar 2021 09:29:17 -0800 (PST) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id 18sm2876375wmj.21.2021.03.12.09.29.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 09:29:17 -0800 (PST) From: Bryan O'Donoghue To: stanimir.varbanov@linaro.org, agross@kernel.org, bjorn.andersson@linaro.org, mchehab@kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: bryan.odonoghue@linaro.org, dikshita@codeaurora.org, jonathan@marek.ca, vgarodia@codeaurora.org Subject: [PATCH v2 06/25] media: venus: hfi: Define block offsets for V6 hardware Date: Fri, 12 Mar 2021 17:30:20 +0000 Message-Id: <20210312173039.1387617-7-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210312173039.1387617-1-bryan.odonoghue@linaro.org> References: <20210312173039.1387617-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Dikshita Agarwal This commit defines a range of new base addresses for already defined blocks. - CPU_BASE_V6 - CPU_CS_BASE_V6 - CPU_IC_BASE_V6 - WRAPPER_BASE_V6 The base addresses of the blocks are slightly different for 6xx but, aside from that are layout and bit compatible. New 6xx specific block addresses will be added in separate commits. Signed-off-by: Dikshita Agarwal Co-developed-by: Bryan O'Donoghue Signed-off-by: Bryan O'Donoghue Acked-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/hfi_venus_io.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/media/platform/qcom/venus/hfi_venus_io.h b/drivers/media/platform/qcom/venus/hfi_venus_io.h index 4c392b67252c..8604b213f03f 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus_io.h +++ b/drivers/media/platform/qcom/venus/hfi_venus_io.h @@ -19,6 +19,9 @@ #define CPU_CS_BASE (CPU_BASE + 0x12000) #define CPU_IC_BASE (CPU_BASE + 0x1f000) +#define CPU_BASE_V6 0xa0000 +#define CPU_CS_BASE_V6 CPU_BASE_V6 +#define CPU_IC_BASE_V6 (CPU_BASE_V6 + 0x138) #define CPU_CS_A2HSOFTINTCLR 0x1c @@ -59,6 +62,7 @@ #define CPU_IC_SOFTINT_H2A_SHIFT 0xf /* Venus wrapper */ +#define WRAPPER_BASE_V6 0x000b0000 #define WRAPPER_BASE 0x000e0000 #define WRAPPER_HW_VERSION 0x00 From patchwork Fri Mar 12 17:30:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 399862 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D518C4161F for ; Fri, 12 Mar 2021 17:29:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 76DD765037 for ; Fri, 12 Mar 2021 17:29:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232697AbhCLR31 (ORCPT ); Fri, 12 Mar 2021 12:29:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232768AbhCLR3U (ORCPT ); Fri, 12 Mar 2021 12:29:20 -0500 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49BBCC061574 for ; Fri, 12 Mar 2021 09:29:20 -0800 (PST) Received: by mail-wr1-x42b.google.com with SMTP id l12so5247221wry.2 for ; Fri, 12 Mar 2021 09:29:20 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=TCL7COtEazgKNnpkeM7OqtLt9j3hJXURS4OXneJfOeM=; b=i0I7Itab/QwS/dWgEZtR6Mz/+tsW2eTvp/FAYvIsLqqSUd+jGkH+Cf5kE0GH1DRti0 KXv0bSDRZf5RUir1Lkt9FYGidMc1SzXBIC8OzfKLWxocjY+LwSxSHFDJFxspoyYK+KUx 1R9LqDNFF/IpbBzItj6zE9i2KOYoHYTLv+gi9ORWCjqg/QQKOntqrDSCKknyALX1dgf2 1lK/bDIYdrj+uLC+NR74kHrPA1PDeQpvvMunSSdLZexrFK0U8/FnNagGlIHh2/wJ7Yh4 +DVmWi0LUFQaAMVvS5HHlWiyn5oWF1n+iLyeSdy5XMQnqzxymQSnuo/yeTbYfPcfjXnj wufQ== 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:mime-version:content-transfer-encoding; bh=TCL7COtEazgKNnpkeM7OqtLt9j3hJXURS4OXneJfOeM=; b=GpLo1uy9N5ifXwr9XlXArdjoqbniuaXmcG13ho+VYpjm6eltkFYyyRaxG6jnDAQgQg KggjyF/OECCibukv5qz2wU8xW/TpFMSX5hhUcGdIWJOKhgONQanunFtWFCg+01Kg+qiL 58CPZEM+ElyjCRB1UTxJXUdfJaInsT0/1Mp9vS4Z6ByuI9SFbRLyLWxU5C49+A6/K9xx oTd/bKbyn75dkamIXpX6RMzFJx/18hPmxkTTPz5XIEkGwxtMo3uwG7X+RfOs5X6wZtCC MhujsTIfX3j5dPQC/Nn4tqUj3qUtpcSftGZG3yl7VZh6bviTJDMa8BaUw4FzsYtmckjL ENCw== X-Gm-Message-State: AOAM533yWrGET1+dSgZF+JLIcoCeNy9eTXc7rVc+dRvrslB7CxluvHAZ NwL6mA7plUEXjmwVnEHzzhUpvg== X-Google-Smtp-Source: ABdhPJwZVlyZEJrTB4rnm7+zr1kvGNmqDIIp+AcdrB71hZAr7eSmwKDFjf4vgOdVSISaYhwPOIUPnA== X-Received: by 2002:adf:a4d1:: with SMTP id h17mr15234375wrb.57.1615570159005; Fri, 12 Mar 2021 09:29:19 -0800 (PST) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id 18sm2876375wmj.21.2021.03.12.09.29.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 09:29:18 -0800 (PST) From: Bryan O'Donoghue To: stanimir.varbanov@linaro.org, agross@kernel.org, bjorn.andersson@linaro.org, mchehab@kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: bryan.odonoghue@linaro.org, dikshita@codeaurora.org, jonathan@marek.ca, vgarodia@codeaurora.org Subject: [PATCH v2 07/25] media: venus: hfi: Define additional 6xx registers Date: Fri, 12 Mar 2021 17:30:21 +0000 Message-Id: <20210312173039.1387617-8-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210312173039.1387617-1-bryan.odonoghue@linaro.org> References: <20210312173039.1387617-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Dikshita Agarwal - Add X2 RPMh registers and definitions from the downstream example. - Add 6xx core power definitions - Add 6xx AON definitions - Add 6xx wrapper tz definitions - Add 6xx wrapper interrupt definitions - Add 6xx soft interrupt definitions - Define wrapper LPI register offsets Signed-off-by: Dikshita Agarwal Co-developed-by: Bryan O'Donoghue Signed-off-by: Bryan O'Donoghue --- .../media/platform/qcom/venus/hfi_venus_io.h | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/drivers/media/platform/qcom/venus/hfi_venus_io.h b/drivers/media/platform/qcom/venus/hfi_venus_io.h index 8604b213f03f..300c6e47e72f 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus_io.h +++ b/drivers/media/platform/qcom/venus/hfi_venus_io.h @@ -56,10 +56,22 @@ #define UC_REGION_ADDR 0x64 #define UC_REGION_SIZE 0x68 +#define CPU_CS_H2XSOFTINTEN_V6 0x148 + +#define CPU_CS_X2RPMH_V6 0x168 +#define CPU_CS_X2RPMH_MASK0_BMSK_V6 0x1 +#define CPU_CS_X2RPMH_MASK0_SHFT_V6 0x0 +#define CPU_CS_X2RPMH_MASK1_BMSK_V6 0x2 +#define CPU_CS_X2RPMH_MASK1_SHFT_V6 0x1 +#define CPU_CS_X2RPMH_SWOVERRIDE_BMSK_V6 0x4 +#define CPU_CS_X2RPMH_SWOVERRIDE_SHFT_V6 0x3 + /* Relative to CPU_IC_BASE */ #define CPU_IC_SOFTINT 0x18 +#define CPU_IC_SOFTINT_V6 0x150 #define CPU_IC_SOFTINT_H2A_MASK 0x8000 #define CPU_IC_SOFTINT_H2A_SHIFT 0xf +#define CPU_IC_SOFTINT_H2A_SHIFT_V6 0x0 /* Venus wrapper */ #define WRAPPER_BASE_V6 0x000b0000 @@ -88,6 +100,9 @@ #define WRAPPER_INTR_MASK_A2HCPU_MASK 0x4 #define WRAPPER_INTR_MASK_A2HCPU_SHIFT 0x2 +#define WRAPPER_INTR_STATUS_A2HWD_MASK_V6 0x8 +#define WRAPPER_INTR_MASK_A2HWD_BASK_V6 0x8 + #define WRAPPER_INTR_CLEAR 0x14 #define WRAPPER_INTR_CLEAR_A2HWD_MASK 0x10 #define WRAPPER_INTR_CLEAR_A2HWD_SHIFT 0x4 @@ -97,6 +112,8 @@ #define WRAPPER_POWER_STATUS 0x44 #define WRAPPER_VDEC_VCODEC_POWER_CONTROL 0x48 #define WRAPPER_VENC_VCODEC_POWER_CONTROL 0x4c +#define WRAPPER_DEBUG_BRIDGE_LPI_CONTROL_V6 0x54 +#define WRAPPER_DEBUG_BRIDGE_LPI_STATUS_V6 0x58 #define WRAPPER_VDEC_VENC_AHB_BRIDGE_SYNC_RESET 0x64 #define WRAPPER_CPU_CLOCK_CONFIG 0x2000 @@ -125,4 +142,17 @@ #define WRAPPER_VCODEC1_MMCC_POWER_STATUS 0x110 #define WRAPPER_VCODEC1_MMCC_POWER_CONTROL 0x114 +/* Venus 6xx */ +#define WRAPPER_CORE_POWER_STATUS_V6 0x80 +#define WRAPPER_CORE_POWER_CONTROL_V6 0x84 + +/* Wrapper TZ 6xx */ +#define WRAPPER_TZ_BASE_V6 0x000c0000 +#define WRAPPER_TZ_CPU_STATUS_V6 0x10 + +/* Venus AON */ +#define AON_BASE_V6 0x000e0000 +#define AON_WRAPPER_MVP_NOC_LPI_CONTROL 0x00 +#define AON_WRAPPER_MVP_NOC_LPI_STATUS 0x04 + #endif From patchwork Fri Mar 12 17:30:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 399115 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88897C43142 for ; Fri, 12 Mar 2021 17:29:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6399564F6D for ; Fri, 12 Mar 2021 17:29:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232709AbhCLR32 (ORCPT ); Fri, 12 Mar 2021 12:29:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232814AbhCLR3V (ORCPT ); Fri, 12 Mar 2021 12:29:21 -0500 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 401EDC061761 for ; Fri, 12 Mar 2021 09:29:21 -0800 (PST) Received: by mail-wm1-x330.google.com with SMTP id g8so4268412wmd.4 for ; Fri, 12 Mar 2021 09:29:21 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=ns2FNG0XYO8CSarlZvsWL5K0oFxStVf7JDc9WV+CdgM=; b=oRwI0GNv26UBWNzWGgBeK3oJP3HbQlSskJYVRCfDP+KXBI6dHxKNFYfL1Sbv6txdpL j9MopI20nH2y5mT5ZfdsMyQjsyN1VWeyoBwPUJhtnwLi1tvPknpimzEzZjBilFa/lJjo WoeAoipB2JEzTb0G6eAVqjzkd9Gle9CafmiV8sHQwsaCKNJy7/a94aRMTt10l99YeNXG pB2AFFn05z3i1uCQwe8931qbgXM2jXIJj/BQrYy/ddBJGZ6NF2rUXBs+ronCObqEBEKA VpWuMRYCDegk1cgBXqMSoEIkcytp4oRgbWreBOPeZATC6IgULsOgr9Invp3jopW7Eazz nepg== 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:mime-version:content-transfer-encoding; bh=ns2FNG0XYO8CSarlZvsWL5K0oFxStVf7JDc9WV+CdgM=; b=fWEZSb6ECg9oLDj2Kr6TZ9rfglhdRJGSBMUpHmifoJyjFCWDo8wcruQKOM2DZ1ZMVv qOzKDWjUbXQcdMXPSSFJgCGVES0qtWfwGPIKx4ASGLb7B6H/unye8RGOxpPDyKEBn5GC y3rSgUR6W59ljQHgRLMyiDHeKAn222HoQv9rbyxXyNFbm8yaZTKnOR1OXBHhuTIrKh8Z dk37ASgfXvyxoIe902hkSsV3DZT/eF0Ki9aB+oV744ctLi6bLV3gwxCB0sLD7l2b9DgG rhGV7sGdqr9l8erLqxEqSkOpP9W4YYnf9jnZThMKW/wvobGU2/7HWygw5mFEAhKkQ2Pg Bzkg== X-Gm-Message-State: AOAM532xy3EmVsQFa+g09qEp/y+0ZkwlhPgHfmNjcKlprQgoAP4xjiQJ KP4u5oVse+O40aVktsMVrihg+Q== X-Google-Smtp-Source: ABdhPJyBL/4NyRuIxbyGrl0e1OrVsgCWFkCT/F20gthq+7JilL66jFjcVQsz0AkRWAzYJps/kf6lxg== X-Received: by 2002:a05:600c:2145:: with SMTP id v5mr14373934wml.65.1615570160033; Fri, 12 Mar 2021 09:29:20 -0800 (PST) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id 18sm2876375wmj.21.2021.03.12.09.29.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 09:29:19 -0800 (PST) From: Bryan O'Donoghue To: stanimir.varbanov@linaro.org, agross@kernel.org, bjorn.andersson@linaro.org, mchehab@kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: bryan.odonoghue@linaro.org, dikshita@codeaurora.org, jonathan@marek.ca, vgarodia@codeaurora.org Subject: [PATCH v2 08/25] media: venus: core: Add differentiator IS_V6(core) Date: Fri, 12 Mar 2021 17:30:22 +0000 Message-Id: <20210312173039.1387617-9-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210312173039.1387617-1-bryan.odonoghue@linaro.org> References: <20210312173039.1387617-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org This commit adds the macro helper IS_V6() which will be used to differentiate iris2/v6 silicon from previous versions. Signed-off-by: Bryan O'Donoghue --- drivers/media/platform/qcom/venus/core.h | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h index 110287279f05..85047806142f 100644 --- a/drivers/media/platform/qcom/venus/core.h +++ b/drivers/media/platform/qcom/venus/core.h @@ -420,6 +420,7 @@ struct venus_inst { #define IS_V1(core) ((core)->res->hfi_version == HFI_VERSION_1XX) #define IS_V3(core) ((core)->res->hfi_version == HFI_VERSION_3XX) #define IS_V4(core) ((core)->res->hfi_version == HFI_VERSION_4XX) +#define IS_V6(core) ((core)->res->hfi_version == HFI_VERSION_6XX) #define ctrl_to_inst(ctrl) \ container_of((ctrl)->handler, struct venus_inst, ctrl_handler) From patchwork Fri Mar 12 17:30:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 399114 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9EFCAC1550C for ; Fri, 12 Mar 2021 17:29:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8D61465030 for ; Fri, 12 Mar 2021 17:29:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232516AbhCLR32 (ORCPT ); Fri, 12 Mar 2021 12:29:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232828AbhCLR3W (ORCPT ); Fri, 12 Mar 2021 12:29:22 -0500 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A44CC061574 for ; Fri, 12 Mar 2021 09:29:22 -0800 (PST) Received: by mail-wm1-x32f.google.com with SMTP id u5-20020a7bcb050000b029010e9316b9d5so12670800wmj.2 for ; Fri, 12 Mar 2021 09:29:22 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=nQCW8ZwYzo22rvcQzFUBZHnTB+UpuvDUuYoHvF9lN9M=; b=UKfKk7uXleTe7zuOxsmJ8L5O7+o7WvS/kHu/FM0suoWy1OVfE27YHS1RID7Ivowkbj rrBapW89saHxk/O2lhOInwGmWgOe74ZvDbIiesYPrFHaqnJFRpr4F3QJ38vYgLgU27Am fukz93QEz7JldNSHAOVojbUJN1l4GSbDi6pHHoOcDjhCxi6zl/Tc2lQcZZgnT+j0BB+z zDnzXZBz+bTCg0HZ0VBZ3qtlBI/QGvG7V6Yk6eNgpp8TFdB0iKGx721PnatsZlCJIgNS /Iu94Dbi5kC8ypKYi6NqtxUTS2f8mkKkAQRS/miLPXvDyO3H6Ik+SYtEYQ0cWgOCDiu8 E69g== 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:mime-version:content-transfer-encoding; bh=nQCW8ZwYzo22rvcQzFUBZHnTB+UpuvDUuYoHvF9lN9M=; b=JH4itiWTeuBE9Bfl9oB5mmG4ced/JnkYsMYcn13/n2RJK8zvhfLmhpi/oCMD+A7Zvp 7xYVfsYbkYLLQN+bG5dO1xY5P7fbCwhQ5DjWMd7KTnrztLkQc+S/1KzUmBQtO367NDnx JaJU58AYa3nbXqUtkSvsmXs+F7iSej+DICJ30x/at5fhVbU6241H8rLGB+rYHzwkxV5R rDcSDuMVlycKnhs+7QZ6zAYXhDUenxjVGr5T+TbA+3LI2wYcVPVqZ+KOGtZhn221GiwK Sfn1OI4QgKRSknB3rvoIwenk7Mq3AXOmjV9Mp8HOTDu1Bm4py3eRNYbocb5fOjI9ORg4 nYdQ== X-Gm-Message-State: AOAM532QKqVGGp4SZ/lSr9jSNeErbLvnyUS2CY6LV45m/IDYMXUFMNs4 LB4zKx6Wp6x/pRlUEgUVi6Dqpw== X-Google-Smtp-Source: ABdhPJwUPqYkrv58Bt+1w9rYFOaLopPYITFQJljwyiU3iDGF/gcd6ny45hGRNTsHvwjjzS/6ZYn1fg== X-Received: by 2002:a7b:cc84:: with SMTP id p4mr14257163wma.10.1615570161013; Fri, 12 Mar 2021 09:29:21 -0800 (PST) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id 18sm2876375wmj.21.2021.03.12.09.29.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 09:29:20 -0800 (PST) From: Bryan O'Donoghue To: stanimir.varbanov@linaro.org, agross@kernel.org, bjorn.andersson@linaro.org, mchehab@kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: bryan.odonoghue@linaro.org, dikshita@codeaurora.org, jonathan@marek.ca, vgarodia@codeaurora.org Subject: [PATCH v2 09/25] media: venus: core: Add an io base for TZ wrapper regs Date: Fri, 12 Mar 2021 17:30:23 +0000 Message-Id: <20210312173039.1387617-10-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210312173039.1387617-1-bryan.odonoghue@linaro.org> References: <20210312173039.1387617-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 6xx silicon needs to access registers from a wrapper trust-zone base address range. This commit defines the necessary variable for later use. Signed-off-by: Bryan O'Donoghue --- drivers/media/platform/qcom/venus/core.c | 1 + drivers/media/platform/qcom/venus/core.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index 7124d9111001..cf2aa83c4378 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -215,6 +215,7 @@ static void venus_assign_register_offsets(struct venus_core *core) core->cpu_cs_base = core->base + CPU_CS_BASE; core->cpu_ic_base = core->base + CPU_IC_BASE; core->wrapper_base = core->base + WRAPPER_BASE; + core->wrapper_tz_base = 0; } static int venus_probe(struct platform_device *pdev) diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h index 85047806142f..0c519211fac3 100644 --- a/drivers/media/platform/qcom/venus/core.h +++ b/drivers/media/platform/qcom/venus/core.h @@ -95,6 +95,7 @@ struct venus_format { * @cpu_cs_base IO memory cpu_cs base address * @cpu_ic_base IO memory cpu_ic base address * @wrapper_base IO memory wrapper base address + * @wrapper_base IO memory wrapper TZ base address * @irq: Venus irq * @clks: an array of struct clk pointers * @vcodec0_clks: an array of vcodec0 struct clk pointers @@ -132,6 +133,7 @@ struct venus_core { void __iomem *cpu_cs_base; void __iomem *cpu_ic_base; void __iomem *wrapper_base; + void __iomem *wrapper_tz_base; int irq; struct clk *clks[VIDC_CLKS_NUM_MAX]; struct clk *vcodec0_clks[VIDC_VCODEC_CLKS_NUM_MAX]; From patchwork Fri Mar 12 17:30:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 399861 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 533E7C433E6 for ; Fri, 12 Mar 2021 17:30:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2AE6264F27 for ; Fri, 12 Mar 2021 17:30:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232752AbhCLR3y (ORCPT ); Fri, 12 Mar 2021 12:29:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232313AbhCLR3X (ORCPT ); Fri, 12 Mar 2021 12:29:23 -0500 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E037C061761 for ; Fri, 12 Mar 2021 09:29:23 -0800 (PST) Received: by mail-wm1-x32e.google.com with SMTP id g25so4255870wmh.0 for ; Fri, 12 Mar 2021 09:29:23 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=NnuD5L3voGamYqFhLAMgkNjZdxUrSLilyf/GOp959aY=; b=Smu9T8dhMTXx1x6LnVAEUlH+qCRjTJu0kRVy4+lHlz5l/k7MRxOSuynFaaw0vGsTbi oltJwAziGdpR3Xb8hPio97TQ1uKpWlyUBoEe0O/drkpsLT6gkDUMY9H4UnTgGEsdZN0S T8JjXnitlw8a/uZu02GqX6oCsE8aT085I2w/MjXkIPDqWHXugTL5FEeZ2ENapWuLqrpP ExpFo7DhmxsYfzdDWMRf54oNH2G+tzWD4UOBvHmbKosMTAIN9ABKIcrIoPBAyX1T8uEt iHQ7a5EaAzVbanYnj/cwmtgH03Azyt3gqj6GRtjzbYnMd4oiMAJ5EQIgK/oSr4mimVtZ yfKg== 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:mime-version:content-transfer-encoding; bh=NnuD5L3voGamYqFhLAMgkNjZdxUrSLilyf/GOp959aY=; b=LA9U9LukLIGbNHc/hz4NAE2gTxk14CPqyMG41DHomc0xNgnHy7Avcx0NaTooFgsHLY 6ZPCLWDA1H3zr2cGf/z8X6g6mGgDgskLqQ2q9Y/4g1PAp1bTBms8+IydcdjDhfP2czKL XVKLUUjcpwLx/2LficQK+pBtk7D/MKEJkMOnsx3hJS3eB4ktoHIq+QBmpfvp+ceRJpzR VA4uAwysOIM0Oxk4mgGRT1NM3TC4IaNQDADEFwmSr57VGTmqQ+57s697L+/jkc+8b/mr Kvx9elai7oIxHwH64rpkRZoeQjUdlmgEkwHTUszNiZQAsGNmF3SjpVYUHqX/VBg0NboD LjpQ== X-Gm-Message-State: AOAM530sxhgy7tsoduOdKw1OwZrSJmrmH4MwPiZSkrncqPYs2bMxQ3Wz e4hAphzBy2VNZvdDLlKlGID6Ew== X-Google-Smtp-Source: ABdhPJylSWDo2kA16g3MpvcofU0Anqe73d6l9FjOZuZ19WRfAfQSPxQ9kbbM9ar2OtsT40V1eY02JA== X-Received: by 2002:a05:600c:203:: with SMTP id 3mr14039899wmi.88.1615570162017; Fri, 12 Mar 2021 09:29:22 -0800 (PST) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id 18sm2876375wmj.21.2021.03.12.09.29.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 09:29:21 -0800 (PST) From: Bryan O'Donoghue To: stanimir.varbanov@linaro.org, agross@kernel.org, bjorn.andersson@linaro.org, mchehab@kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: bryan.odonoghue@linaro.org, dikshita@codeaurora.org, jonathan@marek.ca, vgarodia@codeaurora.org Subject: [PATCH v2 10/25] media: venus: core: Add an io base for AON regs Date: Fri, 12 Mar 2021 17:30:24 +0000 Message-Id: <20210312173039.1387617-11-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210312173039.1387617-1-bryan.odonoghue@linaro.org> References: <20210312173039.1387617-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 6xx silicon needs to access registers from a AON base address range. This commit defines the necessary variable for later use. Signed-off-by: Bryan O'Donoghue --- drivers/media/platform/qcom/venus/core.c | 1 + drivers/media/platform/qcom/venus/core.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index cf2aa83c4378..b6f9ef6b6dcd 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -216,6 +216,7 @@ static void venus_assign_register_offsets(struct venus_core *core) core->cpu_ic_base = core->base + CPU_IC_BASE; core->wrapper_base = core->base + WRAPPER_BASE; core->wrapper_tz_base = 0; + core->aon_base = 0; } static int venus_probe(struct platform_device *pdev) diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h index 0c519211fac3..6de596b5a9d1 100644 --- a/drivers/media/platform/qcom/venus/core.h +++ b/drivers/media/platform/qcom/venus/core.h @@ -96,6 +96,7 @@ struct venus_format { * @cpu_ic_base IO memory cpu_ic base address * @wrapper_base IO memory wrapper base address * @wrapper_base IO memory wrapper TZ base address + * @aon_base AON base address * @irq: Venus irq * @clks: an array of struct clk pointers * @vcodec0_clks: an array of vcodec0 struct clk pointers @@ -134,6 +135,7 @@ struct venus_core { void __iomem *cpu_ic_base; void __iomem *wrapper_base; void __iomem *wrapper_tz_base; + void __iomem *aon_base; int irq; struct clk *clks[VIDC_CLKS_NUM_MAX]; struct clk *vcodec0_clks[VIDC_VCODEC_CLKS_NUM_MAX]; From patchwork Fri Mar 12 17:30:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 399860 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 99F7DC4332E for ; Fri, 12 Mar 2021 17:30:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8253F64FF5 for ; Fri, 12 Mar 2021 17:30:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232398AbhCLR3z (ORCPT ); Fri, 12 Mar 2021 12:29:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232559AbhCLR3Y (ORCPT ); Fri, 12 Mar 2021 12:29:24 -0500 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3EC0EC061761 for ; Fri, 12 Mar 2021 09:29:24 -0800 (PST) Received: by mail-wr1-x42f.google.com with SMTP id v4so2203494wrp.13 for ; Fri, 12 Mar 2021 09:29:24 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=+sHQO6SUFe3dMQJllaoiys6MK+T2Abm1Bipqo6ivlBQ=; b=Zz89aFmyWy2T2QK8LJsjyyKZWLjSYWQP8Ct+B4q+GEpF85vJwQ+ydcE2+f4mtnUOwm MXV6uqA45Yu1lNk0RZXOngho0cW2m+GCFH8tFqu2mXerPEF/PF9tR34bx87sVpD0WuNZ xNjWNnrBHLoRG/dh7dnjZHiketW4Yz8214co0KHFPxThWvdEND9N4MLkSeE3k1FIO3FQ RQeJPjgujneqvCmUYK1WeBOPN/23KfoU0wzcb0/f3kksfHnq7ShkPBXL98ZOJYG6rmXk lEKEYwJ4m+Zbnwno++bKq8H0tjM8GVsT6vv64PTXGSKp7rdAVv0UFD3eQ5sFXJK20i8J 2/MA== 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:mime-version:content-transfer-encoding; bh=+sHQO6SUFe3dMQJllaoiys6MK+T2Abm1Bipqo6ivlBQ=; b=DVXoRK9xQUDg9Yi5FtxtNTFUj3qS653FOkFNkAgxUqt9CU+SHSRuHeZvikb1UGfgH+ IlqotqQ793dSvlOIKmVHZh8ssGptvdoewQCO6hN9DRxTdVC9ECrfDbb2kG4949at+8U4 CxZQK6k9ZkdTBiuDj64522++ELbhN+0EL0/GxK03/DK9TqVBSsl7HkyR/RCJiDDY4zr8 FYAkG84peniUqVwSJpao4/Yufw5rPK76BKE4IwlyrE88pjY4nHUJRK8SV9lG2oSaoA9v RxnwNdiRJalEMqOYGfw/PiyCsSo4D5vodU+VEzEKTlCgCdqU7MXrcoBvVEfjF1fxvjMU Sanw== X-Gm-Message-State: AOAM5314MR4tIBuI5tOmihYxRxud5ZoUssZX2mDtxA6+qel3OK78qdHv Z4XCB+Q8xqpE00jEKM34pcNckQ== X-Google-Smtp-Source: ABdhPJy6kNu+PheIrInHuAuvx7htqq9056jMS2d+MwyBEWpEjOLXx6Vc8IYOYb1UJrKfU30lN968Gg== X-Received: by 2002:a5d:4bcd:: with SMTP id l13mr15347909wrt.56.1615570163009; Fri, 12 Mar 2021 09:29:23 -0800 (PST) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id 18sm2876375wmj.21.2021.03.12.09.29.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 09:29:22 -0800 (PST) From: Bryan O'Donoghue To: stanimir.varbanov@linaro.org, agross@kernel.org, bjorn.andersson@linaro.org, mchehab@kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: bryan.odonoghue@linaro.org, dikshita@codeaurora.org, jonathan@marek.ca, vgarodia@codeaurora.org Subject: [PATCH v2 11/25] media: venus: core: Hook to V6 base registers when appropriate Date: Fri, 12 Mar 2021 17:30:25 +0000 Message-Id: <20210312173039.1387617-12-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210312173039.1387617-1-bryan.odonoghue@linaro.org> References: <20210312173039.1387617-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org This commit points the IO base registers 6xx offsets when probing for 6xx hardware. Signed-off-by: Bryan O'Donoghue --- drivers/media/platform/qcom/venus/core.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index b6f9ef6b6dcd..bef582470fa2 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -210,13 +210,23 @@ static int venus_enumerate_codecs(struct venus_core *core, u32 type) static void venus_assign_register_offsets(struct venus_core *core) { - core->vbif_base = core->base + VBIF_BASE; - core->cpu_base = core->base + CPU_BASE; - core->cpu_cs_base = core->base + CPU_CS_BASE; - core->cpu_ic_base = core->base + CPU_IC_BASE; - core->wrapper_base = core->base + WRAPPER_BASE; - core->wrapper_tz_base = 0; - core->aon_base = 0; + if (IS_V6(core)) { + core->vbif_base = core->base + VBIF_BASE; + core->cpu_base = core->base + CPU_BASE_V6; + core->cpu_cs_base = core->base + CPU_CS_BASE_V6; + core->cpu_ic_base = core->base + CPU_IC_BASE_V6; + core->wrapper_base = core->base + WRAPPER_BASE_V6; + core->wrapper_tz_base = core->base + WRAPPER_TZ_BASE_V6; + core->aon_base = core->base + AON_BASE_V6; + } else { + core->vbif_base = core->base + VBIF_BASE; + core->cpu_base = core->base + CPU_BASE; + core->cpu_cs_base = core->base + CPU_CS_BASE; + core->cpu_ic_base = core->base + CPU_IC_BASE; + core->wrapper_base = core->base + WRAPPER_BASE; + core->wrapper_tz_base = 0; + core->aon_base = 0; + } } static int venus_probe(struct platform_device *pdev) From patchwork Fri Mar 12 17:30:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 398669 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1383808jai; Fri, 12 Mar 2021 09:30:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJwp9vtYOBlCkcwWmxa2diqmiZ0kF2ai4zDP5IMDDWqrZUPwWditRjgVBtZM9qVm5mGTHkkb X-Received: by 2002:a17:906:3295:: with SMTP id 21mr9669788ejw.88.1615570228931; Fri, 12 Mar 2021 09:30:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615570228; cv=none; d=google.com; s=arc-20160816; b=kfzFdek/0skQjWXrQRoNOqpC10TlUzshzhm21pkfcnd4daYepWiUrPJYaJ0RXg2IlS iECgB4Nl4/lvvitOALTRIMGaETqZB3XXO6vYT5tkUpEwWCvSy7g3Tik1aAftP+ECcbpo aKBm7d5aH/YW8PLEPh5/ES0KihOfcCaaZLsOlts7E3h3zI3ZdIFrzjQpOS/B4/E7rnen dur1LqxrZwYn2abRNOnQdr1u0QyxCWlUQX4mvrKKIkM8ZwrB0w9JCNRnlqJNz6sSDCJD DbytUgapSXfBTa34c6+qQ9cHiOzSRrDS2V/7nw9aFT0nQTdYCyCf3mS9Zk8ZYvgMHe/2 8QhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=pMvvR9R2ZY/KspoYguO/+u7gFaAXLGd8hg1+vgHTtsY=; b=URkKYqqnCNgNUF6AOCR2TSdZyysQ4wZP35AOAvFuQG3j9mXPPED9Fdh32UeL5wEGvA cCfuUWdHFLq0WBFOjICEkgWcLP6hDm2dsAbVg8p6PFnT+aQ8/pWCv2RpuiSUyss1OSwg vu6Dkks/L3M43N+QW6s/W5ymXvV4wgS5vdZOc9ZKct6fxQW9UIFN4m1wL0wVtVzoysrq 60MqwHJsCczxJmjJI1aYds+282giadpuH4y2JTlOPY2frgYdsNbG8qQrVMAoR28RjQqK 75LoGoU4LNzCna6cirzcQLXddfcv7j/Tl9ak2yDE2KCRcf+0uV533mB1cITdqdEZ1Yer 1UiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=X5wYU4ge; spf=pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id ot6si4540497ejb.337.2021.03.12.09.30.28; Fri, 12 Mar 2021 09:30:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=X5wYU4ge; spf=pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 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 S232554AbhCLR34 (ORCPT + 3 others); Fri, 12 Mar 2021 12:29:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232666AbhCLR3Z (ORCPT ); Fri, 12 Mar 2021 12:29:25 -0500 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2EC9DC061761 for ; Fri, 12 Mar 2021 09:29:25 -0800 (PST) Received: by mail-wm1-x334.google.com with SMTP id c76-20020a1c9a4f0000b029010c94499aedso16268621wme.0 for ; Fri, 12 Mar 2021 09:29:25 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=pMvvR9R2ZY/KspoYguO/+u7gFaAXLGd8hg1+vgHTtsY=; b=X5wYU4ge26MdLzXoFs1urHNZ7Lhjs9xCvtZSW1f4Uz49J1inaMy+51pG0wXFA4AMA5 tE+A5DQ1Pvy3HBXCp7ckBQ9mjPXmORBeHYpp+mJm8xisZlosaMmZzYdqo6IboUQifYXk QNJ2vPBsuEbzcEn1YUqvCLH4tK85DHIminc6urDrRiJrt439cIJj5KSjCElw0O6MOYl7 trvf8AdmCMX6qG5aGy4JrQRcK4Vgw9ewQKb0/z3hb52wG/9w4Jfnm8ucA/u2rRjh2qwE wBQxmIwii+2bXppZrZzJj38Ktrm3OcSaDdvqr8CyJCLrTIepbwswwVeN+jpzMhDxMmE2 AOmg== 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:mime-version:content-transfer-encoding; bh=pMvvR9R2ZY/KspoYguO/+u7gFaAXLGd8hg1+vgHTtsY=; b=rmu9Nv95D7/eXR2oQG1kZ5fyqO51wQRPNm3kw0VoDOUhXBO5Dtycm7bVlIG3VJeHRr NOU27O+UhTIIMus+fXJno6stfMYGlEOftW30irJig9SfA5bAI34dJLGCQJI04bgSO8Us Tqj3HpwUdGmUy6NC4MEIei7C3s+bJDGu+q7icilQjHFkfUg9o0sYJUof5dRDWIVa6hMT 4zbWZLAioNmYnuHeuqV/E8HKb6wotQv7IrescRenqkIgmWLhxWd92f0Tl2rzMrGPS33y LzRFn6tBAl8a9uPFbg56+Ca/2Zevz/GU/Bt/HCjgDSN+8/rzssneW003t/fMuKM+aJNm gTiA== X-Gm-Message-State: AOAM531hJeLVL5J7TUugmkgvgjDEJ9ZC/kcu/HEiYbdEz6UnRwTlKh4j aCOGGv9iow4fVQY4MimLZR6zpQ== X-Received: by 2002:a1c:2016:: with SMTP id g22mr14268893wmg.137.1615570163938; Fri, 12 Mar 2021 09:29:23 -0800 (PST) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id 18sm2876375wmj.21.2021.03.12.09.29.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 09:29:23 -0800 (PST) From: Bryan O'Donoghue To: stanimir.varbanov@linaro.org, agross@kernel.org, bjorn.andersson@linaro.org, mchehab@kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: bryan.odonoghue@linaro.org, dikshita@codeaurora.org, jonathan@marek.ca, vgarodia@codeaurora.org Subject: [PATCH v2 12/25] media: venus: hfi: Add a 6xx boot logic Date: Fri, 12 Mar 2021 17:30:26 +0000 Message-Id: <20210312173039.1387617-13-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210312173039.1387617-1-bryan.odonoghue@linaro.org> References: <20210312173039.1387617-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Dikshita Agarwal This patch adds a 6xx specific boot logic. The goal is to share as much code as possible between 3xx, 4xx and 6xx silicon. We need to do a different write to WRAPPER_INTR_MASK with an additional write to CPU_CS_H2XSOFTINTEN_V6 and CPU_CS_X2RPMh_V6. The other writes are the same for 6xx and non-6xx silicon albeit at different absolute relative locations to the base of the venus address space. Signed-off-by: Dikshita Agarwal Signed-off-by: Bryan O'Donoghue --- drivers/media/platform/qcom/venus/hfi_venus.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) -- 2.30.1 diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c index f95cdd3d530c..5f9c8aa84cd0 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -442,14 +442,21 @@ static int venus_boot_core(struct venus_hfi_device *hdev) { struct device *dev = hdev->core->dev; static const unsigned int max_tries = 100; - u32 ctrl_status = 0; + u32 ctrl_status = 0, mask_val; unsigned int count = 0; void __iomem *cpu_cs_base = hdev->core->cpu_cs_base; void __iomem *wrapper_base = hdev->core->wrapper_base; int ret = 0; writel(BIT(VIDC_CTRL_INIT_CTRL_SHIFT), cpu_cs_base + VIDC_CTRL_INIT); - writel(WRAPPER_INTR_MASK_A2HVCODEC_MASK, wrapper_base + WRAPPER_INTR_MASK); + if (IS_V6(hdev->core)) { + mask_val = readl(wrapper_base + WRAPPER_INTR_MASK); + mask_val &= ~(WRAPPER_INTR_MASK_A2HWD_BASK_V6 | + WRAPPER_INTR_MASK_A2HCPU_MASK); + } else { + mask_val = WRAPPER_INTR_MASK_A2HVCODEC_MASK; + } + writel(mask_val, wrapper_base + WRAPPER_INTR_MASK); writel(1, cpu_cs_base + CPU_CS_SCIACMDARG3); while (!ctrl_status && count < max_tries) { @@ -467,6 +474,9 @@ static int venus_boot_core(struct venus_hfi_device *hdev) if (count >= max_tries) ret = -ETIMEDOUT; + if (IS_V6(hdev->core)) + writel(0x0, cpu_cs_base + CPU_CS_X2RPMH_V6); + return ret; } From patchwork Fri Mar 12 17:30:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 399111 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 947D5C4360C for ; Fri, 12 Mar 2021 17:30:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 73F1A64F0B for ; Fri, 12 Mar 2021 17:30:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232849AbhCLR35 (ORCPT ); Fri, 12 Mar 2021 12:29:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232176AbhCLR30 (ORCPT ); Fri, 12 Mar 2021 12:29:26 -0500 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B28AC061762 for ; Fri, 12 Mar 2021 09:29:26 -0800 (PST) Received: by mail-wm1-x32f.google.com with SMTP id g25so4255929wmh.0 for ; Fri, 12 Mar 2021 09:29:26 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=DgcgmGAHc3v0xwuMz10HyiD3wAndP0bF+bK9i2XYFOQ=; b=kmNkmY+nG/jMRmc6MYanMjNF00hDYbmSb5766h5lw6+xW/HJdxf4Z2K0e6BTLAofLO 9Age4lJ6lqco+hGUmKLEBG/E+TmnH4pqCYFrXtdz78dfDIHm6wBEi2E/VgVXF6hRcmWM FTR9MfkXygbUfqZcgQJHXG8DckpUDYI1bLbMLZECm4N1t76zmhX8IWHLXVn6hjFp8JP8 kRn4HxP24FDHHexU9PJzP8gNoxcIOmQKYX4HtmFW3hhpey5fpLzQ+LFVBQio0nKEf7pc gywyGXiaKlxGcRTmyZyDZ8WkFACCMkX5Sdcm0IoDW7br+8wpL6dMLilL/fpZfZZHePZU GXAg== 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:mime-version:content-transfer-encoding; bh=DgcgmGAHc3v0xwuMz10HyiD3wAndP0bF+bK9i2XYFOQ=; b=I77emmRKbOvGuUf8QGhLeqmuDttk/VV64VijH8rEFkqCgodwaNS6CvTtPaR8kgF1Y4 ICnmR0QIJeLjbISXyNxeZUrJ+n/VjTzabeKjUj4OvtDt4PXchCnuGCBjD/CjZlJpMrFx YuWlJkJ5Msv5Ye3S+7mXS5jUV4lyabKoUChVx4HJRxEV7rFWM4OJYIF42eT0n6oh+NLn b/udDZz1AUUPVocklXsEbkbCJKy2tOURF3us1WoWEultungGmSiSPZ4Ak1bVGVl1NuAD MMVUqTn3thA2ah8hqjnAlZBeL5J67sDuukERxtLx4JxvYEX8G+aNuQNNMSFNCoYGJ7j4 0jiQ== X-Gm-Message-State: AOAM531neOYpGPZqCvwyeCpT70Ge5KG5VgdF7vRO7U9Z54Eoa4TMWOuI BqlDUpz+QcuyxCzVP7a5+m67PPHxua/LxHa4 X-Google-Smtp-Source: ABdhPJxMnmby3kVL+uzb87yOnKhTNUlo1T8/SJsI3h2Zk7JU26v92JM0RLfYA0+NGs94h18I3fx0OA== X-Received: by 2002:a1c:b48a:: with SMTP id d132mr13716088wmf.108.1615570164869; Fri, 12 Mar 2021 09:29:24 -0800 (PST) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id 18sm2876375wmj.21.2021.03.12.09.29.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 09:29:24 -0800 (PST) From: Bryan O'Donoghue To: stanimir.varbanov@linaro.org, agross@kernel.org, bjorn.andersson@linaro.org, mchehab@kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: bryan.odonoghue@linaro.org, dikshita@codeaurora.org, jonathan@marek.ca, vgarodia@codeaurora.org Subject: [PATCH v2 13/25] media: venus: hfi: Add 6xx interrupt support Date: Fri, 12 Mar 2021 17:30:27 +0000 Message-Id: <20210312173039.1387617-14-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210312173039.1387617-1-bryan.odonoghue@linaro.org> References: <20210312173039.1387617-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Dikshita Agarwal This commit adds 6xx specific interrupt support, some register offsets and bitmasks differ from 4xx, which we account for in this commit. [bod: Added commit log. Moved register definition into commit] Signed-off-by: Dikshita Agarwal Co-developed-by: Bryan O'Donoghue Signed-off-by: Bryan O'Donoghue --- drivers/media/platform/qcom/venus/hfi_venus.c | 32 +++++++++++++------ 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c index 5f9c8aa84cd0..09fc81da0645 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -359,8 +359,14 @@ static void venus_set_registers(struct venus_hfi_device *hdev) static void venus_soft_int(struct venus_hfi_device *hdev) { void __iomem *cpu_ic_base = hdev->core->cpu_ic_base; + u32 clear_bit; - writel(BIT(CPU_IC_SOFTINT_H2A_SHIFT), cpu_ic_base + CPU_IC_SOFTINT); + if (IS_V6(hdev->core)) + clear_bit = BIT(CPU_IC_SOFTINT_H2A_SHIFT_V6); + else + clear_bit = BIT(CPU_IC_SOFTINT_H2A_SHIFT); + + writel(clear_bit, cpu_ic_base + CPU_IC_SOFTINT); } static int venus_iface_cmdq_write_nolock(struct venus_hfi_device *hdev, @@ -474,8 +480,10 @@ static int venus_boot_core(struct venus_hfi_device *hdev) if (count >= max_tries) ret = -ETIMEDOUT; - if (IS_V6(hdev->core)) + if (IS_V6(hdev->core)) { + writel(0x1, cpu_cs_base + CPU_CS_H2XSOFTINTEN_V6); writel(0x0, cpu_cs_base + CPU_CS_X2RPMH_V6); + } return ret; } @@ -1061,14 +1069,20 @@ static irqreturn_t venus_isr(struct venus_core *core) return IRQ_NONE; status = readl(wrapper_base + WRAPPER_INTR_STATUS); - - if (status & WRAPPER_INTR_STATUS_A2H_MASK || - status & WRAPPER_INTR_STATUS_A2HWD_MASK || - status & CPU_CS_SCIACMDARG0_INIT_IDLE_MSG_MASK) - hdev->irq_status = status; - + if (IS_V6(core)) { + if (status & WRAPPER_INTR_STATUS_A2H_MASK || + status & WRAPPER_INTR_STATUS_A2HWD_MASK_V6 || + status & CPU_CS_SCIACMDARG0_INIT_IDLE_MSG_MASK) + hdev->irq_status = status; + } else { + if (status & WRAPPER_INTR_STATUS_A2H_MASK || + status & WRAPPER_INTR_STATUS_A2HWD_MASK || + status & CPU_CS_SCIACMDARG0_INIT_IDLE_MSG_MASK) + hdev->irq_status = status; + } writel(1, cpu_cs_base + CPU_CS_A2HSOFTINTCLR); - writel(status, wrapper_base + WRAPPER_INTR_CLEAR); + if (!IS_V6(core)) + writel(status, wrapper_base + WRAPPER_INTR_CLEAR); return IRQ_WAKE_THREAD; } From patchwork Fri Mar 12 17:30:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 398674 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1383826jai; Fri, 12 Mar 2021 09:30:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJy2GedKVcoQUQT2l5vuc2E73aPFDpDxBt9Ex9mLeY9ktIcVKAAnr6PLbtxqeyLNRTKchww/ X-Received: by 2002:a17:906:2818:: with SMTP id r24mr9824967ejc.472.1615570230165; Fri, 12 Mar 2021 09:30:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615570230; cv=none; d=google.com; s=arc-20160816; b=K5v4s+aFPVEgu5hhKfdat0YKAcQE5c6trBGc70h6Sp84ULlSpDT5Ve2N1hCPKh0SIi UKybJU1jU6J6EEeDrJeK2ien0EMCBVUR+2X7ALgsNqtAwFfMFdAKMNoBfkfx6qaRNr73 LPaA3B+kOl+LGAUShblzLmPXceIYEJE6envsJYbnCXNofWdSuhV4zNEa0ju/0Fybjh9+ aNp1nJmAuHVbgUbOzuPiQbaV85EtpIoOB9VH2SU+x2Web9MHjuChbsI2nw9RWrX9QAew A+kQT0SIci2VTo7s8VhhAlNfIhmgF2IG4PD4p4CL0ArGKyeHmnp2qU0z3bVW0DHkTYRB tKaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=PZHJdY8fakNaK6P7dFBhgcz/Bbfh/JsCZheBpgT33jI=; b=BlNOY+NG4qXNaYSPC5snMSO5Mdg2+3wVupstejSrLaZgZdSmBo+m3a5Vq9vgB5bNAK RQqJe7vGP0uacGlbDMnpHNoN/XdJegjdio7A45MIzZUueSlsWej7CaPNWvmo+oQxJ7VR w0AMIiMKlUoo1/4syeisxfV6EQ4DrXNt7DhkWph8DbWI3g2iv5ADkSZU9E8AXd9+/hBE NrdXL5yIjpfZEQH/URngA98uPD/LmVoj9Yo3Q62RthdlJEndy9at0HRGlXliQE9yi1IM EFBmIQsFIOpqvru6NqW9xrSCGWD8FCUGJwyrTvPpVbnQ0Jofq7e+NLx2f5Xg7i7/9WAH oumA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RoEk2Pkc; spf=pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id ot6si4540497ejb.337.2021.03.12.09.30.29; Fri, 12 Mar 2021 09:30:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RoEk2Pkc; spf=pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 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 S232233AbhCLR35 (ORCPT + 3 others); Fri, 12 Mar 2021 12:29:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232702AbhCLR31 (ORCPT ); Fri, 12 Mar 2021 12:29:27 -0500 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C1B2C061761 for ; Fri, 12 Mar 2021 09:29:27 -0800 (PST) Received: by mail-wr1-x42e.google.com with SMTP id a18so5212076wrc.13 for ; Fri, 12 Mar 2021 09:29:27 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=PZHJdY8fakNaK6P7dFBhgcz/Bbfh/JsCZheBpgT33jI=; b=RoEk2PkcxJb2qKkIaTXJ4Z54Ghie9qdl9peDZj2azFnqAO4R3XWmHTukWoTTHg5Kme +2d/QP3LPrq9NynIQflNdRwFkyxOUyVkVYo1pxXRxU1NYGRCjhGjFSTWuft50DjRrFoQ hfsS4/tBe99SVdz2vCwimyh3AK90eAcqPyAcMkXCpCOaqUfw3pJJLee4SUIRr3rb+YEs 5yAhYa/WenkU6OfffeSC0/rP0b68KNJykXZP3reL8Nb6PKEvZC3gRgPoXPyEmmu5zd82 TqpyNzrNTf8nKkKDRXhol4TWW5N1vlSt33B8jYpOfXc7+lnyZYF77yR7t+DAy2H7BFKb RWUA== 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:mime-version:content-transfer-encoding; bh=PZHJdY8fakNaK6P7dFBhgcz/Bbfh/JsCZheBpgT33jI=; b=M3RBvLHgnIf5+QRMQp2GAH5a7/NzN1sCg/GFMTy43S1a0LhfddgbQwh3tALpRbaS01 YXIOibsQw3aEJgNCyfwS+UPB6WsXg62FTSi6+hA7AdH0AmhzZz2Vp8i/1ERjpwG1aLld tr1htJS6sCPrjEf2I/EqzR2DdfFRw0+AL7ClbJe1Iyv0VS0zrk3q2AzKcb3L8xtEzxkM R7Kf42+jHN5fMxMNRm0aR8moVCjS5Xf0MRtFz/QdDFKKGPoYGTiPG5CDrO9L3MiE2D27 1l63s4rFh5I3/gZbUGs4rAke8RJyLVXoTH1g19mmCNWItoDBQmtzLRKSvmrc6X7IFtZW 3eVg== X-Gm-Message-State: AOAM532uN/J1KzL9SGhc0wFe4kS+0qVoBknBxdlfL0HyKigCdZ7fwF+3 Tfyt7q6kI5C8p6f2zRHLPfa7dA== X-Received: by 2002:adf:9261:: with SMTP id 88mr14795224wrj.270.1615570165868; Fri, 12 Mar 2021 09:29:25 -0800 (PST) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id 18sm2876375wmj.21.2021.03.12.09.29.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 09:29:25 -0800 (PST) From: Bryan O'Donoghue To: stanimir.varbanov@linaro.org, agross@kernel.org, bjorn.andersson@linaro.org, mchehab@kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: bryan.odonoghue@linaro.org, dikshita@codeaurora.org, jonathan@marek.ca, vgarodia@codeaurora.org Subject: [PATCH v2 14/25] media: venus: hfi: Read WRAPPER_TZ_CPU_STATUS_V6 on 6xx Date: Fri, 12 Mar 2021 17:30:28 +0000 Message-Id: <20210312173039.1387617-15-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210312173039.1387617-1-bryan.odonoghue@linaro.org> References: <20210312173039.1387617-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org On 6xx we should read wrapper cpu status from the wrapper TZ register set. Co-developed-by: Jonathan Marek Signed-off-by: Jonathan Marek Co-developed-by: Dikshita Agarwal Signed-off-by: Dikshita Agarwal Signed-off-by: Bryan O'Donoghue --- drivers/media/platform/qcom/venus/hfi_venus.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) -- 2.30.1 diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c index 09fc81da0645..dabff8654f97 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -1472,10 +1472,14 @@ static int venus_suspend_1xx(struct venus_core *core) static bool venus_cpu_and_video_core_idle(struct venus_hfi_device *hdev) { void __iomem *wrapper_base = hdev->core->wrapper_base; + void __iomem *wrapper_tz_base = hdev->core->wrapper_tz_base; void __iomem *cpu_cs_base = hdev->core->cpu_cs_base; u32 ctrl_status, cpu_status; - cpu_status = readl(wrapper_base + WRAPPER_CPU_STATUS); + if (IS_V6(hdev->core)) + cpu_status = readl(wrapper_tz_base + WRAPPER_TZ_CPU_STATUS_V6); + else + cpu_status = readl(wrapper_base + WRAPPER_CPU_STATUS); ctrl_status = readl(cpu_cs_base + CPU_CS_SCIACMDARG0); if (cpu_status & WRAPPER_CPU_STATUS_WFI && @@ -1488,10 +1492,14 @@ static bool venus_cpu_and_video_core_idle(struct venus_hfi_device *hdev) static bool venus_cpu_idle_and_pc_ready(struct venus_hfi_device *hdev) { void __iomem *wrapper_base = hdev->core->wrapper_base; + void __iomem *wrapper_tz_base = hdev->core->wrapper_tz_base; void __iomem *cpu_cs_base = hdev->core->cpu_cs_base; u32 ctrl_status, cpu_status; - cpu_status = readl(wrapper_base + WRAPPER_CPU_STATUS); + if (IS_V6(hdev->core)) + cpu_status = readl(wrapper_tz_base + WRAPPER_TZ_CPU_STATUS_V6); + else + cpu_status = readl(wrapper_base + WRAPPER_CPU_STATUS); ctrl_status = readl(cpu_cs_base + CPU_CS_SCIACMDARG0); if (cpu_status & WRAPPER_CPU_STATUS_WFI && From patchwork Fri Mar 12 17:30:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 399109 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 416C0C432C3 for ; Fri, 12 Mar 2021 17:30:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1CE4064FC2 for ; Fri, 12 Mar 2021 17:30:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232767AbhCLR34 (ORCPT ); Fri, 12 Mar 2021 12:29:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232732AbhCLR32 (ORCPT ); Fri, 12 Mar 2021 12:29:28 -0500 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2495BC061762 for ; Fri, 12 Mar 2021 09:29:28 -0800 (PST) Received: by mail-wm1-x32a.google.com with SMTP id r10-20020a05600c35cab029010c946c95easo15613365wmq.4 for ; Fri, 12 Mar 2021 09:29:28 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=r3d/SgjaKruzsFsWQ/5JhNPNhUGTMpC/KOd2fT6x614=; b=LEi7VoAtlDIAldh4fH6ZYkeZuwxWun6tGjq1whtrDD6C5gde0ZWh1NanSc9KRgSxVn r+SPGWXI0jjhdfbnVNAC2STl9gWnUETkDKu9wCRaO3/AQrPayZjx2cUMXB0Ppi3ac6tk VVGnkTc/L/tsG85aoM0OgRZIK6Dyp+VYh6tW0TbsWoq39Xxrz16ks/erGfESCd8qsP00 0mEJdRw1nV4i9/BC5QvcjRMToVNATL//TOMHcy3dLqIAcr3MMei8h5SkC1Oz8usd6aTG LWCYbFr7ig/RKxWJXbkMLkMd4pMIJtj2+cSYNewPgTu7VNqU47F7zd2C8JKEEFKqCJ9U HEXA== 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:mime-version:content-transfer-encoding; bh=r3d/SgjaKruzsFsWQ/5JhNPNhUGTMpC/KOd2fT6x614=; b=c6urhcgxF8zIYuP1i3M4pdFYwwENO7oV4n7OS+K0qV1oRx7JUvSkvRZfBnCWTo1hta I8lr6R+GX3gP+RCli0diX6NEBigJNNvPxZT9LOdSSOqcxrWys94gs+ll74w9l6Vyms2s r7WQBumWM4EEIexkk30FBziLzWoAwipydjIiQhuwN9uzVMKoIaT2k7fwNkw7a9XTNwrD jZAGMBeq4/qMfFg7HYHO00PNvZ65WOatNhUsWw8cxssYvlZayKLEzaNC+aU0Cu92A4C1 HweoB57wubRxpDl+s50/qWsiDh/RhaiKEJYlqxCXiYjuMJ39x2HLj3dqJH5RGHYYzPJ/ FNvg== X-Gm-Message-State: AOAM532lKH8Zm4MsX9AdjPMx/QpiF18bmT8PtrqwIVcp0ztQjBLR7QGl afPY9vinJvPtAvhxEyo2cVTFTQ== X-Google-Smtp-Source: ABdhPJwomYFkXG4BoXBcwKMJ23P6tG24rCa3M38EIAvGOKqYQut1LvKbVCWLZaUOs/UY2Txkyn2DJQ== X-Received: by 2002:a7b:cb89:: with SMTP id m9mr3427334wmi.27.1615570166864; Fri, 12 Mar 2021 09:29:26 -0800 (PST) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id 18sm2876375wmj.21.2021.03.12.09.29.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 09:29:26 -0800 (PST) From: Bryan O'Donoghue To: stanimir.varbanov@linaro.org, agross@kernel.org, bjorn.andersson@linaro.org, mchehab@kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: bryan.odonoghue@linaro.org, dikshita@codeaurora.org, jonathan@marek.ca, vgarodia@codeaurora.org, Dikshita Agarwal Subject: [PATCH v2 15/25] media: venus: hfi, vdec: v6 Add IS_V6() to existing IS_V4() if locations Date: Fri, 12 Mar 2021 17:30:29 +0000 Message-Id: <20210312173039.1387617-16-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210312173039.1387617-1-bryan.odonoghue@linaro.org> References: <20210312173039.1387617-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org In various places in the venus codebase we have if (IS_V4()) which takes the code down paths for 4xx silicon. This logic is broadly applicable to 6xx silicon also. In this patch we add IS_V6() to various IS_V4() decision locations. Co-developed-by: Dikshita Agarwal Signed-off-by: Dikshita Agarwal Signed-off-by: Bryan O'Donoghue --- drivers/media/platform/qcom/venus/helpers.c | 5 ++--- drivers/media/platform/qcom/venus/hfi_venus.c | 4 ++-- drivers/media/platform/qcom/venus/vdec.c | 6 +++--- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c index 76ece2ff8d39..2515a2225614 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -488,7 +488,7 @@ static bool is_dynamic_bufmode(struct venus_inst *inst) * v4 doesn't send BUFFER_ALLOC_MODE_SUPPORTED property and supports * dynamic buffer mode by default for HFI_BUFFER_OUTPUT/OUTPUT2. */ - if (IS_V4(core)) + if (IS_V4(core) || IS_V6(core)) return true; caps = venus_caps_by_codec(core, inst->hfi_codec, inst->session_type); @@ -1084,11 +1084,10 @@ int venus_helper_set_work_mode(struct venus_inst *inst, u32 mode) const u32 ptype = HFI_PROPERTY_PARAM_WORK_MODE; struct hfi_video_work_mode wm; - if (!IS_V4(inst->core)) + if (!IS_V4(inst->core) && !IS_V6(inst->core)) return 0; wm.video_work_mode = mode; - return hfi_session_set_property(inst, ptype, &wm); } EXPORT_SYMBOL_GPL(venus_helper_set_work_mode); diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c index dabff8654f97..24cf20f76e7f 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -897,7 +897,7 @@ static int venus_sys_set_default_properties(struct venus_hfi_device *hdev) * enable it explicitly in order to make suspend functional by checking * WFI (wait-for-interrupt) bit. */ - if (IS_V4(hdev->core)) + if (IS_V4(hdev->core) || IS_V6(hdev->core)) venus_sys_idle_indicator = true; ret = venus_sys_set_idle_message(hdev, venus_sys_idle_indicator); @@ -1577,7 +1577,7 @@ static int venus_suspend_3xx(struct venus_core *core) static int venus_suspend(struct venus_core *core) { - if (IS_V3(core) || IS_V4(core)) + if (IS_V3(core) || IS_V4(core) || IS_V6(core)) return venus_suspend_3xx(core); return venus_suspend_1xx(core); diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index c20496a14a55..5cefa396f2b5 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -670,8 +670,8 @@ static int vdec_output_conf(struct venus_inst *inst) if (width > 1920 && height > ALIGN(1080, 32)) ubwc = true; - /* For Venus v4 UBWC format is mandatory */ - if (IS_V4(core)) + /* For Venus v4/v6 UBWC format is mandatory */ + if (IS_V4(core) || IS_V6(core)) ubwc = true; ret = venus_helper_get_out_fmts(inst, inst->fmt_cap->pixfmt, &out_fmt, @@ -722,7 +722,7 @@ static int vdec_output_conf(struct venus_inst *inst) return ret; } - if (IS_V3(core) || IS_V4(core)) { + if (IS_V3(core) || IS_V4(core) || IS_V6(core)) { ret = venus_helper_get_bufreq(inst, HFI_BUFFER_OUTPUT, &bufreq); if (ret) return ret; From patchwork Fri Mar 12 17:30:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 399859 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7CD17C4321A for ; Fri, 12 Mar 2021 17:30:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5A4A964F6E for ; Fri, 12 Mar 2021 17:30:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232878AbhCLR35 (ORCPT ); Fri, 12 Mar 2021 12:29:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232741AbhCLR33 (ORCPT ); Fri, 12 Mar 2021 12:29:29 -0500 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F451C061761 for ; Fri, 12 Mar 2021 09:29:29 -0800 (PST) Received: by mail-wr1-x434.google.com with SMTP id e9so2204880wrw.10 for ; Fri, 12 Mar 2021 09:29:28 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=dfKzSN7+Nwky50p4GObh/puW54LZxKNtaiAf8zHXxqY=; b=UTILWxAojBI4i7OA9bANtCbOjR0Ok8XmQrTreL4Va8DignTMtqNoQhRh859mIyLJ5V Jct2uMyx9JTZLmaQhozGkq8ScYu96b5G8SLCmVwrjOaXanazrKIbYgY7HN+0nUSUT8Np 0EPNG1D7nB9TSRh4G3d93rVrdmtPuaRAldc0NYtu98PKZ5bSGoR1QdZDKYPBL8KFCD5c NgHjN4e/vqiEDhyFMbFDvATIZJT9q3BY5Rbxd3uovdHJhAXrciwHJHdQNCKFeP1mpfkt rgUv1XN2kuA6o6Gc4pW2kvDAw92HBiXhBj4rojWp/DvzeU8A9wovOq8ja2hJilHu3Xrs a6Zw== 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:mime-version:content-transfer-encoding; bh=dfKzSN7+Nwky50p4GObh/puW54LZxKNtaiAf8zHXxqY=; b=oJ2roiGBZiXHvqlsSoalmRS/E5Yw+zjnc2QQBBomzgn92nD2jCyiTwIX0I21JRqS1N asXtfSyTGWjRwGh3/DIhzZQ9zHR310WA/MT5mEZKcznmwKix6nHLZ4L5FpsT6lX77RvJ 5jpsHo0ISW0s+0d4oYbmdHYOKgGvTZtaCllHfO1BRfZ2VGLoLbCkzJWOUdSWMuAy1NjU duXg5hFUccaWeeNbIdHOZ0+59t4YWMLbZ3Uy+WX1nEV8XX36todeeF/bebeHWbC//qsb oLZPI9EXb2m9TxBeIK8+czTt9g/rVgJF3UNnMjqzVl/2nQrAPge1F6wbJFrPh7gk5D2v XgIw== X-Gm-Message-State: AOAM533dWnwGkU+SDI9XuXt/MgLSF9WXicLACTRMhY0cpCNE6TMh1FOu oe+gfeowFCpoFCD0W6KLW7sWTurZDxhxgwG3 X-Google-Smtp-Source: ABdhPJyC5BlVWRFSwDteAZc40VH6Y+s/28q3LNk7ERP9T72MaOS3W4FJZLVamiFpkBxoLEXK79B7Pg== X-Received: by 2002:adf:e391:: with SMTP id e17mr15028152wrm.285.1615570167825; Fri, 12 Mar 2021 09:29:27 -0800 (PST) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id 18sm2876375wmj.21.2021.03.12.09.29.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 09:29:27 -0800 (PST) From: Bryan O'Donoghue To: stanimir.varbanov@linaro.org, agross@kernel.org, bjorn.andersson@linaro.org, mchehab@kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: bryan.odonoghue@linaro.org, dikshita@codeaurora.org, jonathan@marek.ca, vgarodia@codeaurora.org Subject: [PATCH v2 16/25] media: venus: pm: Hook 6xx pm ops into 4xx pm ops Date: Fri, 12 Mar 2021 17:30:30 +0000 Message-Id: <20210312173039.1387617-17-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210312173039.1387617-1-bryan.odonoghue@linaro.org> References: <20210312173039.1387617-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org At this time there is no need to differentiate between the two, we can reuse the 4xx pm ops callback structure for 6xx. Signed-off-by: Bryan O'Donoghue --- drivers/media/platform/qcom/venus/pm_helpers.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c index ccbbac2036d2..a23e490b6139 100644 --- a/drivers/media/platform/qcom/venus/pm_helpers.c +++ b/drivers/media/platform/qcom/venus/pm_helpers.c @@ -1122,6 +1122,7 @@ const struct venus_pm_ops *venus_pm_get(enum hfi_version version) case HFI_VERSION_3XX: return &pm_ops_v3; case HFI_VERSION_4XX: + case HFI_VERSION_6XX: return &pm_ops_v4; } From patchwork Fri Mar 12 17:30:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 398678 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1383912jai; Fri, 12 Mar 2021 09:30:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJzWcIO6qP/MLgqevlqnpqU6ugj6Q/MWE7a7GAjlVNyWspSW/yH5fRo7iZBPvB0bFpcfKEW8 X-Received: by 2002:a17:906:b80c:: with SMTP id dv12mr9827316ejb.110.1615570235032; Fri, 12 Mar 2021 09:30:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615570235; cv=none; d=google.com; s=arc-20160816; b=FodEmhk5tZADFSX5eEX5hpLxDtUu4udfydZyJypA5rzvSF+C/ZLdRNUJ278yrvliBN GVQCOhk5Us6yDo0jl2qnAINwh4oJC6VCX/JC+V890W/Yl7EpjMmzB2PavRYdQjvoqxJS bDDErOmppYja5XeR1qZo8vUJFpPB8IV7HRNFt6b7Ncuem7F0KelCt+rBXXAt8XOS6huO moel6mRLUG3jhnK4HEs0Fn0nEWQUOrIwryeE+a/jw9g6lzSangIndrsMhCxrWF67eHu0 1TgFJX8lqTLkKnEuacRpUVDUDR4DeZ3b+3YOLc1A24LyCKatdX5ZX9f0T7F/FzosGx/D iNVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Ih+4JzrKKCuZh71Wtn2Zri+erbNOfm2jAKfFgRpgVkc=; b=iHK1EHKoiw/0ObDD3mSH3nymrxMYlM5ZvsXEWl7tlCcDCnCFgNBSX5jVZWfhgrOxdV H8QMtKFtxdxgEwIsFNKLa6tfHj8byY+ifngj7YGVofk3TfKqqbO5lhhJVQDvwLghxb0u gp44Gi0gPa8A6vVcoRraPHHEh9r+h0pa4xypvKontUwaQa60KUNfIji2UcEg2VvOcAAo DdfbEZovXLWvtpYE/3mJbYD1lsWlcRscmp3sgH/t2uJ3IGk2PuRJq2CqoaVXAeU1Yvcw dBDDOiQULdrmBLYtYi72ibr2ai7fWP0W4YDEwlIdrfRXL/r/oC/mwxSfOkvZUi/tMpK0 SiyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=egAsdi3a; spf=pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id ot6si4540497ejb.337.2021.03.12.09.30.34; Fri, 12 Mar 2021 09:30:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=egAsdi3a; spf=pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 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 S232804AbhCLR36 (ORCPT + 3 others); Fri, 12 Mar 2021 12:29:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232781AbhCLR3a (ORCPT ); Fri, 12 Mar 2021 12:29:30 -0500 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 043EBC061574 for ; Fri, 12 Mar 2021 09:29:30 -0800 (PST) Received: by mail-wm1-x32e.google.com with SMTP id d139-20020a1c1d910000b029010b895cb6f2so15620903wmd.5 for ; Fri, 12 Mar 2021 09:29:29 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=Ih+4JzrKKCuZh71Wtn2Zri+erbNOfm2jAKfFgRpgVkc=; b=egAsdi3aEW4JZxfk0q5zHzACd74hnAJZW1BhFludF55G4gZE2j1NYj4XudQchPEh9R baHpWh6pmn9rH2KwQ2RxO5iG9mF8GhPkL2w6qFaLF+1JzOH+Topn6nlbT3RC2DCLmAzJ OlfxYfmub7ekNglvK6Oa3xw0MXh7RrJQqGD2X7Z8tq5mTQdt7L5aOO1roK+ewYJG8ruB e47xxHest9c8GDMktwJfWwDItZ+cuzr5xZMYoRspPu1UzSHsjNAsvdpA7kLtp9vuFJPT jRDwXH2ug7Rp0quTdwpSAzAWRNruCxBMQPdzRi6u3MJO5ENsm8rtPBad2XVxR9y8+3OS wh0w== 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:mime-version:content-transfer-encoding; bh=Ih+4JzrKKCuZh71Wtn2Zri+erbNOfm2jAKfFgRpgVkc=; b=Y++lt0OeMGQYQctJg3u+jr4hSzUUI2rOC+AoxF5jI7j28FoMy94/C1jK8R8XVFREI1 EK5ZTNfZtRVHxxSDU+/kI9WS2N91sbrVQmo7scmwnc6tXqGzLs1nUygX34a9ErpysREb I/WNSNJNsW1WpAv91l3cJNkQvFMM4Ght9huAer8PFJhgFG3mqX+shLknNUxhQ+BDGLUG 6hAOdyfOrs9qKPJ2sjp3kQCyOtpWfqxlDQOo4P/GHWWWAuGXo03QgPDMLmPehVKpDsWS XMOq++PRnjIiPWAl81uUOvLkFBOLYKrRz0r/B3S3Uj58HYoYUaD2je2H8+4sPiZ6l1vt gnsw== X-Gm-Message-State: AOAM531bh3mtbbqNub1+S/UM8Tki2JhrFr1dT3nAHVavQb9u+3tYVGcw E9iRLo03PkEY9mXy9iOf1uWPcw== X-Received: by 2002:a05:600c:224e:: with SMTP id a14mr14029517wmm.57.1615570168760; Fri, 12 Mar 2021 09:29:28 -0800 (PST) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id 18sm2876375wmj.21.2021.03.12.09.29.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 09:29:28 -0800 (PST) From: Bryan O'Donoghue To: stanimir.varbanov@linaro.org, agross@kernel.org, bjorn.andersson@linaro.org, mchehab@kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: bryan.odonoghue@linaro.org, dikshita@codeaurora.org, jonathan@marek.ca, vgarodia@codeaurora.org Subject: [PATCH v2 17/25] media: venus: core, pm: Vote for min clk freq during venus boot Date: Fri, 12 Mar 2021 17:30:31 +0000 Message-Id: <20210312173039.1387617-18-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210312173039.1387617-1-bryan.odonoghue@linaro.org> References: <20210312173039.1387617-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Dikshita Agarwal Vote for min clk frequency for core clks during prepare and enable clocks at boot sequence. Without this the controller clock runs at very low value (9.6MHz) which is not sufficient to boot venus. Signed-off-by: Dikshita Agarwal Signed-off-by: Bryan O'Donoghue --- drivers/media/platform/qcom/venus/pm_helpers.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) -- 2.30.1 diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c index a23e490b6139..a91dc24de2a4 100644 --- a/drivers/media/platform/qcom/venus/pm_helpers.c +++ b/drivers/media/platform/qcom/venus/pm_helpers.c @@ -41,10 +41,24 @@ static int core_clks_get(struct venus_core *core) static int core_clks_enable(struct venus_core *core) { const struct venus_resources *res = core->res; + const struct freq_tbl *freq_tbl = core->res->freq_tbl; + unsigned int freq_tbl_size = core->res->freq_tbl_size; + unsigned long freq; unsigned int i; int ret; + if (!freq_tbl) + return -EINVAL; + + freq = freq_tbl[freq_tbl_size - 1].freq; + for (i = 0; i < res->clks_num; i++) { + if (IS_V6(core)) { + ret = clk_set_rate(core->clks[i], freq); + if (ret) + goto err; + } + ret = clk_prepare_enable(core->clks[i]); if (ret) goto err; From patchwork Fri Mar 12 17:30:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 399858 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B133FC43619 for ; Fri, 12 Mar 2021 17:30:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9E05464FB5 for ; Fri, 12 Mar 2021 17:30:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232509AbhCLR37 (ORCPT ); Fri, 12 Mar 2021 12:29:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232782AbhCLR3b (ORCPT ); Fri, 12 Mar 2021 12:29:31 -0500 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 073D1C061574 for ; Fri, 12 Mar 2021 09:29:31 -0800 (PST) Received: by mail-wr1-x432.google.com with SMTP id x16so2211327wrn.4 for ; Fri, 12 Mar 2021 09:29:30 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=igIfstulndJUDaEydUX1L/UHdeNF+qcRikxpyKWA0c4=; b=CCg5Z+aWawW5CS+zYkb+0/PlVx3P/GQoS+JTCL6s3SDDYzYL9eU9pji03oc4esfeIY 75wf2ikW78ytoTJIfTodlVERmgkMVmoW0cObgT9Vvb7gD74OCZy/uPxomaGqzd9RNItx HlFSokszZb3ATFHdhpo/b7Lbx587GyOnXbx0vWbGTRQm41kAtg3vbuUWoBrmNwX3ojf2 Z0rA1azyVGZWvjHHkKbqKxnznRifApTiLcH1G4Z6M3aErVwoifWfqDle/Pb2TQOmBARv dRSEKIO4ZQyA1j3s/ULpxdZew6UOn7n/M06J80EzHQXW9KNu3qmuj5Y7L5asaofL/E7V EGRw== 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:mime-version:content-transfer-encoding; bh=igIfstulndJUDaEydUX1L/UHdeNF+qcRikxpyKWA0c4=; b=N2ZkfJWJjimS0THoQoy0zyyzHaaC5WEznKoM9iC8wS/ZurMFPZ5BXN5nYT6ze4G7Wn MDxxmJWDKb6YCm1WgS2UXxC+U8WdWX1s/6Tmc49ykKXzDdGyN/Z7CPw48lJXmKv8Ka4m cESUXHwZJvz+Xt1b2NkXezCuVSpilWO0ky40JcC/19mBWpoBQ7zrIam0WMSBBOEG+MMe gsiYix4Jm3RYbpiv7G4gixp8a1V97TToEtkNWqX9O01FtUAo+MMXXqusT0BB2WcEs3AC 6CE93aIEJ6e5U4TlqRk7Y/tesyKkXhs++59c14VgkrRzGBhKLeXBAIxol7390S2Jm3Sn zaZQ== X-Gm-Message-State: AOAM533+A04VQFhAtaGYeVZ7WzeckDu1Ms3SHCqr7PUuTvbvaAebA9nV bahFjjeT/aBx7qMmKGtRXahxlg== X-Google-Smtp-Source: ABdhPJyax0ojiE9GFA7Q3DZCH5U2b/lbzWtpwBKZfdPGonRz9TcOj06PYi6xUBuIsI863UeC3BtbrA== X-Received: by 2002:adf:b1c9:: with SMTP id r9mr15498127wra.51.1615570169732; Fri, 12 Mar 2021 09:29:29 -0800 (PST) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id 18sm2876375wmj.21.2021.03.12.09.29.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 09:29:29 -0800 (PST) From: Bryan O'Donoghue To: stanimir.varbanov@linaro.org, agross@kernel.org, bjorn.andersson@linaro.org, mchehab@kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: bryan.odonoghue@linaro.org, dikshita@codeaurora.org, jonathan@marek.ca, vgarodia@codeaurora.org Subject: [PATCH v2 18/25] media: venus: hfi: Add 6xx AXI halt logic Date: Fri, 12 Mar 2021 17:30:32 +0000 Message-Id: <20210312173039.1387617-19-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210312173039.1387617-1-bryan.odonoghue@linaro.org> References: <20210312173039.1387617-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Dikshita Agarwal This patch takes the downstream AXI halt routine and applies it when IS_V6() is true. bod: Converted to readl_poll_timeout() Removed poll timeout for LPI register, testing showed the value would always timeout and work, so the polling did nothing of value. Signed-off-by: Dikshita Agarwal Co-developed-by: Bryan O'Donoghue Signed-off-by: Bryan O'Donoghue --- drivers/media/platform/qcom/venus/hfi_venus.c | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c index 24cf20f76e7f..cebb20cf371f 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -541,10 +541,42 @@ static int venus_halt_axi(struct venus_hfi_device *hdev) { void __iomem *wrapper_base = hdev->core->wrapper_base; void __iomem *vbif_base = hdev->core->vbif_base; + void __iomem *cpu_cs_base = hdev->core->cpu_cs_base; + void __iomem *aon_base = hdev->core->aon_base; struct device *dev = hdev->core->dev; u32 val; + u32 mask_val; int ret; + if (IS_V6(hdev->core)) { + writel(0x3, cpu_cs_base + CPU_CS_X2RPMH_V6); + + writel(0x1, aon_base + AON_WRAPPER_MVP_NOC_LPI_CONTROL); + ret = readl_poll_timeout(aon_base + AON_WRAPPER_MVP_NOC_LPI_STATUS, + val, + val & BIT(0), + POLL_INTERVAL_US, + VBIF_AXI_HALT_ACK_TIMEOUT_US); + if (ret) + return -ETIMEDOUT; + + mask_val = (BIT(2) | BIT(1) | BIT(0)); + writel(mask_val, wrapper_base + WRAPPER_DEBUG_BRIDGE_LPI_CONTROL_V6); + + writel(0x00, wrapper_base + WRAPPER_DEBUG_BRIDGE_LPI_CONTROL_V6); + ret = readl_poll_timeout(wrapper_base + WRAPPER_DEBUG_BRIDGE_LPI_STATUS_V6, + val, + val == 0, + POLL_INTERVAL_US, + VBIF_AXI_HALT_ACK_TIMEOUT_US); + + if (ret) { + dev_err(dev, "DBLP Release: lpi_status %x\n", val); + return -ETIMEDOUT; + } + return 0; + } + if (IS_V4(hdev->core)) { val = readl(wrapper_base + WRAPPER_CPU_AXI_HALT); val |= WRAPPER_CPU_AXI_HALT_HALT; From patchwork Fri Mar 12 17:30:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 399857 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A8DC0C41620 for ; Fri, 12 Mar 2021 17:30:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 97EA464F70 for ; Fri, 12 Mar 2021 17:30:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232814AbhCLR37 (ORCPT ); Fri, 12 Mar 2021 12:29:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232348AbhCLR3c (ORCPT ); Fri, 12 Mar 2021 12:29:32 -0500 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BD7FC061574 for ; Fri, 12 Mar 2021 09:29:32 -0800 (PST) Received: by mail-wr1-x435.google.com with SMTP id d15so5241220wrv.5 for ; Fri, 12 Mar 2021 09:29:32 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=aAjW4GW8O+sHFwP0oe1kd9Dh6BYS5Lz26CDNq9x7MhQ=; b=yeZNMB70f5BCRmJb1J0fsPQGQikVHcGeCNRrqgnUVrnZAjbPnUA5xhTiXtjpmp9wqY oZS2RVdqzB3Pa/X5He9+hmhD4d37fDszTNwcDm2laR+7I7K3MO6tYQ0fbrElex+VAB3x YInapK7FzunSoV2C68ZJLiK9XbCs8YHcb//GJZ8RcdGFRbaETHs4XwJTanbqwQoYTVKt m2YxSWKVrZRKwLHQ6JgA31UzjKoqf8q5c/mfSJsaSi11QzHktSM0wjMnO2+e+R7r4x/g J6Pxt2EelkWgEw7JjfOCRLqg6JYM3iGB6XE+y2H6BbcuRfT6g8PRjDthmgGPV8EcfIyH SRcw== 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:mime-version:content-transfer-encoding; bh=aAjW4GW8O+sHFwP0oe1kd9Dh6BYS5Lz26CDNq9x7MhQ=; b=takspaUFLnbLoBnUKJkXlLchA4LTN5m4SratuUZPZEXmgOM8VKnZ6xNElq6IaisN7G MDR7yT3nLIwUWhB6Jjz+PKWz0NVIlvRzJQBpvpYbVrwF4NAGlfABrEK+796sNQG2TULz D4Rorf854lK7Ew9+NMbkp196wn4fqUW6qDmT/g0RXUPsWtCweacGxJx/TBRAM8AcCdQx qsoLvjeYqFLNfQ42MamdvaV5A2NLXsM96xF5+1+pdFbx0B3S9/6BWmuopduxoR6TjFc2 dI9xz08p80aniXIv4pN5/7ZAjypSoikBi24igr7+tpfAYjX4wP9vuKWk3guDI1eAJJOL qH6Q== X-Gm-Message-State: AOAM5316VJkaGNpZROVik3wZNyrf22MvB766dlQlSjQiy6DOay0nSPXp RIMIAJpTa/rgUB0oFwViUs51LA== X-Google-Smtp-Source: ABdhPJzoxUEPdbzDasCwHG4HEcfsMeFtAjoyhGRW1k43GalTTAEHFV3CFAcJ6fxKTtnGdroKLvA/RA== X-Received: by 2002:a5d:4686:: with SMTP id u6mr15015847wrq.60.1615570171020; Fri, 12 Mar 2021 09:29:31 -0800 (PST) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id 18sm2876375wmj.21.2021.03.12.09.29.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 09:29:30 -0800 (PST) From: Bryan O'Donoghue To: stanimir.varbanov@linaro.org, agross@kernel.org, bjorn.andersson@linaro.org, mchehab@kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: bryan.odonoghue@linaro.org, dikshita@codeaurora.org, jonathan@marek.ca, vgarodia@codeaurora.org Subject: [PATCH v2 19/25] media: venus: pm: Toggle 6xx wrapper power in vcodec_control Date: Fri, 12 Mar 2021 17:30:33 +0000 Message-Id: <20210312173039.1387617-20-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210312173039.1387617-1-bryan.odonoghue@linaro.org> References: <20210312173039.1387617-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Dikshita Agarwal When in vcodec_control_v4() on the 4xx path we select between one of two vcodec cores to toggle power control bits. In 6xx there is only one core which offsets the relevant control registers to a slightly different address. This patch accounts for the address offset for 6xx silicon. Signed-off-by: Dikshita Agarwal Co-developed-by: Bryan O'Donoghue Signed-off-by: Bryan O'Donoghue --- drivers/media/platform/qcom/venus/pm_helpers.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c index a91dc24de2a4..dfe3ee84eeb6 100644 --- a/drivers/media/platform/qcom/venus/pm_helpers.c +++ b/drivers/media/platform/qcom/venus/pm_helpers.c @@ -414,7 +414,10 @@ static int vcodec_control_v4(struct venus_core *core, u32 coreid, bool enable) u32 val; int ret; - if (coreid == VIDC_CORE_ID_1) { + if (IS_V6(core)) { + ctrl = core->wrapper_base + WRAPPER_CORE_POWER_CONTROL_V6; + stat = core->wrapper_base + WRAPPER_CORE_POWER_STATUS_V6; + } else if (coreid == VIDC_CORE_ID_1) { ctrl = core->wrapper_base + WRAPPER_VCODEC0_MMCC_POWER_CONTROL; stat = core->wrapper_base + WRAPPER_VCODEC0_MMCC_POWER_STATUS; } else { From patchwork Fri Mar 12 17:30:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 399110 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 68A77C28E82 for ; Fri, 12 Mar 2021 17:30:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4FD8665030 for ; Fri, 12 Mar 2021 17:30:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232884AbhCLRaB (ORCPT ); Fri, 12 Mar 2021 12:30:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232822AbhCLR3d (ORCPT ); Fri, 12 Mar 2021 12:29:33 -0500 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34926C061574 for ; Fri, 12 Mar 2021 09:29:33 -0800 (PST) Received: by mail-wm1-x333.google.com with SMTP id c76-20020a1c9a4f0000b029010c94499aedso16268826wme.0 for ; Fri, 12 Mar 2021 09:29:33 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=WKTuRup8dPa/K5+GFpnvDSVBJYngatFOEgMROjY7gcc=; b=b0JTfx0uO5qWWjVtsMhOMtSGVIQd2mJGlrzHR4wEgCXwmZvtORgoCayl11gDTbN9ph 1WKmSG8KMO8NG8BiBCphPPLXMiQFIohDpPI7s72ybCQFrcLAkDw0PDNBGE4xVSqHSeBQ YHmIxnxRz9wmhd6iPml/0u1HM/lhfXlOuLYIKWn1OEMfPNTERbAa62NqZqVCJ4tb32wH URF0yQq3IoCDsdSNs11BYkAhNCzUWo3nTOr2JLPjSyjGwBXF7HHAdrGlw88Vhh5x17xE ZGMAjKKy7KZv5tTtDCl712ol3c6ct/1QuxCSH8HmpsF5GjTrbcZ8W8SVkk7FohWxph5y koaQ== 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:mime-version:content-transfer-encoding; bh=WKTuRup8dPa/K5+GFpnvDSVBJYngatFOEgMROjY7gcc=; b=pNkEiMdZRS0kKM1NKUKKGZKLEt6PdKbxKLpDx9cjm5Jf/dcTLLFjuvpHodYWQr7eVv w2N8w2wIQ6FRQ1fdAvbLTnTxCDHGeQ08tI0QGR80r1cLDpUFdcl8l0NncPxUgkLqVf4r PGR8G2OENQwPabFnz9uQ7yuoVaA9j6i9ZrXURVDIZKijzTj3oCaP7Vpzc3IUGdb7XBpt keTP4mCLnsabRPzlg6S6nMo13MsX7DGf7ma7MbagguJSl8n9rp8RB61Fy4kjo17rSM8W K25vLL3Lp/Uf1n2M6vkly2imdd/ZUZ6daLA4SsdUnic/+zqwot/vWJNP1DzmYoZfqHum oMvw== X-Gm-Message-State: AOAM5324VhtywNYZmreQrJ47sW56vGptiIyW2wcSLI24vD8fwAdCGyRA 69ez9zZ4ixLM6XyCY5B8i7EnSA== X-Google-Smtp-Source: ABdhPJw5k2nNX7HyV5ZXMpGjwg9SGHPAAzHuioH00kVzr3qv9+O2NKDdLdS0XK0TCefPQx9z8WREpA== X-Received: by 2002:a7b:cc85:: with SMTP id p5mr14274777wma.148.1615570171959; Fri, 12 Mar 2021 09:29:31 -0800 (PST) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id 18sm2876375wmj.21.2021.03.12.09.29.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 09:29:31 -0800 (PST) From: Bryan O'Donoghue To: stanimir.varbanov@linaro.org, agross@kernel.org, bjorn.andersson@linaro.org, mchehab@kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: bryan.odonoghue@linaro.org, dikshita@codeaurora.org, jonathan@marek.ca, vgarodia@codeaurora.org Subject: [PATCH v2 20/25] media: venus: firmware: Do not toggle WRAPPER_A9SS_SW_RESET on 6xx Date: Fri, 12 Mar 2021 17:30:34 +0000 Message-Id: <20210312173039.1387617-21-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210312173039.1387617-1-bryan.odonoghue@linaro.org> References: <20210312173039.1387617-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Dikshita Agarwal Do not toggle the WRAPPER_A9SS_SW_RESET on 6xx. Signed-off-by: Dikshita Agarwal Signed-off-by: Bryan O'Donoghue --- drivers/media/platform/qcom/venus/firmware.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/qcom/venus/firmware.c b/drivers/media/platform/qcom/venus/firmware.c index 8c2c68114bbd..227bd3b3f84c 100644 --- a/drivers/media/platform/qcom/venus/firmware.c +++ b/drivers/media/platform/qcom/venus/firmware.c @@ -53,10 +53,12 @@ int venus_set_hw_state(struct venus_core *core, bool resume) return ret; } - if (resume) + if (resume) { venus_reset_cpu(core); - else - writel(1, core->wrapper_base + WRAPPER_A9SS_SW_RESET); + } else { + if (!IS_V6(core)) + writel(1, core->wrapper_base + WRAPPER_A9SS_SW_RESET); + } return 0; } From patchwork Fri Mar 12 17:30:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 399107 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EE6F6C28E87 for ; Fri, 12 Mar 2021 17:30:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D889964FD9 for ; Fri, 12 Mar 2021 17:30:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232871AbhCLRaB (ORCPT ); Fri, 12 Mar 2021 12:30:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232834AbhCLR3e (ORCPT ); Fri, 12 Mar 2021 12:29:34 -0500 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B1CDC061761 for ; Fri, 12 Mar 2021 09:29:34 -0800 (PST) Received: by mail-wr1-x432.google.com with SMTP id k8so2201159wrc.3 for ; Fri, 12 Mar 2021 09:29:34 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=H+VWOzX67+CEjyIdRpA0ujBUTlfl5OrO0AA2YdHipuU=; b=mM19z4gyGVmoJQgOPOL3LtyrsrXFCUog79ECvDECuO0J6xLzCKAXkq8EgKxyMuQhan vSAgum4M7EH46L90EAHiQ3eTUUbbukcXHP5Gzn7LXTJRoosRY6lGLDs5uq+nry2SCNCU UE+LiyStqY+wYXjAIMQFlLXS70tQ9DFxb1GJO+y+eCQWPsL04UWfmadRGtmnQ2BzWngi P7uJfIQiYXuTakuwkZ90Sy3jePAYFCD1SMMBDahKzBhzdwz51pNfaGSuQZA7Zi2d5E1K 4FGss8rpli7Kff+mV8xKUR09uN2uC7U4E5PVVR3n+yoa30q418smgdIQSJJiNLKzvYt5 i5Rg== 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:mime-version:content-transfer-encoding; bh=H+VWOzX67+CEjyIdRpA0ujBUTlfl5OrO0AA2YdHipuU=; b=cmAmRChGIPAOqdRPzSOJyuRJNDZwJCfBtZZEdDS8esrImS1yh2TcJo6ZGeWZKXBepP AtuxDLmnUyIaZ5dgcpEOmOuUGi0Y97fTzEZRrb0g/T8KRkQoEc8Pfz55h+4eSCIK06d5 YtaFwf9ebOM49DZRg0iG5uQKQs9bugQ7FFRuU4X7yQNO/Gb62QLvaRT48ZyZVmYfLsjp Bis/J1NLFsPXuCyx/xSKOVhlxq61N5U49pqn2hCChGUTy2G2bOWTrKsNc7n9/Olbs5sX nivYGMsjxkFDaZ3FyUoEpKeGJKJQrOIcJMQiXn45lN/FUxJt8n6yWcowU9BptbRisezx khJg== X-Gm-Message-State: AOAM530Xf+eDJ2+gJlWwkhuArGbRIixo+52gbeb+v+D0VhNGpJWdXJC/ HelVNFbw17CiU9ykNvJrMKoshQ== X-Google-Smtp-Source: ABdhPJzyxsGnagBqaGVi977ydCKKdQ5pYkOAhhVCPN6AVDRqnye6KZL9A9IuwhDKwD/0WaimS2pzWA== X-Received: by 2002:a5d:65cd:: with SMTP id e13mr15369274wrw.334.1615570172914; Fri, 12 Mar 2021 09:29:32 -0800 (PST) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id 18sm2876375wmj.21.2021.03.12.09.29.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 09:29:32 -0800 (PST) From: Bryan O'Donoghue To: stanimir.varbanov@linaro.org, agross@kernel.org, bjorn.andersson@linaro.org, mchehab@kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: bryan.odonoghue@linaro.org, dikshita@codeaurora.org, jonathan@marek.ca, vgarodia@codeaurora.org Subject: [PATCH v2 21/25] media: venus: helpers: Add internal buffer list for v6 Date: Fri, 12 Mar 2021 17:30:35 +0000 Message-Id: <20210312173039.1387617-22-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210312173039.1387617-1-bryan.odonoghue@linaro.org> References: <20210312173039.1387617-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Dikshita Agarwal - Internal buffers required by v6 are different than v4, add new list of internal buffers for v6. - Differentiate encoder/decoder buffers for 6xx Signed-off-by: Dikshita Agarwal Signed-off-by: Bryan O'Donoghue --- drivers/media/platform/qcom/venus/helpers.c | 13 ++++++++++++- drivers/media/platform/qcom/venus/hfi_helper.h | 9 ++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c index 2515a2225614..8b08632b0296 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -279,13 +279,24 @@ static const unsigned int intbuf_types_4xx[] = { HFI_BUFFER_INTERNAL_PERSIST_1, }; +static const unsigned int intbuf_types_6xx[] = { + HFI_BUFFER_INTERNAL_SCRATCH(HFI_VERSION_6XX), + HFI_BUFFER_INTERNAL_SCRATCH_1(HFI_VERSION_6XX), + HFI_BUFFER_INTERNAL_SCRATCH_2(HFI_VERSION_6XX), + HFI_BUFFER_INTERNAL_PERSIST, + HFI_BUFFER_INTERNAL_PERSIST_1, +}; + int venus_helper_intbufs_alloc(struct venus_inst *inst) { const unsigned int *intbuf; size_t arr_sz, i; int ret; - if (IS_V4(inst->core)) { + if (IS_V6(inst->core)) { + arr_sz = ARRAY_SIZE(intbuf_types_6xx); + intbuf = intbuf_types_6xx; + } else if (IS_V4(inst->core)) { arr_sz = ARRAY_SIZE(intbuf_types_4xx); intbuf = intbuf_types_4xx; } else { diff --git a/drivers/media/platform/qcom/venus/hfi_helper.h b/drivers/media/platform/qcom/venus/hfi_helper.h index 6b524c7cde5f..f367f43c9fb7 100644 --- a/drivers/media/platform/qcom/venus/hfi_helper.h +++ b/drivers/media/platform/qcom/venus/hfi_helper.h @@ -395,11 +395,14 @@ #define HFI_BUFFER_INTERNAL_PERSIST 0x4 #define HFI_BUFFER_INTERNAL_PERSIST_1 0x5 #define HFI_BUFFER_INTERNAL_SCRATCH(ver) \ - (((ver) == HFI_VERSION_4XX) ? 0x6 : 0x1000001) + (((ver) == HFI_VERSION_4XX || \ + (ver) == HFI_VERSION_6XX) ? 0x6 : 0x1000001) #define HFI_BUFFER_INTERNAL_SCRATCH_1(ver) \ - (((ver) == HFI_VERSION_4XX) ? 0x7 : 0x1000005) + (((ver) == HFI_VERSION_4XX || \ + (ver) == HFI_VERSION_6XX) ? 0x7 : 0x1000005) #define HFI_BUFFER_INTERNAL_SCRATCH_2(ver) \ - (((ver) == HFI_VERSION_4XX) ? 0x8 : 0x1000006) + (((ver) == HFI_VERSION_4XX || \ + (ver) == HFI_VERSION_6XX) ? 0x8 : 0x1000006) #define HFI_BUFFER_EXTRADATA_INPUT(ver) \ (((ver) == HFI_VERSION_4XX) ? 0xc : 0x1000002) #define HFI_BUFFER_EXTRADATA_OUTPUT(ver) \ From patchwork Fri Mar 12 17:30:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 399108 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DCEA8C433E6 for ; Fri, 12 Mar 2021 17:30:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C4AAE64F6E for ; Fri, 12 Mar 2021 17:30:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232887AbhCLRaC (ORCPT ); Fri, 12 Mar 2021 12:30:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232840AbhCLR3f (ORCPT ); Fri, 12 Mar 2021 12:29:35 -0500 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C4D9C061761 for ; Fri, 12 Mar 2021 09:29:35 -0800 (PST) Received: by mail-wr1-x42d.google.com with SMTP id t9so2204385wrn.11 for ; Fri, 12 Mar 2021 09:29:35 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=h/1m3DWd44KCU/zJg1w1e4xe6C62w7x/Ijni5XUJONA=; b=FNuYEYjDs1UT59nWsAKz9Lg4Jz8xgrT5SkAoHr1/wu6p2w3HyunTxx3fsrk8uZuvay 1P19KDaIMbkkLySOqaNZkkkq1I4NYKd01UaRJ1a6ExAV3bi2/pi9TGfjmWCkgf0BeaWm fVB8ulPD3aqs63ICpiykYthyBksI8s3lgVLF6wsPnEEvMHbYwJelhMwvC9hPjnWKn+Bn 13AgUOdPbCPaXyhNDjfCqC8VeXwJWGWkJaxq9Mol8kh4ui3tqKC6VsWcJGfjyDiHGoke 1/Oa2oFXwb6GbuFLcQj2yfTd3KHcQrO3nCXVPk6fThO5yNt7xIPqeB3uclMEmxSFuVxg Xiqg== 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:mime-version:content-transfer-encoding; bh=h/1m3DWd44KCU/zJg1w1e4xe6C62w7x/Ijni5XUJONA=; b=s08ZpbTujk1yI4ZQjoH8hVaxWdxrbEJn3LeRLk19rgp4kAL2asjxTJrSsYF6MUMW5j Vt/QnIz5sDhrjm0vnWryFJ0CCWNeTk+iuO1KDvy98lGIgzX5nTtDt1lOctGL0mBc/dRo bMFlY3o/CAR3cbWLGJhmXcMAMCQXLQGG+g5g5eu9LRD3tUSaCU9jgs3zwSFVUjk6Tqtn cqnGKf1VRMSPFJR/5RzwW+YYNp9z/B5Yv059TfEt/J6Bk5nxLneAyjfZg95eB71QjhzK fmTExJh1ZmNCh+bBa0tnX7Fftsb0e4Y0HzR+qEp3pbiD1BjbD8+XD9l/2JmcneszKAyq VNYQ== X-Gm-Message-State: AOAM531PaDLrQIj5b1gXBhXoCI0MdNe028mz14HDUJ34/eCaPDi/HW22 tXcpKErvuRf682yu1/AyVGgZ2w== X-Google-Smtp-Source: ABdhPJwqnzM6/MjhX3uQPVJnfItZsgWrdBVMO7JzqVrmnZuc5Lg49wOrNX1DCpOp/elrHgUanNBAKw== X-Received: by 2002:a05:6000:188b:: with SMTP id a11mr14903239wri.151.1615570173869; Fri, 12 Mar 2021 09:29:33 -0800 (PST) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id 18sm2876375wmj.21.2021.03.12.09.29.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 09:29:33 -0800 (PST) From: Bryan O'Donoghue To: stanimir.varbanov@linaro.org, agross@kernel.org, bjorn.andersson@linaro.org, mchehab@kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: bryan.odonoghue@linaro.org, dikshita@codeaurora.org, jonathan@marek.ca, vgarodia@codeaurora.org Subject: [PATCH v2 22/25] media: venus: helpers, hfi, vdec: Set actual plane constraints to FW Date: Fri, 12 Mar 2021 17:30:36 +0000 Message-Id: <20210312173039.1387617-23-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210312173039.1387617-1-bryan.odonoghue@linaro.org> References: <20210312173039.1387617-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Dikshita Agarwal Set actual plane alignments to FW with HFI_PROPERTY_PARAM_UNCOMPRESSED_PLANE_ACTUAL_CONSTRAINTS_INFO to calculate correct buffer size. bod: Fixed fall-through error in pkt_session_set_property_6xx() switch Ensure setting format constraints on 6xx only Signed-off-by: Dikshita Agarwal Signed-off-by: Bryan O'Donoghue --- drivers/media/platform/qcom/venus/helpers.c | 24 ++++++++++++++++++++ drivers/media/platform/qcom/venus/helpers.h | 1 + drivers/media/platform/qcom/venus/hfi_cmds.c | 13 +++++++++++ drivers/media/platform/qcom/venus/vdec.c | 4 ++++ 4 files changed, 42 insertions(+) diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c index 8b08632b0296..77ffb8fbb47f 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -1103,6 +1103,30 @@ int venus_helper_set_work_mode(struct venus_inst *inst, u32 mode) } EXPORT_SYMBOL_GPL(venus_helper_set_work_mode); +int venus_helper_set_format_constraints(struct venus_inst *inst) +{ + const u32 ptype = HFI_PROPERTY_PARAM_UNCOMPRESSED_PLANE_ACTUAL_CONSTRAINTS_INFO; + struct hfi_uncompressed_plane_actual_constraints_info pconstraint; + + if (!IS_V6(inst->core)) + return 0; + + pconstraint.buffer_type = HFI_BUFFER_OUTPUT2; + pconstraint.num_planes = 2; + pconstraint.plane_format[0].stride_multiples = 128; + pconstraint.plane_format[0].max_stride = 8192; + pconstraint.plane_format[0].min_plane_buffer_height_multiple = 32; + pconstraint.plane_format[0].buffer_alignment = 256; + + pconstraint.plane_format[1].stride_multiples = 128; + pconstraint.plane_format[1].max_stride = 8192; + pconstraint.plane_format[1].min_plane_buffer_height_multiple = 16; + pconstraint.plane_format[1].buffer_alignment = 256; + + return hfi_session_set_property(inst, ptype, &pconstraint); +} +EXPORT_SYMBOL_GPL(venus_helper_set_format_constraints); + int venus_helper_set_num_bufs(struct venus_inst *inst, unsigned int input_bufs, unsigned int output_bufs, unsigned int output2_bufs) diff --git a/drivers/media/platform/qcom/venus/helpers.h b/drivers/media/platform/qcom/venus/helpers.h index 351093845499..98106e6eee85 100644 --- a/drivers/media/platform/qcom/venus/helpers.h +++ b/drivers/media/platform/qcom/venus/helpers.h @@ -33,6 +33,7 @@ int venus_helper_set_output_resolution(struct venus_inst *inst, unsigned int width, unsigned int height, u32 buftype); int venus_helper_set_work_mode(struct venus_inst *inst, u32 mode); +int venus_helper_set_format_constraints(struct venus_inst *inst); int venus_helper_set_num_bufs(struct venus_inst *inst, unsigned int input_bufs, unsigned int output_bufs, unsigned int output2_bufs); diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.c b/drivers/media/platform/qcom/venus/hfi_cmds.c index 558510a8dfc8..0bcd434e7876 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.c +++ b/drivers/media/platform/qcom/venus/hfi_cmds.c @@ -1249,6 +1249,19 @@ pkt_session_set_property_6xx(struct hfi_session_set_property_pkt *pkt, pkt->data[0] = ptype; switch (ptype) { + case HFI_PROPERTY_PARAM_UNCOMPRESSED_PLANE_ACTUAL_CONSTRAINTS_INFO: { + struct hfi_uncompressed_plane_actual_constraints_info *in = pdata; + struct hfi_uncompressed_plane_actual_constraints_info *info = prop_data; + + info->buffer_type = in->buffer_type; + info->num_planes = in->num_planes; + info->plane_format[0] = in->plane_format[0]; + if (in->num_planes > 1) + info->plane_format[1] = in->plane_format[1]; + + pkt->shdr.hdr.size += sizeof(u32) + sizeof(*info); + break; + } case HFI_PROPERTY_CONFIG_HEIC_FRAME_QUALITY: { struct hfi_heic_frame_quality *in = pdata, *cq = prop_data; diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index 5cefa396f2b5..fdc9984acb70 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -706,6 +706,10 @@ static int vdec_output_conf(struct venus_inst *inst) if (ret) return ret; + ret = venus_helper_set_format_constraints(inst); + if (ret) + return ret; + if (inst->dpb_fmt) { ret = venus_helper_set_multistream(inst, false, true); if (ret) From patchwork Fri Mar 12 17:30:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 398685 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1385529jai; Fri, 12 Mar 2021 09:32:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJyXl8GsOJxyh/9S2nkkZgmJRnK3FXZZLoC+ByG4iWBbTihb/0P90zDBZUo1AvpugE2upya7 X-Received: by 2002:a17:907:7249:: with SMTP id ds9mr9917084ejc.9.1615570239211; Fri, 12 Mar 2021 09:30:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615570239; cv=none; d=google.com; s=arc-20160816; b=hsx/HHmiM5VdvDpMgx/Mf4lWPuK8bWbxW72w1X2JQpYKa08PptaiiC9BFctc8maFwY 1qGY2kniKYbrPsiVJux9abPdmK0Yw7Kh6k/LvXkzHrvW0icb8yam56+oYe1hCZR7SsU+ ESIibiZbZc5Jbzo7l77U5hUBGCdm5ZY7BhvFcFqg8A9Zvl1o3HA9fcnqW/TRT/rmmfP3 uCICEJNx1jOuHLI0TtG9mHr1j6lXMZLHkecoi1K00u3gAf4DWWJZtFWhP5QUrh6CxlRk om6tiqWAyv78OuhNsLyBSRlCxDTspy6RjL10j0jNsrdlz+qAJiBqr4gHG38fXPhkrGMV cAyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=0KDBFU7uY8GCljkZCvSyuE+T/PmgRMx06G8Uzy+U6qQ=; b=HnI2K3ldn3kYSDWLitiPSFPD3aZUlUAcFkEySn4xRqKuxrrm+7XLoPiKCCzpZcgvlA fZ+tNxQ+ZWJrq9Hd0weKRHGhrtQQIkKnZnUaiDeawIzRUeKj6x3Zm06kAWMuLkf9eLkj XrItA185dw9Fy8qkEk++sDrIDsBZqm0plFDrR0g3ONBInh3PCbeQLk4U+PvsiZt7/GK9 9lsek3G705d681K0pzWdA+bma8n+1XfuyKJS1tC272xP/TfmR3kf7PkY2EYVaMFeRahq pzfxXAJPn3fEy6Wdal7pvnaXZdm2fNlyonHjjPiu2yqcAJjUjbVV0yGeFZnZi/yI33t7 R6qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NE685g9t; spf=pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id ot6si4540497ejb.337.2021.03.12.09.30.39; Fri, 12 Mar 2021 09:30:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NE685g9t; spf=pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 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 S232888AbhCLRaC (ORCPT + 3 others); Fri, 12 Mar 2021 12:30:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232855AbhCLR3g (ORCPT ); Fri, 12 Mar 2021 12:29:36 -0500 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11D91C061574 for ; Fri, 12 Mar 2021 09:29:36 -0800 (PST) Received: by mail-wm1-x32e.google.com with SMTP id g20so4266436wmk.3 for ; Fri, 12 Mar 2021 09:29:35 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=0KDBFU7uY8GCljkZCvSyuE+T/PmgRMx06G8Uzy+U6qQ=; b=NE685g9tWJqRtw3qMt+hguxSYELgsHYxP94ovl68qt+G1FxWWy92CO0CdoU/P3bb32 wKWApnYEipJ0OeLcHEL4WZTvlWcksoxW6w13aC1zGimi3jZSOt32I+zATQiZxJrA+Rnb cCS14LSGd8zUbg2lWqvyRNMAu4yGgEwlmVE5vATv0YJ+LvvY+KxkGb1WMLg3cooeNJn1 IQBngTTT9wvxQW+BOSApd+iAeWkIkGcsEsSRvpti0muNnLAtrGqAQza4G4tRDphG0oK8 ST4B/skmAjg8npizEInjo6DKygp/Fbtab2Z7DMeG/uibrOFbPg8EWSwB8pV6X4jkESHz 1pKw== 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:mime-version:content-transfer-encoding; bh=0KDBFU7uY8GCljkZCvSyuE+T/PmgRMx06G8Uzy+U6qQ=; b=LCF7wgKjqJG27nX/iW8cvUUFrC/U/d5L+YEW6oCU3AqNncZMNmN+pjAlTpbKBftPwS b72vUdjqjOkesadPlsBCmOOWvukS1VJ//BQD7U0aGGqcHmdYCkLh3xcsiBRRGgK0x7jq cmdfFQDj+UkVYimEpYRsjPtTnAqQVMkeXneulvLT7uwOmDjgpgQwPKelgKpP1RIkcNFz 8OARUUGp2IM6bIRFeUEAF6NosIWRyUCXm6evn+M3P+D6N4YSxLLUFp+yn8CNd7KhcH+P rYdp5UryiLouD7Qw3GrtxRwME/voiLcCWpKi7XigHDiWXazBcAHNwYh8a2UTPuX9YOmO dvBg== X-Gm-Message-State: AOAM530hkwbV4SdVdVbhm/dHBWZWYQ+OzZd6m2ne8s6YIzqedcRzcHWn twUOuXyPQvS3bzMeh/nxW4aAyg== X-Received: by 2002:a05:600c:220d:: with SMTP id z13mr14178776wml.1.1615570174838; Fri, 12 Mar 2021 09:29:34 -0800 (PST) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id 18sm2876375wmj.21.2021.03.12.09.29.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 09:29:34 -0800 (PST) From: Bryan O'Donoghue To: stanimir.varbanov@linaro.org, agross@kernel.org, bjorn.andersson@linaro.org, mchehab@kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: bryan.odonoghue@linaro.org, dikshita@codeaurora.org, jonathan@marek.ca, vgarodia@codeaurora.org Subject: [PATCH v2 23/25] media: venus: hfi: Increase plat_buf_v6 o/p buffer count. Date: Fri, 12 Mar 2021 17:30:37 +0000 Message-Id: <20210312173039.1387617-24-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210312173039.1387617-1-bryan.odonoghue@linaro.org> References: <20210312173039.1387617-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Dikshita Agarwal Presently, minimum buffer count for output buffers for h264 & hevc codec is kept as 8 which might not be sufficient for few use cases so increasing the value to 18. Signed-off-by: Dikshita Agarwal Signed-off-by: Bryan O'Donoghue --- drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.30.1 diff --git a/drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c b/drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c index d43d1a53e72d..075d9546b15e 100644 --- a/drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c +++ b/drivers/media/platform/qcom/venus/hfi_plat_bufs_v6.c @@ -1159,7 +1159,7 @@ static int output_buffer_count(u32 session_type, u32 codec) case V4L2_PIX_FMT_H264: case V4L2_PIX_FMT_HEVC: default: - output_min_count = 8; + output_min_count = 18; break; } } else { From patchwork Fri Mar 12 17:30:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 398681 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1384027jai; Fri, 12 Mar 2021 09:30:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJyruGoAbMOnwZEGrx5Nmm/Pp0/y6KG8tpzSXezShf+gqOnQayJPfJO8jRmPsHg7z5usqq/4 X-Received: by 2002:a17:906:1fd6:: with SMTP id e22mr10043309ejt.481.1615570240803; Fri, 12 Mar 2021 09:30:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615570240; cv=none; d=google.com; s=arc-20160816; b=NmKLvImnHmEjY4jY4wgvaH+FGksk73Qzg/0Y7H+jXQKCvxEFwtwNc1WFVuFFQVYD/l t7si8fb/Z//0/On7ydYPvOVHOlRFu3tctKD/0jnJrX5UooqKemVQ6OpDxGASOrD9CAWg uYQ1w7fkmZ3SKwP+VwwSROg/IEbwJqBqklyqYD+iDPaYp5KoAsp/LFUhVo03OLTfOUFq ep69JGfZkB4q0LWKV/spk4sDHO9EQwxlgZa9ndFmJdpOPhl55m8Dv5tk1oqMdKHbIyx5 4RJvt6rY0WcsCjEIfA+cnVk3i2nICQx1kYfJoLO+UTmPRCoo+pC7CtEgvJ95YylIMU84 l7xQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=BVZp3moArAIOtHWEMLsr048YkEnUBgpfPCCb5RcdFQg=; b=JNSxrFnaXnEN8IDxIWVPbHXtuPOSsd5tC93r5u0JrWvfeSNSZtznNA1eBnF6fwMu2N cy9SEfJ8p3XL8gTgTR1EJF7cdEKRAqneJTt3D5szZDOkUhwgpSALGBq+SSdyxkSV9Br3 KK+T5qEdZLlOztbGy83hIsuro8xYHeea/OIZWAjeW2Md3TtjN9p9ps+1MFLtom5Y5GBK Aa0/+qysz530c56r/KwOphesqUi4mmnjRBUQ3E4ZNZ2Wi9tIDIAtdX1pXqk9zDqogGZl EcBE/tY6jkFxOSkucGuwAq4b0OFrLicrDaY4KaY4TrmcfFq3ox1EJAzbHsKCW6p7V681 ebyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xop5Catn; spf=pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id ot6si4540497ejb.337.2021.03.12.09.30.40; Fri, 12 Mar 2021 09:30:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xop5Catn; spf=pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 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 S232901AbhCLRaC (ORCPT + 3 others); Fri, 12 Mar 2021 12:30:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232862AbhCLR3h (ORCPT ); Fri, 12 Mar 2021 12:29:37 -0500 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13799C061761 for ; Fri, 12 Mar 2021 09:29:37 -0800 (PST) Received: by mail-wm1-x32a.google.com with SMTP id c76-20020a1c9a4f0000b029010c94499aedso16268934wme.0 for ; Fri, 12 Mar 2021 09:29:37 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=BVZp3moArAIOtHWEMLsr048YkEnUBgpfPCCb5RcdFQg=; b=xop5CatnzZXYo0jvlbiGqoGG1bUO1IKZEJF+kUkbamGxnpPtBmWOXbx/4x/Z6mwmbA 4PzTJwiobzqnB9MLmUem/IZ2TkRCnrzf6uXmhUavEubxcy1ZhXTIBhfNZbYcMgsuTbs+ WoeCiuEwMq9wlyrw3VVCohzL7iVnwX9RsjQfwa1yDfr9jG74mud1ARG3q3xnu/SJKnE6 KPSN5am6YexeXBqecjqVv2/NpOcX07S76nA9+0FBaSH/zqt0oVp9wOK3KdEjHMB/r1yd hOHOGrC8SXbz5QCrnHErxwCz//k+/Z/KCR9srfxed6PxgwrRQ+MvIG+fwDGK7MdGJAcY 1YCg== 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:mime-version:content-transfer-encoding; bh=BVZp3moArAIOtHWEMLsr048YkEnUBgpfPCCb5RcdFQg=; b=FTSTfidjMOKabcIjbh/DbBULJzv3y9id1jOjQWBk7ubRq05zSVn1HB2AA6OImXDK2a 281s4YwJAp05Qq8m9qBjzn/3k1V12aumgcEH6eSlSTpi5RZ6q4lz8vcKUxiQFIlClilY fYmns9/B6gGhIN5aiNcVDTVSO+Trj5SSOYpXJ2iz0g0pIQ89Y73GFanlxOz9uhT2n2Om VxjMhOZyJBSdpt3GRkg3pGsn5V/kV4/3FWxBqlTfJ0/3PauMmXlnIfrDoXFuge2/WeAJ nuiwYPP0GAY692p69E9dIQ6jChCVuV3XQ8Y5OuPVpCGSsb2GUbTBRxNi8Odt92dyzfCO kqoQ== X-Gm-Message-State: AOAM532I2nWRnJmfMCPi7Xb+6ZHyzArQj6V5FR40HvNwCahrVwUQrShZ i4JHg++jLbrhuhcOh/7vTQSTqw== X-Received: by 2002:a1c:7210:: with SMTP id n16mr13784499wmc.13.1615570175776; Fri, 12 Mar 2021 09:29:35 -0800 (PST) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id 18sm2876375wmj.21.2021.03.12.09.29.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 09:29:35 -0800 (PST) From: Bryan O'Donoghue To: stanimir.varbanov@linaro.org, agross@kernel.org, bjorn.andersson@linaro.org, mchehab@kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: bryan.odonoghue@linaro.org, dikshita@codeaurora.org, jonathan@marek.ca, vgarodia@codeaurora.org Subject: [PATCH v2 24/25] media: venus: helper: Decide work mode Date: Fri, 12 Mar 2021 17:30:38 +0000 Message-Id: <20210312173039.1387617-25-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210312173039.1387617-1-bryan.odonoghue@linaro.org> References: <20210312173039.1387617-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Dikshita Agarwal Decide work mode for encoder and decoder based on different use-cases. Signed-off-by: Dikshita Agarwal Signed-off-by: Bryan O'Donoghue --- drivers/media/platform/qcom/venus/helpers.c | 31 ++++++++++++++++++++- drivers/media/platform/qcom/venus/helpers.h | 2 +- drivers/media/platform/qcom/venus/vdec.c | 2 +- drivers/media/platform/qcom/venus/venc.c | 2 +- 4 files changed, 33 insertions(+), 4 deletions(-) -- 2.30.1 diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c index 77ffb8fbb47f..dc8ef13d0c95 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -18,6 +18,9 @@ #include "hfi_platform.h" #include "hfi_parser.h" +#define NUM_MBS_720P (((1280 + 15) >> 4) * ((720 + 15) >> 4)) +#define NUM_MBS_4K (((4096 + 15) >> 4) * ((2304 + 15) >> 4)) + struct intbuf { struct list_head list; u32 type; @@ -1090,14 +1093,40 @@ int venus_helper_set_output_resolution(struct venus_inst *inst, } EXPORT_SYMBOL_GPL(venus_helper_set_output_resolution); -int venus_helper_set_work_mode(struct venus_inst *inst, u32 mode) +static u32 venus_helper_get_work_mode(struct venus_inst *inst) +{ + u32 mode; + u32 num_mbs; + + mode = VIDC_WORK_MODE_2; + if (IS_V6(inst->core)) { + if (inst->session_type == VIDC_SESSION_TYPE_DEC) { + num_mbs = (ALIGN(inst->height, 16) * ALIGN(inst->width, 16)) / 256; + if (inst->hfi_codec == HFI_VIDEO_CODEC_MPEG2 || + inst->pic_struct != HFI_INTERLACE_FRAME_PROGRESSIVE || + num_mbs <= NUM_MBS_720P) + mode = VIDC_WORK_MODE_1; + } else { + num_mbs = (ALIGN(inst->out_height, 16) * ALIGN(inst->out_width, 16)) / 256; + if (inst->hfi_codec == HFI_VIDEO_CODEC_VP8 && + num_mbs <= NUM_MBS_4K) + mode = VIDC_WORK_MODE_1; + } + } + + return mode; +} + +int venus_helper_set_work_mode(struct venus_inst *inst) { const u32 ptype = HFI_PROPERTY_PARAM_WORK_MODE; struct hfi_video_work_mode wm; + u32 mode; if (!IS_V4(inst->core) && !IS_V6(inst->core)) return 0; + mode = venus_helper_get_work_mode(inst); wm.video_work_mode = mode; return hfi_session_set_property(inst, ptype, &wm); } diff --git a/drivers/media/platform/qcom/venus/helpers.h b/drivers/media/platform/qcom/venus/helpers.h index 98106e6eee85..e6269b4be3af 100644 --- a/drivers/media/platform/qcom/venus/helpers.h +++ b/drivers/media/platform/qcom/venus/helpers.h @@ -32,7 +32,7 @@ int venus_helper_set_input_resolution(struct venus_inst *inst, int venus_helper_set_output_resolution(struct venus_inst *inst, unsigned int width, unsigned int height, u32 buftype); -int venus_helper_set_work_mode(struct venus_inst *inst, u32 mode); +int venus_helper_set_work_mode(struct venus_inst *inst); int venus_helper_set_format_constraints(struct venus_inst *inst); int venus_helper_set_num_bufs(struct venus_inst *inst, unsigned int input_bufs, unsigned int output_bufs, diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index fdc9984acb70..0fe4863371e2 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -655,7 +655,7 @@ static int vdec_output_conf(struct venus_inst *inst) u32 ptype; int ret; - ret = venus_helper_set_work_mode(inst, VIDC_WORK_MODE_2); + ret = venus_helper_set_work_mode(inst); if (ret) return ret; diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c index 505d092dc433..83425fa8df2d 100644 --- a/drivers/media/platform/qcom/venus/venc.c +++ b/drivers/media/platform/qcom/venus/venc.c @@ -550,7 +550,7 @@ static int venc_set_properties(struct venus_inst *inst) u32 profile, level; int ret; - ret = venus_helper_set_work_mode(inst, VIDC_WORK_MODE_2); + ret = venus_helper_set_work_mode(inst); if (ret) return ret; From patchwork Fri Mar 12 17:30:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 398684 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1385513jai; Fri, 12 Mar 2021 09:32:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJwynpsT2eiQmhBzH8qzxQyX2w8TTzBA/6cRuLSC9LyQ/upUfemQN2v2F7OmJp6YllW2si/l X-Received: by 2002:a17:906:229b:: with SMTP id p27mr10076447eja.287.1615570240385; Fri, 12 Mar 2021 09:30:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615570240; cv=none; d=google.com; s=arc-20160816; b=Cq998710SrslF7Hlcfq9WiYjFt+5OC4MgPMc7/C8g7Ay6ELLaqNEjayIQwjeF7WpMP ynZh4k/kPTRp4AK+Yi8XaIodDWUTPPH5SZg2SM+mWmcDf0tu6WtORC6XzdPvQcMmJmNK syQwalV3MxMAgKxtSbfopGE0Ct/auWWqizeqDb4JyehyUIoItbwnPv3DWqvZBKlgqFwB nIQt2NNktgwkKgq5HTwlc6EdFAj2Lr4pJTP6oWdJG0yy/K7Yq1jd9EY2G0Dbay7Mt76N dtg+nLullvGroc7q136ZmZVFrCIArh+wj7hagl5u+Iwq7ufZv6jDi9Hpdaj4FxHwXEkz 7Jeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ougCNlrbgb2ZXt+39o0iaCSMx7oFooc901KKp5lUaLE=; b=l8PTD1Un9SAVXKbrzUwh7IJHt9uQsDhzxnBzRkTBkBM746b2djiU/5s9gRURxxgHpa cVutPvttiTd/fowqpAGatIBLlKTjrr0Ek1mvbx3G+T7Za/20gqdR6ykbmW/V4ZokDlj2 s+jv6wImIbwXHHNTJj6XQE9JsDXYcjoEiudTj5/OmwNnkYjUC4bWkP1h15gU4SQwzplX v2gUOOnLg9WOmaXb3mvEhiGnPt/TX+7IftQ+rIMyTOdwzsEGYvBS4zUVOMuwXtESOTrV II7ga7MAnWaks/C/xy81YWQXGeYxDkS8EdtI1KPcWayxnY7LmAGtPncGtCyqlW46j2z1 Aihg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=c0Y5NkwJ; spf=pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id ot6si4540497ejb.337.2021.03.12.09.30.40; Fri, 12 Mar 2021 09:30:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=c0Y5NkwJ; spf=pass (google.com: domain of linux-media-owner@vger.kernel.org designates 23.128.96.18 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 S232904AbhCLRaD (ORCPT + 3 others); Fri, 12 Mar 2021 12:30:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232867AbhCLR3i (ORCPT ); Fri, 12 Mar 2021 12:29:38 -0500 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1B67C061574 for ; Fri, 12 Mar 2021 09:29:37 -0800 (PST) Received: by mail-wm1-x336.google.com with SMTP id u5-20020a7bcb050000b029010e9316b9d5so12671267wmj.2 for ; Fri, 12 Mar 2021 09:29:37 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=ougCNlrbgb2ZXt+39o0iaCSMx7oFooc901KKp5lUaLE=; b=c0Y5NkwJz7kyCDJwHHk0VCXWQlUkjJWdjFsk8owQiLrZOoiQYwu5c97yyJzRe0PlAN nWF5vO7X7Aq1oo6uo1JpI8SfUXbMsWvbmurH/40oReBvsIj1YWlmlM2njkXwZ5WRzHtS VAMDKGHVEE/W2iyVHbW6VfentILYj+hxt8hcWgzacsJvx97GyBblW8Fm829ZARRyox84 EZTFHZu1Ftu1Rym4O+bj7OpcDv1w5fYWV6yFK8p15j52opCQs+DPpnS1qFs0Ac+X8I9Y 2o0DWfoarO4qxXFbw6JVSrDLIF5kIdzrZB3uRr6mah79YV9SKuczXegC2s4PMFvnkFr1 w0ow== 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:mime-version:content-transfer-encoding; bh=ougCNlrbgb2ZXt+39o0iaCSMx7oFooc901KKp5lUaLE=; b=ZcdqIm40xWqqIWODuCYWjFSG5mXzu05ph8gTPUmlNhy7WCOtYbD44Ah/UbDC3t5enL WkmqbkziclXI4xD5RIrQilaho5rR84q7sNxd/GiH+Gi5LOE/7aJqYnJV/QxBtEYyvOzB QeDxmdl+6K142VuAtWgK/GiE0CfoInwo7gBL96ICthB2i9Uq24XSSqlF3mwUc4M2MYWc vTK2xFo+/piE0PZV0qfHWjFNpcGkX2cD3kewkmMVEz6x8XXSMDYjbeTlO/Yuf5g5U9eI CNCHwCEJg5zDm5hE18d4kwazeLuZh1ahAyZTPEdDfPQqiEe86LKBOAX17uCQmDxy4PjY t/ng== X-Gm-Message-State: AOAM531dsXVp0dcINPyttBVFZyujs6KgOHo3KmDt+rQa6Lr3xHIJ2o5F uuTNOWvfATFlEDThbDNgPGsgrQ== X-Received: by 2002:a1c:7d4e:: with SMTP id y75mr14209387wmc.168.1615570176757; Fri, 12 Mar 2021 09:29:36 -0800 (PST) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id 18sm2876375wmj.21.2021.03.12.09.29.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 09:29:36 -0800 (PST) From: Bryan O'Donoghue To: stanimir.varbanov@linaro.org, agross@kernel.org, bjorn.andersson@linaro.org, mchehab@kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: bryan.odonoghue@linaro.org, dikshita@codeaurora.org, jonathan@marek.ca, vgarodia@codeaurora.org Subject: [PATCH v2 25/25] media: venus: vdec: Fix decoder cmd STOP issue Date: Fri, 12 Mar 2021 17:30:39 +0000 Message-Id: <20210312173039.1387617-26-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210312173039.1387617-1-bryan.odonoghue@linaro.org> References: <20210312173039.1387617-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Stanimir Varbanov Fixes an issue when issuing a stop command to the controller, negating the following firmware error. "SFR message from FW: Exception: TID = Unknown IP = 0x3b7dc FA = 0x0 cause = 0x6" Signed-off-by: Stanimir Varbanov Signed-off-by: Bryan O'Donoghue --- drivers/media/platform/qcom/venus/hfi_cmds.c | 2 +- drivers/media/platform/qcom/venus/vdec.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) -- 2.30.1 diff --git a/drivers/media/platform/qcom/venus/hfi_cmds.c b/drivers/media/platform/qcom/venus/hfi_cmds.c index 0bcd434e7876..fb64046d1e35 100644 --- a/drivers/media/platform/qcom/venus/hfi_cmds.c +++ b/drivers/media/platform/qcom/venus/hfi_cmds.c @@ -254,7 +254,7 @@ int pkt_session_unset_buffers(struct hfi_session_release_buffer_pkt *pkt, int pkt_session_etb_decoder(struct hfi_session_empty_buffer_compressed_pkt *pkt, void *cookie, struct hfi_frame_data *in_frame) { - if (!cookie || !in_frame->device_addr) + if (!cookie) return -EINVAL; pkt->shdr.hdr.size = sizeof(*pkt); diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index 0fe4863371e2..04f457cbf631 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -515,7 +515,10 @@ vdec_decoder_cmd(struct file *file, void *fh, struct v4l2_decoder_cmd *cmd) fdata.buffer_type = HFI_BUFFER_INPUT; fdata.flags |= HFI_BUFFERFLAG_EOS; - fdata.device_addr = 0xdeadb000; + if (IS_V6(inst->core)) + fdata.device_addr = 0; + else + fdata.device_addr = 0xdeadb000; ret = hfi_session_process_buf(inst, &fdata);