* [PATCH v4 0/9] media: iris: migrate to using global UBWC config
@ 2026-01-25 11:30 Dmitry Baryshkov
2026-01-25 11:30 ` [PATCH v4 1/9] soc: qcom: ubwc: add helper to get min_acc length Dmitry Baryshkov
` (8 more replies)
0 siblings, 9 replies; 15+ messages in thread
From: Dmitry Baryshkov @ 2026-01-25 11:30 UTC (permalink / raw)
To: Bjorn Andersson, Konrad Dybcio, Rob Clark, Dmitry Baryshkov,
Abhinav Kumar, Jessica Zhang, Sean Paul, Marijn Suijten,
David Airlie, Simona Vetter, Akhil P Oommen, Vikash Garodia,
Dikshita Agarwal, Bryan O'Donoghue, Mauro Carvalho Chehab
Cc: Konrad Dybcio, linux-arm-msm, linux-kernel, dri-devel, freedreno,
linux-media, Bryan O'Donoghue, Wangao Wang
Having UBWC configuration in the driver is error prone. For example, the
driver specifies fixed values for HBB, while the actual value might
depend on the DDR type. Stop defining UBWC data in the iris driver and
use the global UBWC configuration registry.
Merge strategy: either merge SoC bits directly through the media tree
(with Bjorn's ack) or merge to the media tree through the immutable tag.
The drm patches will follow depending on the way the SoC patches are
merged.
Note: the patches are compile-tested only because of the lack of the
Gen2 hardware at hand.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
Changes in v4:
- Rebased on next/master, fixing the conflicts.
- Link to v3: https://lore.kernel.org/r/20260116-iris-ubwc-v3-0-662ac0e0761f@oss.qualcomm.com
Changes in v3:
- Dropped applied and unrelated patches (they will be posted separately)
- Include printk.h, decoupling the series from fix picked up by Bjorn
- Introduced additional helpers to retrieve the data.
- Link to v2: https://lore.kernel.org/r/20260113-iris-ubwc-v2-0-4346a6ef07a9@oss.qualcomm.com
Changes in v2:
- Extended the commit message and added a comment for the min_acc length
helper (Konrad)
- Link to v1: https://lore.kernel.org/r/20260110-iris-ubwc-v1-0-dd70494dcd7b@oss.qualcomm.com
---
Dmitry Baryshkov (9):
soc: qcom: ubwc: add helper to get min_acc length
soc: qcom: ubwc: add helpers to get programmable values
media: iris: retrieve UBWC platform configuration
media: iris: don't specify min_acc_length in the source code
media: iris: don't specify highest_bank_bit in the source code
media: iris: don't specify ubwc_swizzle in the source code
media: iris: don't specify bank_spreading in the source code
media: iris: don't specify max_channels in the source code
media: iris: drop remnants of UBWC configuration
drivers/media/platform/qcom/iris/Kconfig | 1 +
drivers/media/platform/qcom/iris/iris_core.h | 4 ++++
.../platform/qcom/iris/iris_hfi_gen2_packet.c | 18 ++++++++++------
.../platform/qcom/iris/iris_platform_common.h | 11 ----------
.../media/platform/qcom/iris/iris_platform_gen2.c | 14 ------------
drivers/media/platform/qcom/iris/iris_probe.c | 5 +++++
include/linux/soc/qcom/ubwc.h | 25 ++++++++++++++++++++++
7 files changed, 46 insertions(+), 32 deletions(-)
---
base-commit: ca3a02fda4da8e2c1cb6baee5d72352e9e2cfaea
change-id: 20260110-iris-ubwc-06f64cbb31ae
Best regards,
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v4 1/9] soc: qcom: ubwc: add helper to get min_acc length
2026-01-25 11:30 [PATCH v4 0/9] media: iris: migrate to using global UBWC config Dmitry Baryshkov
@ 2026-01-25 11:30 ` Dmitry Baryshkov
2026-01-25 11:30 ` [PATCH v4 2/9] soc: qcom: ubwc: add helpers to get programmable values Dmitry Baryshkov
` (7 subsequent siblings)
8 siblings, 0 replies; 15+ messages in thread
From: Dmitry Baryshkov @ 2026-01-25 11:30 UTC (permalink / raw)
To: Bjorn Andersson, Konrad Dybcio, Rob Clark, Dmitry Baryshkov,
Abhinav Kumar, Jessica Zhang, Sean Paul, Marijn Suijten,
David Airlie, Simona Vetter, Akhil P Oommen, Vikash Garodia,
Dikshita Agarwal, Bryan O'Donoghue, Mauro Carvalho Chehab
Cc: Konrad Dybcio, linux-arm-msm, linux-kernel, dri-devel, freedreno,
linux-media, Bryan O'Donoghue, Wangao Wang
MDSS and GPU drivers use different approaches to get min_acc length.
Add helper function that can be used by all the drivers.
The helper reflects our current best guess, it blindly copies the
approach adopted by the MDSS drivers and it matches current values
selected by the GPU driver.
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Acked-by: Bjorn Andersson <andersson@kernel.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Reviewed-by: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
Tested-by: Wangao Wang <wangao.wang@oss.qualcomm.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
include/linux/soc/qcom/ubwc.h | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/include/linux/soc/qcom/ubwc.h b/include/linux/soc/qcom/ubwc.h
index f052e241736c..5bdeca18d54d 100644
--- a/include/linux/soc/qcom/ubwc.h
+++ b/include/linux/soc/qcom/ubwc.h
@@ -74,4 +74,14 @@ static inline bool qcom_ubwc_get_ubwc_mode(const struct qcom_ubwc_cfg_data *cfg)
return ret;
}
+/*
+ * This is the best guess, based on the MDSS driver, which worked so far.
+ */
+static inline bool qcom_ubwc_min_acc_length_64b(const struct qcom_ubwc_cfg_data *cfg)
+{
+ return cfg->ubwc_enc_version == UBWC_1_0 &&
+ (cfg->ubwc_dec_version == UBWC_2_0 ||
+ cfg->ubwc_dec_version == UBWC_3_0);
+}
+
#endif /* __QCOM_UBWC_H__ */
--
2.47.3
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH v4 2/9] soc: qcom: ubwc: add helpers to get programmable values
2026-01-25 11:30 [PATCH v4 0/9] media: iris: migrate to using global UBWC config Dmitry Baryshkov
2026-01-25 11:30 ` [PATCH v4 1/9] soc: qcom: ubwc: add helper to get min_acc length Dmitry Baryshkov
@ 2026-01-25 11:30 ` Dmitry Baryshkov
2026-01-25 17:16 ` Connor Abbott
2026-02-17 10:55 ` Konrad Dybcio
2026-01-25 11:30 ` [PATCH v4 3/9] media: iris: retrieve UBWC platform configuration Dmitry Baryshkov
` (6 subsequent siblings)
8 siblings, 2 replies; 15+ messages in thread
From: Dmitry Baryshkov @ 2026-01-25 11:30 UTC (permalink / raw)
To: Bjorn Andersson, Konrad Dybcio, Rob Clark, Dmitry Baryshkov,
Abhinav Kumar, Jessica Zhang, Sean Paul, Marijn Suijten,
David Airlie, Simona Vetter, Akhil P Oommen, Vikash Garodia,
Dikshita Agarwal, Bryan O'Donoghue, Mauro Carvalho Chehab
Cc: Konrad Dybcio, linux-arm-msm, linux-kernel, dri-devel, freedreno,
linux-media, Wangao Wang
Currently the database stores macrotile_mode in the data. However it
can be derived from the rest of the data: it should be used for UBWC
encoding >= 3.0 except for several corner cases (SM8150 and SC8180X).
The ubwc_bank_spread field seems to be based on the impreside data we
had for the MDSS and DPU programming. In some cases UBWC engine inside
the display controller doesn't need to program it, although bank spread
is to be enabled.
Bank swizzle is also currently stored as is, but it is almost standard
(banks 1-3 for UBWC 1.0 and 2-3 for other versions), the only exception
being Lemans (it uses only bank 3).
Add helpers returning values from the config for now. They will be
rewritten later, in a separate series, but having the helper now
simplifies refacroring the code later.
Tested-by: Wangao Wang <wangao.wang@oss.qualcomm.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
include/linux/soc/qcom/ubwc.h | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/include/linux/soc/qcom/ubwc.h b/include/linux/soc/qcom/ubwc.h
index 5bdeca18d54d..f5d0e2341261 100644
--- a/include/linux/soc/qcom/ubwc.h
+++ b/include/linux/soc/qcom/ubwc.h
@@ -84,4 +84,19 @@ static inline bool qcom_ubwc_min_acc_length_64b(const struct qcom_ubwc_cfg_data
cfg->ubwc_dec_version == UBWC_3_0);
}
+static inline bool qcom_ubwc_macrotile_mode(const struct qcom_ubwc_cfg_data *cfg)
+{
+ return cfg->macrotile_mode;
+}
+
+static inline bool qcom_ubwc_bank_spread(const struct qcom_ubwc_cfg_data *cfg)
+{
+ return cfg->ubwc_bank_spread;
+}
+
+static inline u32 qcom_ubwc_swizzle(const struct qcom_ubwc_cfg_data *cfg)
+{
+ return cfg->ubwc_swizzle;
+}
+
#endif /* __QCOM_UBWC_H__ */
--
2.47.3
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH v4 3/9] media: iris: retrieve UBWC platform configuration
2026-01-25 11:30 [PATCH v4 0/9] media: iris: migrate to using global UBWC config Dmitry Baryshkov
2026-01-25 11:30 ` [PATCH v4 1/9] soc: qcom: ubwc: add helper to get min_acc length Dmitry Baryshkov
2026-01-25 11:30 ` [PATCH v4 2/9] soc: qcom: ubwc: add helpers to get programmable values Dmitry Baryshkov
@ 2026-01-25 11:30 ` Dmitry Baryshkov
2026-03-26 5:06 ` Dikshita Agarwal
2026-01-25 11:30 ` [PATCH v4 4/9] media: iris: don't specify min_acc_length in the source code Dmitry Baryshkov
` (5 subsequent siblings)
8 siblings, 1 reply; 15+ messages in thread
From: Dmitry Baryshkov @ 2026-01-25 11:30 UTC (permalink / raw)
To: Bjorn Andersson, Konrad Dybcio, Rob Clark, Dmitry Baryshkov,
Abhinav Kumar, Jessica Zhang, Sean Paul, Marijn Suijten,
David Airlie, Simona Vetter, Akhil P Oommen, Vikash Garodia,
Dikshita Agarwal, Bryan O'Donoghue, Mauro Carvalho Chehab
Cc: Konrad Dybcio, linux-arm-msm, linux-kernel, dri-devel, freedreno,
linux-media, Bryan O'Donoghue, Wangao Wang
Specifying UBWC data in each driver doesn't scale and is prone to
errors. Request UBWC data from the central database in preparation to
using it through the rest of the driver.
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Reviewed-by: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
Tested-by: Wangao Wang <wangao.wang@oss.qualcomm.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
drivers/media/platform/qcom/iris/Kconfig | 1 +
drivers/media/platform/qcom/iris/iris_core.h | 4 ++++
drivers/media/platform/qcom/iris/iris_probe.c | 5 +++++
3 files changed, 10 insertions(+)
diff --git a/drivers/media/platform/qcom/iris/Kconfig b/drivers/media/platform/qcom/iris/Kconfig
index 3c803a05305a..39b06de6c3e6 100644
--- a/drivers/media/platform/qcom/iris/Kconfig
+++ b/drivers/media/platform/qcom/iris/Kconfig
@@ -5,6 +5,7 @@ config VIDEO_QCOM_IRIS
select V4L2_MEM2MEM_DEV
select QCOM_MDT_LOADER if ARCH_QCOM
select QCOM_SCM
+ select QCOM_UBWC_CONFIG
select VIDEOBUF2_DMA_CONTIG
help
This is a V4L2 driver for Qualcomm iris video accelerator
diff --git a/drivers/media/platform/qcom/iris/iris_core.h b/drivers/media/platform/qcom/iris/iris_core.h
index fb194c967ad4..d10a03aa5685 100644
--- a/drivers/media/platform/qcom/iris/iris_core.h
+++ b/drivers/media/platform/qcom/iris/iris_core.h
@@ -30,6 +30,8 @@ enum domain_type {
DECODER = BIT(1),
};
+struct qcom_ubwc_cfg_data;
+
/**
* struct iris_core - holds core parameters valid for all instances
*
@@ -52,6 +54,7 @@ enum domain_type {
* @resets: table of iris reset clocks
* @controller_resets: table of controller reset clocks
* @iris_platform_data: a structure for platform data
+ * @ubwc_cfg: UBWC configuration for the platform
* @state: current state of core
* @iface_q_table_daddr: device address for interface queue table memory
* @sfr_daddr: device address for SFR (Sub System Failure Reason) register memory
@@ -95,6 +98,7 @@ struct iris_core {
struct reset_control_bulk_data *resets;
struct reset_control_bulk_data *controller_resets;
const struct iris_platform_data *iris_platform_data;
+ const struct qcom_ubwc_cfg_data *ubwc_cfg;
enum iris_core_state state;
dma_addr_t iface_q_table_daddr;
dma_addr_t sfr_daddr;
diff --git a/drivers/media/platform/qcom/iris/iris_probe.c b/drivers/media/platform/qcom/iris/iris_probe.c
index ddaacda523ec..492f85f518eb 100644
--- a/drivers/media/platform/qcom/iris/iris_probe.c
+++ b/drivers/media/platform/qcom/iris/iris_probe.c
@@ -10,6 +10,7 @@
#include <linux/pm_opp.h>
#include <linux/pm_runtime.h>
#include <linux/reset.h>
+#include <linux/soc/qcom/ubwc.h>
#include "iris_core.h"
#include "iris_ctrls.h"
@@ -244,6 +245,10 @@ static int iris_probe(struct platform_device *pdev)
core->iris_platform_data = of_device_get_match_data(core->dev);
+ core->ubwc_cfg = qcom_ubwc_config_get_data();
+ if (IS_ERR(core->ubwc_cfg))
+ return PTR_ERR(core->ubwc_cfg);
+
ret = devm_request_threaded_irq(core->dev, core->irq, iris_hfi_isr,
iris_hfi_isr_handler, IRQF_TRIGGER_HIGH, "iris", core);
if (ret)
--
2.47.3
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH v4 4/9] media: iris: don't specify min_acc_length in the source code
2026-01-25 11:30 [PATCH v4 0/9] media: iris: migrate to using global UBWC config Dmitry Baryshkov
` (2 preceding siblings ...)
2026-01-25 11:30 ` [PATCH v4 3/9] media: iris: retrieve UBWC platform configuration Dmitry Baryshkov
@ 2026-01-25 11:30 ` Dmitry Baryshkov
2026-01-25 11:30 ` [PATCH v4 5/9] media: iris: don't specify highest_bank_bit " Dmitry Baryshkov
` (4 subsequent siblings)
8 siblings, 0 replies; 15+ messages in thread
From: Dmitry Baryshkov @ 2026-01-25 11:30 UTC (permalink / raw)
To: Bjorn Andersson, Konrad Dybcio, Rob Clark, Dmitry Baryshkov,
Abhinav Kumar, Jessica Zhang, Sean Paul, Marijn Suijten,
David Airlie, Simona Vetter, Akhil P Oommen, Vikash Garodia,
Dikshita Agarwal, Bryan O'Donoghue, Mauro Carvalho Chehab
Cc: Konrad Dybcio, linux-arm-msm, linux-kernel, dri-devel, freedreno,
linux-media, Bryan O'Donoghue, Wangao Wang
The min_acc length can be calculated from the platform UBWC
configuration. Use the freshly introduced helper and calculate min_acc
length based on the platform UBWC configuration instead of specifying it
directly in the source.
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Reviewed-by: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
Tested-by: Wangao Wang <wangao.wang@oss.qualcomm.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
drivers/media/platform/qcom/iris/iris_hfi_gen2_packet.c | 6 +++++-
drivers/media/platform/qcom/iris/iris_platform_common.h | 1 -
drivers/media/platform/qcom/iris/iris_platform_gen2.c | 1 -
3 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen2_packet.c b/drivers/media/platform/qcom/iris/iris_hfi_gen2_packet.c
index d77fa29f44fc..aa4520b27739 100644
--- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_packet.c
+++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_packet.c
@@ -3,6 +3,9 @@
* Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved.
*/
+#include <linux/printk.h>
+#include <linux/soc/qcom/ubwc.h>
+
#include "iris_hfi_common.h"
#include "iris_hfi_gen2.h"
#include "iris_hfi_gen2_packet.h"
@@ -120,6 +123,7 @@ static void iris_hfi_gen2_create_packet(struct iris_hfi_header *hdr, u32 pkt_typ
void iris_hfi_gen2_packet_sys_init(struct iris_core *core, struct iris_hfi_header *hdr)
{
+ const struct qcom_ubwc_cfg_data *ubwc = core->ubwc_cfg;
u32 payload = 0;
iris_hfi_gen2_create_header(hdr, 0, core->header_id++);
@@ -146,7 +150,7 @@ void iris_hfi_gen2_packet_sys_init(struct iris_core *core, struct iris_hfi_heade
&payload,
sizeof(u32));
- payload = core->iris_platform_data->ubwc_config->mal_length;
+ payload = qcom_ubwc_min_acc_length_64b(ubwc) ? 64 : 32;
iris_hfi_gen2_create_packet(hdr,
HFI_PROP_UBWC_MAL_LENGTH,
HFI_HOST_FLAGS_NONE,
diff --git a/drivers/media/platform/qcom/iris/iris_platform_common.h b/drivers/media/platform/qcom/iris/iris_platform_common.h
index 5a489917580e..08a9529e599b 100644
--- a/drivers/media/platform/qcom/iris/iris_platform_common.h
+++ b/drivers/media/platform/qcom/iris/iris_platform_common.h
@@ -77,7 +77,6 @@ struct tz_cp_config {
struct ubwc_config_data {
u32 max_channels;
- u32 mal_length;
u32 highest_bank_bit;
u32 bank_swzl_level;
u32 bank_swz2_level;
diff --git a/drivers/media/platform/qcom/iris/iris_platform_gen2.c b/drivers/media/platform/qcom/iris/iris_platform_gen2.c
index 5da90d47f9c6..01c6ffa7e084 100644
--- a/drivers/media/platform/qcom/iris/iris_platform_gen2.c
+++ b/drivers/media/platform/qcom/iris/iris_platform_gen2.c
@@ -792,7 +792,6 @@ static const char * const sm8550_opp_clk_table[] = {
static struct ubwc_config_data ubwc_config_sm8550 = {
.max_channels = 8,
- .mal_length = 32,
.highest_bank_bit = 16,
.bank_swzl_level = 0,
.bank_swz2_level = 1,
--
2.47.3
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH v4 5/9] media: iris: don't specify highest_bank_bit in the source code
2026-01-25 11:30 [PATCH v4 0/9] media: iris: migrate to using global UBWC config Dmitry Baryshkov
` (3 preceding siblings ...)
2026-01-25 11:30 ` [PATCH v4 4/9] media: iris: don't specify min_acc_length in the source code Dmitry Baryshkov
@ 2026-01-25 11:30 ` Dmitry Baryshkov
2026-01-25 11:30 ` [PATCH v4 6/9] media: iris: don't specify ubwc_swizzle " Dmitry Baryshkov
` (3 subsequent siblings)
8 siblings, 0 replies; 15+ messages in thread
From: Dmitry Baryshkov @ 2026-01-25 11:30 UTC (permalink / raw)
To: Bjorn Andersson, Konrad Dybcio, Rob Clark, Dmitry Baryshkov,
Abhinav Kumar, Jessica Zhang, Sean Paul, Marijn Suijten,
David Airlie, Simona Vetter, Akhil P Oommen, Vikash Garodia,
Dikshita Agarwal, Bryan O'Donoghue, Mauro Carvalho Chehab
Cc: Konrad Dybcio, linux-arm-msm, linux-kernel, dri-devel, freedreno,
linux-media, Bryan O'Donoghue, Wangao Wang
The highest_bank_bit param is specified both in the Iris driver and in
the platform UBWC config. Use the platform UBWC configuration instead of
specifying it directly in the source.
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Reviewed-by: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
Tested-by: Wangao Wang <wangao.wang@oss.qualcomm.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
drivers/media/platform/qcom/iris/iris_hfi_gen2_packet.c | 2 +-
drivers/media/platform/qcom/iris/iris_platform_common.h | 1 -
drivers/media/platform/qcom/iris/iris_platform_gen2.c | 1 -
3 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen2_packet.c b/drivers/media/platform/qcom/iris/iris_hfi_gen2_packet.c
index aa4520b27739..6dc0cbaa9c19 100644
--- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_packet.c
+++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_packet.c
@@ -160,7 +160,7 @@ void iris_hfi_gen2_packet_sys_init(struct iris_core *core, struct iris_hfi_heade
&payload,
sizeof(u32));
- payload = core->iris_platform_data->ubwc_config->highest_bank_bit;
+ payload = ubwc->highest_bank_bit;
iris_hfi_gen2_create_packet(hdr,
HFI_PROP_UBWC_HBB,
HFI_HOST_FLAGS_NONE,
diff --git a/drivers/media/platform/qcom/iris/iris_platform_common.h b/drivers/media/platform/qcom/iris/iris_platform_common.h
index 08a9529e599b..5639eb5a75b6 100644
--- a/drivers/media/platform/qcom/iris/iris_platform_common.h
+++ b/drivers/media/platform/qcom/iris/iris_platform_common.h
@@ -77,7 +77,6 @@ struct tz_cp_config {
struct ubwc_config_data {
u32 max_channels;
- u32 highest_bank_bit;
u32 bank_swzl_level;
u32 bank_swz2_level;
u32 bank_swz3_level;
diff --git a/drivers/media/platform/qcom/iris/iris_platform_gen2.c b/drivers/media/platform/qcom/iris/iris_platform_gen2.c
index 01c6ffa7e084..bdeb92e0b7bc 100644
--- a/drivers/media/platform/qcom/iris/iris_platform_gen2.c
+++ b/drivers/media/platform/qcom/iris/iris_platform_gen2.c
@@ -792,7 +792,6 @@ static const char * const sm8550_opp_clk_table[] = {
static struct ubwc_config_data ubwc_config_sm8550 = {
.max_channels = 8,
- .highest_bank_bit = 16,
.bank_swzl_level = 0,
.bank_swz2_level = 1,
.bank_swz3_level = 1,
--
2.47.3
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH v4 6/9] media: iris: don't specify ubwc_swizzle in the source code
2026-01-25 11:30 [PATCH v4 0/9] media: iris: migrate to using global UBWC config Dmitry Baryshkov
` (4 preceding siblings ...)
2026-01-25 11:30 ` [PATCH v4 5/9] media: iris: don't specify highest_bank_bit " Dmitry Baryshkov
@ 2026-01-25 11:30 ` Dmitry Baryshkov
2026-01-25 11:30 ` [PATCH v4 7/9] media: iris: don't specify bank_spreading " Dmitry Baryshkov
` (2 subsequent siblings)
8 siblings, 0 replies; 15+ messages in thread
From: Dmitry Baryshkov @ 2026-01-25 11:30 UTC (permalink / raw)
To: Bjorn Andersson, Konrad Dybcio, Rob Clark, Dmitry Baryshkov,
Abhinav Kumar, Jessica Zhang, Sean Paul, Marijn Suijten,
David Airlie, Simona Vetter, Akhil P Oommen, Vikash Garodia,
Dikshita Agarwal, Bryan O'Donoghue, Mauro Carvalho Chehab
Cc: Konrad Dybcio, linux-arm-msm, linux-kernel, dri-devel, freedreno,
linux-media, Bryan O'Donoghue, Wangao Wang
The UBWC swizzle is specified both in the Iris driver and in the
platform UBWC config. Use the platform UBWC configuration instead of
specifying it directly in the source.
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Reviewed-by: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
Tested-by: Wangao Wang <wangao.wang@oss.qualcomm.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
drivers/media/platform/qcom/iris/iris_hfi_gen2_packet.c | 6 +++---
drivers/media/platform/qcom/iris/iris_platform_common.h | 3 ---
drivers/media/platform/qcom/iris/iris_platform_gen2.c | 3 ---
3 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen2_packet.c b/drivers/media/platform/qcom/iris/iris_hfi_gen2_packet.c
index 6dc0cbaa9c19..a4d9efdbb43b 100644
--- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_packet.c
+++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_packet.c
@@ -170,7 +170,7 @@ void iris_hfi_gen2_packet_sys_init(struct iris_core *core, struct iris_hfi_heade
&payload,
sizeof(u32));
- payload = core->iris_platform_data->ubwc_config->bank_swzl_level;
+ payload = !!(qcom_ubwc_swizzle(ubwc) & UBWC_SWIZZLE_ENABLE_LVL1);
iris_hfi_gen2_create_packet(hdr,
HFI_PROP_UBWC_BANK_SWZL_LEVEL1,
HFI_HOST_FLAGS_NONE,
@@ -180,7 +180,7 @@ void iris_hfi_gen2_packet_sys_init(struct iris_core *core, struct iris_hfi_heade
&payload,
sizeof(u32));
- payload = core->iris_platform_data->ubwc_config->bank_swz2_level;
+ payload = !!(qcom_ubwc_swizzle(ubwc) & UBWC_SWIZZLE_ENABLE_LVL2);
iris_hfi_gen2_create_packet(hdr,
HFI_PROP_UBWC_BANK_SWZL_LEVEL2,
HFI_HOST_FLAGS_NONE,
@@ -190,7 +190,7 @@ void iris_hfi_gen2_packet_sys_init(struct iris_core *core, struct iris_hfi_heade
&payload,
sizeof(u32));
- payload = core->iris_platform_data->ubwc_config->bank_swz3_level;
+ payload = !!(qcom_ubwc_swizzle(ubwc) & UBWC_SWIZZLE_ENABLE_LVL3);
iris_hfi_gen2_create_packet(hdr,
HFI_PROP_UBWC_BANK_SWZL_LEVEL3,
HFI_HOST_FLAGS_NONE,
diff --git a/drivers/media/platform/qcom/iris/iris_platform_common.h b/drivers/media/platform/qcom/iris/iris_platform_common.h
index 5639eb5a75b6..e217f15ef028 100644
--- a/drivers/media/platform/qcom/iris/iris_platform_common.h
+++ b/drivers/media/platform/qcom/iris/iris_platform_common.h
@@ -77,9 +77,6 @@ struct tz_cp_config {
struct ubwc_config_data {
u32 max_channels;
- u32 bank_swzl_level;
- u32 bank_swz2_level;
- u32 bank_swz3_level;
u32 bank_spreading;
};
diff --git a/drivers/media/platform/qcom/iris/iris_platform_gen2.c b/drivers/media/platform/qcom/iris/iris_platform_gen2.c
index bdeb92e0b7bc..8072f430bd26 100644
--- a/drivers/media/platform/qcom/iris/iris_platform_gen2.c
+++ b/drivers/media/platform/qcom/iris/iris_platform_gen2.c
@@ -792,9 +792,6 @@ static const char * const sm8550_opp_clk_table[] = {
static struct ubwc_config_data ubwc_config_sm8550 = {
.max_channels = 8,
- .bank_swzl_level = 0,
- .bank_swz2_level = 1,
- .bank_swz3_level = 1,
.bank_spreading = 1,
};
--
2.47.3
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH v4 7/9] media: iris: don't specify bank_spreading in the source code
2026-01-25 11:30 [PATCH v4 0/9] media: iris: migrate to using global UBWC config Dmitry Baryshkov
` (5 preceding siblings ...)
2026-01-25 11:30 ` [PATCH v4 6/9] media: iris: don't specify ubwc_swizzle " Dmitry Baryshkov
@ 2026-01-25 11:30 ` Dmitry Baryshkov
2026-01-25 11:30 ` [PATCH v4 8/9] media: iris: don't specify max_channels " Dmitry Baryshkov
2026-01-25 11:30 ` [PATCH v4 9/9] media: iris: drop remnants of UBWC configuration Dmitry Baryshkov
8 siblings, 0 replies; 15+ messages in thread
From: Dmitry Baryshkov @ 2026-01-25 11:30 UTC (permalink / raw)
To: Bjorn Andersson, Konrad Dybcio, Rob Clark, Dmitry Baryshkov,
Abhinav Kumar, Jessica Zhang, Sean Paul, Marijn Suijten,
David Airlie, Simona Vetter, Akhil P Oommen, Vikash Garodia,
Dikshita Agarwal, Bryan O'Donoghue, Mauro Carvalho Chehab
Cc: Konrad Dybcio, linux-arm-msm, linux-kernel, dri-devel, freedreno,
linux-media, Bryan O'Donoghue, Wangao Wang
The UBWC bank spreading is specified both in the Iris driver and in the
platform UBWC config. Use the platform UBWC configuration instead of
specifying it directly in the source.
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Reviewed-by: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
Tested-by: Wangao Wang <wangao.wang@oss.qualcomm.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
drivers/media/platform/qcom/iris/iris_hfi_gen2_packet.c | 2 +-
drivers/media/platform/qcom/iris/iris_platform_common.h | 1 -
drivers/media/platform/qcom/iris/iris_platform_gen2.c | 1 -
3 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen2_packet.c b/drivers/media/platform/qcom/iris/iris_hfi_gen2_packet.c
index a4d9efdbb43b..a49394b92768 100644
--- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_packet.c
+++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_packet.c
@@ -200,7 +200,7 @@ void iris_hfi_gen2_packet_sys_init(struct iris_core *core, struct iris_hfi_heade
&payload,
sizeof(u32));
- payload = core->iris_platform_data->ubwc_config->bank_spreading;
+ payload = qcom_ubwc_bank_spread(ubwc);
iris_hfi_gen2_create_packet(hdr,
HFI_PROP_UBWC_BANK_SPREADING,
HFI_HOST_FLAGS_NONE,
diff --git a/drivers/media/platform/qcom/iris/iris_platform_common.h b/drivers/media/platform/qcom/iris/iris_platform_common.h
index e217f15ef028..07c58cf3a14a 100644
--- a/drivers/media/platform/qcom/iris/iris_platform_common.h
+++ b/drivers/media/platform/qcom/iris/iris_platform_common.h
@@ -77,7 +77,6 @@ struct tz_cp_config {
struct ubwc_config_data {
u32 max_channels;
- u32 bank_spreading;
};
struct platform_inst_caps {
diff --git a/drivers/media/platform/qcom/iris/iris_platform_gen2.c b/drivers/media/platform/qcom/iris/iris_platform_gen2.c
index 8072f430bd26..4e617176dee4 100644
--- a/drivers/media/platform/qcom/iris/iris_platform_gen2.c
+++ b/drivers/media/platform/qcom/iris/iris_platform_gen2.c
@@ -792,7 +792,6 @@ static const char * const sm8550_opp_clk_table[] = {
static struct ubwc_config_data ubwc_config_sm8550 = {
.max_channels = 8,
- .bank_spreading = 1,
};
static const struct tz_cp_config tz_cp_config_sm8550[] = {
--
2.47.3
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH v4 8/9] media: iris: don't specify max_channels in the source code
2026-01-25 11:30 [PATCH v4 0/9] media: iris: migrate to using global UBWC config Dmitry Baryshkov
` (6 preceding siblings ...)
2026-01-25 11:30 ` [PATCH v4 7/9] media: iris: don't specify bank_spreading " Dmitry Baryshkov
@ 2026-01-25 11:30 ` Dmitry Baryshkov
2026-01-25 11:30 ` [PATCH v4 9/9] media: iris: drop remnants of UBWC configuration Dmitry Baryshkov
8 siblings, 0 replies; 15+ messages in thread
From: Dmitry Baryshkov @ 2026-01-25 11:30 UTC (permalink / raw)
To: Bjorn Andersson, Konrad Dybcio, Rob Clark, Dmitry Baryshkov,
Abhinav Kumar, Jessica Zhang, Sean Paul, Marijn Suijten,
David Airlie, Simona Vetter, Akhil P Oommen, Vikash Garodia,
Dikshita Agarwal, Bryan O'Donoghue, Mauro Carvalho Chehab
Cc: Konrad Dybcio, linux-arm-msm, linux-kernel, dri-devel, freedreno,
linux-media, Bryan O'Donoghue, Wangao Wang
The UBWC max_channels spreading is specified in the Iris driver, but it
also can be calculated from the platform UBWC config. Use the platform
UBWC configuration instead of specifying it directly in the source.
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Reviewed-by: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
Tested-by: Wangao Wang <wangao.wang@oss.qualcomm.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
drivers/media/platform/qcom/iris/iris_hfi_gen2_packet.c | 2 +-
drivers/media/platform/qcom/iris/iris_platform_common.h | 1 -
drivers/media/platform/qcom/iris/iris_platform_gen2.c | 1 -
3 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen2_packet.c b/drivers/media/platform/qcom/iris/iris_hfi_gen2_packet.c
index a49394b92768..0d05dd2afc07 100644
--- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_packet.c
+++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_packet.c
@@ -140,7 +140,7 @@ void iris_hfi_gen2_packet_sys_init(struct iris_core *core, struct iris_hfi_heade
&payload,
sizeof(u32));
- payload = core->iris_platform_data->ubwc_config->max_channels;
+ payload = qcom_ubwc_macrotile_mode(ubwc) ? 8 : 4;
iris_hfi_gen2_create_packet(hdr,
HFI_PROP_UBWC_MAX_CHANNELS,
HFI_HOST_FLAGS_NONE,
diff --git a/drivers/media/platform/qcom/iris/iris_platform_common.h b/drivers/media/platform/qcom/iris/iris_platform_common.h
index 07c58cf3a14a..e8b5446dce76 100644
--- a/drivers/media/platform/qcom/iris/iris_platform_common.h
+++ b/drivers/media/platform/qcom/iris/iris_platform_common.h
@@ -76,7 +76,6 @@ struct tz_cp_config {
};
struct ubwc_config_data {
- u32 max_channels;
};
struct platform_inst_caps {
diff --git a/drivers/media/platform/qcom/iris/iris_platform_gen2.c b/drivers/media/platform/qcom/iris/iris_platform_gen2.c
index 4e617176dee4..05b1dd11abce 100644
--- a/drivers/media/platform/qcom/iris/iris_platform_gen2.c
+++ b/drivers/media/platform/qcom/iris/iris_platform_gen2.c
@@ -791,7 +791,6 @@ static const char * const sm8550_opp_clk_table[] = {
};
static struct ubwc_config_data ubwc_config_sm8550 = {
- .max_channels = 8,
};
static const struct tz_cp_config tz_cp_config_sm8550[] = {
--
2.47.3
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH v4 9/9] media: iris: drop remnants of UBWC configuration
2026-01-25 11:30 [PATCH v4 0/9] media: iris: migrate to using global UBWC config Dmitry Baryshkov
` (7 preceding siblings ...)
2026-01-25 11:30 ` [PATCH v4 8/9] media: iris: don't specify max_channels " Dmitry Baryshkov
@ 2026-01-25 11:30 ` Dmitry Baryshkov
8 siblings, 0 replies; 15+ messages in thread
From: Dmitry Baryshkov @ 2026-01-25 11:30 UTC (permalink / raw)
To: Bjorn Andersson, Konrad Dybcio, Rob Clark, Dmitry Baryshkov,
Abhinav Kumar, Jessica Zhang, Sean Paul, Marijn Suijten,
David Airlie, Simona Vetter, Akhil P Oommen, Vikash Garodia,
Dikshita Agarwal, Bryan O'Donoghue, Mauro Carvalho Chehab
Cc: Konrad Dybcio, linux-arm-msm, linux-kernel, dri-devel, freedreno,
linux-media, Bryan O'Donoghue, Wangao Wang
Now as all UBWC configuration bits were migrated to be used or derived
from the global UBWC platform-specific data, drop the unused struct and
field definitions.
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Reviewed-by: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
Tested-by: Wangao Wang <wangao.wang@oss.qualcomm.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
drivers/media/platform/qcom/iris/iris_platform_common.h | 4 ----
drivers/media/platform/qcom/iris/iris_platform_gen2.c | 7 -------
2 files changed, 11 deletions(-)
diff --git a/drivers/media/platform/qcom/iris/iris_platform_common.h b/drivers/media/platform/qcom/iris/iris_platform_common.h
index e8b5446dce76..f42e1798747c 100644
--- a/drivers/media/platform/qcom/iris/iris_platform_common.h
+++ b/drivers/media/platform/qcom/iris/iris_platform_common.h
@@ -75,9 +75,6 @@ struct tz_cp_config {
u32 cp_nonpixel_size;
};
-struct ubwc_config_data {
-};
-
struct platform_inst_caps {
u32 min_frame_width;
u32 max_frame_width;
@@ -241,7 +238,6 @@ struct iris_platform_data {
u32 tz_cp_config_data_size;
u32 core_arch;
u32 hw_response_timeout;
- struct ubwc_config_data *ubwc_config;
u32 num_vpp_pipe;
bool no_aon;
u32 max_session_count;
diff --git a/drivers/media/platform/qcom/iris/iris_platform_gen2.c b/drivers/media/platform/qcom/iris/iris_platform_gen2.c
index 05b1dd11abce..a526b50a1cd3 100644
--- a/drivers/media/platform/qcom/iris/iris_platform_gen2.c
+++ b/drivers/media/platform/qcom/iris/iris_platform_gen2.c
@@ -790,9 +790,6 @@ static const char * const sm8550_opp_clk_table[] = {
NULL,
};
-static struct ubwc_config_data ubwc_config_sm8550 = {
-};
-
static const struct tz_cp_config tz_cp_config_sm8550[] = {
{
.cp_start = 0,
@@ -949,7 +946,6 @@ const struct iris_platform_data sm8550_data = {
.tz_cp_config_data_size = ARRAY_SIZE(tz_cp_config_sm8550),
.core_arch = VIDEO_ARCH_LX,
.hw_response_timeout = HW_RESPONSE_TIMEOUT_VALUE,
- .ubwc_config = &ubwc_config_sm8550,
.num_vpp_pipe = 4,
.max_session_count = 16,
.max_core_mbpf = NUM_MBS_8K * 2,
@@ -1054,7 +1050,6 @@ const struct iris_platform_data sm8650_data = {
.tz_cp_config_data_size = ARRAY_SIZE(tz_cp_config_sm8550),
.core_arch = VIDEO_ARCH_LX,
.hw_response_timeout = HW_RESPONSE_TIMEOUT_VALUE,
- .ubwc_config = &ubwc_config_sm8550,
.num_vpp_pipe = 4,
.max_session_count = 16,
.max_core_mbpf = NUM_MBS_8K * 2,
@@ -1150,7 +1145,6 @@ const struct iris_platform_data sm8750_data = {
.tz_cp_config_data_size = ARRAY_SIZE(tz_cp_config_sm8550),
.core_arch = VIDEO_ARCH_LX,
.hw_response_timeout = HW_RESPONSE_TIMEOUT_VALUE,
- .ubwc_config = &ubwc_config_sm8550,
.num_vpp_pipe = 4,
.max_session_count = 16,
.max_core_mbpf = NUM_MBS_8K * 2,
@@ -1250,7 +1244,6 @@ const struct iris_platform_data qcs8300_data = {
.tz_cp_config_data_size = ARRAY_SIZE(tz_cp_config_sm8550),
.core_arch = VIDEO_ARCH_LX,
.hw_response_timeout = HW_RESPONSE_TIMEOUT_VALUE,
- .ubwc_config = &ubwc_config_sm8550,
.num_vpp_pipe = 2,
.max_session_count = 16,
.max_core_mbpf = ((4096 * 2176) / 256) * 4,
--
2.47.3
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH v4 2/9] soc: qcom: ubwc: add helpers to get programmable values
2026-01-25 11:30 ` [PATCH v4 2/9] soc: qcom: ubwc: add helpers to get programmable values Dmitry Baryshkov
@ 2026-01-25 17:16 ` Connor Abbott
2026-01-26 10:02 ` Konrad Dybcio
2026-02-17 10:55 ` Konrad Dybcio
1 sibling, 1 reply; 15+ messages in thread
From: Connor Abbott @ 2026-01-25 17:16 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: Bjorn Andersson, Konrad Dybcio, Rob Clark, Dmitry Baryshkov,
Abhinav Kumar, Jessica Zhang, Sean Paul, Marijn Suijten,
David Airlie, Simona Vetter, Akhil P Oommen, Vikash Garodia,
Dikshita Agarwal, Bryan O'Donoghue, Mauro Carvalho Chehab,
Konrad Dybcio, linux-arm-msm, linux-kernel, dri-devel, freedreno,
linux-media, Wangao Wang
On Sun, Jan 25, 2026 at 6:37 AM Dmitry Baryshkov
<dmitry.baryshkov@oss.qualcomm.com> wrote:
>
> Currently the database stores macrotile_mode in the data. However it
> can be derived from the rest of the data: it should be used for UBWC
> encoding >= 3.0 except for several corner cases (SM8150 and SC8180X).
FWIW, there is a UBWC version 3.1 not currently reflected in the code
which adds the 8-channel macrotile mode. If we just added that and
made SM8150 and SC8180X be 3.1 then we could derive it from the
version.
Connor
>
> The ubwc_bank_spread field seems to be based on the impreside data we
> had for the MDSS and DPU programming. In some cases UBWC engine inside
> the display controller doesn't need to program it, although bank spread
> is to be enabled.
>
> Bank swizzle is also currently stored as is, but it is almost standard
> (banks 1-3 for UBWC 1.0 and 2-3 for other versions), the only exception
> being Lemans (it uses only bank 3).
>
> Add helpers returning values from the config for now. They will be
> rewritten later, in a separate series, but having the helper now
> simplifies refacroring the code later.
>
> Tested-by: Wangao Wang <wangao.wang@oss.qualcomm.com>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> ---
> include/linux/soc/qcom/ubwc.h | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/include/linux/soc/qcom/ubwc.h b/include/linux/soc/qcom/ubwc.h
> index 5bdeca18d54d..f5d0e2341261 100644
> --- a/include/linux/soc/qcom/ubwc.h
> +++ b/include/linux/soc/qcom/ubwc.h
> @@ -84,4 +84,19 @@ static inline bool qcom_ubwc_min_acc_length_64b(const struct qcom_ubwc_cfg_data
> cfg->ubwc_dec_version == UBWC_3_0);
> }
>
> +static inline bool qcom_ubwc_macrotile_mode(const struct qcom_ubwc_cfg_data *cfg)
> +{
> + return cfg->macrotile_mode;
> +}
> +
> +static inline bool qcom_ubwc_bank_spread(const struct qcom_ubwc_cfg_data *cfg)
> +{
> + return cfg->ubwc_bank_spread;
> +}
> +
> +static inline u32 qcom_ubwc_swizzle(const struct qcom_ubwc_cfg_data *cfg)
> +{
> + return cfg->ubwc_swizzle;
> +}
> +
> #endif /* __QCOM_UBWC_H__ */
>
> --
> 2.47.3
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v4 2/9] soc: qcom: ubwc: add helpers to get programmable values
2026-01-25 17:16 ` Connor Abbott
@ 2026-01-26 10:02 ` Konrad Dybcio
0 siblings, 0 replies; 15+ messages in thread
From: Konrad Dybcio @ 2026-01-26 10:02 UTC (permalink / raw)
To: Connor Abbott, Dmitry Baryshkov
Cc: Bjorn Andersson, Konrad Dybcio, Rob Clark, Dmitry Baryshkov,
Abhinav Kumar, Jessica Zhang, Sean Paul, Marijn Suijten,
David Airlie, Simona Vetter, Akhil P Oommen, Vikash Garodia,
Dikshita Agarwal, Bryan O'Donoghue, Mauro Carvalho Chehab,
linux-arm-msm, linux-kernel, dri-devel, freedreno, linux-media,
Wangao Wang
On 1/25/26 6:16 PM, Connor Abbott wrote:
> On Sun, Jan 25, 2026 at 6:37 AM Dmitry Baryshkov
> <dmitry.baryshkov@oss.qualcomm.com> wrote:
>>
>> Currently the database stores macrotile_mode in the data. However it
>> can be derived from the rest of the data: it should be used for UBWC
>> encoding >= 3.0 except for several corner cases (SM8150 and SC8180X).
>
> FWIW, there is a UBWC version 3.1 not currently reflected in the code
> which adds the 8-channel macrotile mode. If we just added that and
> made SM8150 and SC8180X be 3.1 then we could derive it from the
> version.
I see 3.0 in docs for both
Konrad
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v4 2/9] soc: qcom: ubwc: add helpers to get programmable values
2026-01-25 11:30 ` [PATCH v4 2/9] soc: qcom: ubwc: add helpers to get programmable values Dmitry Baryshkov
2026-01-25 17:16 ` Connor Abbott
@ 2026-02-17 10:55 ` Konrad Dybcio
2026-02-18 0:44 ` Dmitry Baryshkov
1 sibling, 1 reply; 15+ messages in thread
From: Konrad Dybcio @ 2026-02-17 10:55 UTC (permalink / raw)
To: Dmitry Baryshkov, Bjorn Andersson, Konrad Dybcio, Rob Clark,
Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang, Sean Paul,
Marijn Suijten, David Airlie, Simona Vetter, Akhil P Oommen,
Vikash Garodia, Dikshita Agarwal, Bryan O'Donoghue,
Mauro Carvalho Chehab
Cc: linux-arm-msm, linux-kernel, dri-devel, freedreno, linux-media,
Wangao Wang
On 1/25/26 12:30 PM, Dmitry Baryshkov wrote:
> Currently the database stores macrotile_mode in the data. However it
> can be derived from the rest of the data: it should be used for UBWC
> encoding >= 3.0 except for several corner cases (SM8150 and SC8180X).
>
> The ubwc_bank_spread field seems to be based on the impreside data we
> had for the MDSS and DPU programming. In some cases UBWC engine inside
> the display controller doesn't need to program it, although bank spread
> is to be enabled.
>
> Bank swizzle is also currently stored as is, but it is almost standard
> (banks 1-3 for UBWC 1.0 and 2-3 for other versions), the only exception
> being Lemans (it uses only bank 3).
>
> Add helpers returning values from the config for now. They will be
> rewritten later, in a separate series, but having the helper now
> simplifies refacroring the code later.
>
> Tested-by: Wangao Wang <wangao.wang@oss.qualcomm.com>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> ---
> include/linux/soc/qcom/ubwc.h | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/include/linux/soc/qcom/ubwc.h b/include/linux/soc/qcom/ubwc.h
> index 5bdeca18d54d..f5d0e2341261 100644
> --- a/include/linux/soc/qcom/ubwc.h
> +++ b/include/linux/soc/qcom/ubwc.h
> @@ -84,4 +84,19 @@ static inline bool qcom_ubwc_min_acc_length_64b(const struct qcom_ubwc_cfg_data
> cfg->ubwc_dec_version == UBWC_3_0);
> }
>
> +static inline bool qcom_ubwc_macrotile_mode(const struct qcom_ubwc_cfg_data *cfg)
Should we rename this to something like "qcom_ubwc_macrotile_mode_8ch()"?
Konrad
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v4 2/9] soc: qcom: ubwc: add helpers to get programmable values
2026-02-17 10:55 ` Konrad Dybcio
@ 2026-02-18 0:44 ` Dmitry Baryshkov
0 siblings, 0 replies; 15+ messages in thread
From: Dmitry Baryshkov @ 2026-02-18 0:44 UTC (permalink / raw)
To: Konrad Dybcio
Cc: Bjorn Andersson, Konrad Dybcio, Rob Clark, Dmitry Baryshkov,
Abhinav Kumar, Jessica Zhang, Sean Paul, Marijn Suijten,
David Airlie, Simona Vetter, Akhil P Oommen, Vikash Garodia,
Dikshita Agarwal, Bryan O'Donoghue, Mauro Carvalho Chehab,
linux-arm-msm, linux-kernel, dri-devel, freedreno, linux-media,
Wangao Wang
On Tue, Feb 17, 2026 at 11:55:41AM +0100, Konrad Dybcio wrote:
> On 1/25/26 12:30 PM, Dmitry Baryshkov wrote:
> > Currently the database stores macrotile_mode in the data. However it
> > can be derived from the rest of the data: it should be used for UBWC
> > encoding >= 3.0 except for several corner cases (SM8150 and SC8180X).
> >
> > The ubwc_bank_spread field seems to be based on the impreside data we
> > had for the MDSS and DPU programming. In some cases UBWC engine inside
> > the display controller doesn't need to program it, although bank spread
> > is to be enabled.
> >
> > Bank swizzle is also currently stored as is, but it is almost standard
> > (banks 1-3 for UBWC 1.0 and 2-3 for other versions), the only exception
> > being Lemans (it uses only bank 3).
> >
> > Add helpers returning values from the config for now. They will be
> > rewritten later, in a separate series, but having the helper now
> > simplifies refacroring the code later.
> >
> > Tested-by: Wangao Wang <wangao.wang@oss.qualcomm.com>
> > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> > ---
> > include/linux/soc/qcom/ubwc.h | 15 +++++++++++++++
> > 1 file changed, 15 insertions(+)
> >
> > diff --git a/include/linux/soc/qcom/ubwc.h b/include/linux/soc/qcom/ubwc.h
> > index 5bdeca18d54d..f5d0e2341261 100644
> > --- a/include/linux/soc/qcom/ubwc.h
> > +++ b/include/linux/soc/qcom/ubwc.h
> > @@ -84,4 +84,19 @@ static inline bool qcom_ubwc_min_acc_length_64b(const struct qcom_ubwc_cfg_data
> > cfg->ubwc_dec_version == UBWC_3_0);
> > }
> >
> > +static inline bool qcom_ubwc_macrotile_mode(const struct qcom_ubwc_cfg_data *cfg)
>
> Should we rename this to something like "qcom_ubwc_macrotile_mode_8ch()"?
I'd rather land it as is (and maybe add a comment).
>
> Konrad
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v4 3/9] media: iris: retrieve UBWC platform configuration
2026-01-25 11:30 ` [PATCH v4 3/9] media: iris: retrieve UBWC platform configuration Dmitry Baryshkov
@ 2026-03-26 5:06 ` Dikshita Agarwal
0 siblings, 0 replies; 15+ messages in thread
From: Dikshita Agarwal @ 2026-03-26 5:06 UTC (permalink / raw)
To: Dmitry Baryshkov, Bjorn Andersson, Konrad Dybcio, Rob Clark,
Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang, Sean Paul,
Marijn Suijten, David Airlie, Simona Vetter, Akhil P Oommen,
Vikash Garodia, Bryan O'Donoghue, Mauro Carvalho Chehab
Cc: Konrad Dybcio, linux-arm-msm, linux-kernel, dri-devel, freedreno,
linux-media, Bryan O'Donoghue, Wangao Wang
On 1/25/2026 5:00 PM, Dmitry Baryshkov wrote:
> Specifying UBWC data in each driver doesn't scale and is prone to
> errors. Request UBWC data from the central database in preparation to
> using it through the rest of the driver.
>
> Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
> Reviewed-by: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
> Tested-by: Wangao Wang <wangao.wang@oss.qualcomm.com>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> ---
> drivers/media/platform/qcom/iris/Kconfig | 1 +
> drivers/media/platform/qcom/iris/iris_core.h | 4 ++++
> drivers/media/platform/qcom/iris/iris_probe.c | 5 +++++
> 3 files changed, 10 insertions(+)
>
> diff --git a/drivers/media/platform/qcom/iris/Kconfig b/drivers/media/platform/qcom/iris/Kconfig
> index 3c803a05305a..39b06de6c3e6 100644
> --- a/drivers/media/platform/qcom/iris/Kconfig
> +++ b/drivers/media/platform/qcom/iris/Kconfig
> @@ -5,6 +5,7 @@ config VIDEO_QCOM_IRIS
> select V4L2_MEM2MEM_DEV
> select QCOM_MDT_LOADER if ARCH_QCOM
> select QCOM_SCM
> + select QCOM_UBWC_CONFIG
> select VIDEOBUF2_DMA_CONTIG
> help
> This is a V4L2 driver for Qualcomm iris video accelerator
> diff --git a/drivers/media/platform/qcom/iris/iris_core.h b/drivers/media/platform/qcom/iris/iris_core.h
> index fb194c967ad4..d10a03aa5685 100644
> --- a/drivers/media/platform/qcom/iris/iris_core.h
> +++ b/drivers/media/platform/qcom/iris/iris_core.h
> @@ -30,6 +30,8 @@ enum domain_type {
> DECODER = BIT(1),
> };
>
> +struct qcom_ubwc_cfg_data;
> +
> /**
> * struct iris_core - holds core parameters valid for all instances
> *
> @@ -52,6 +54,7 @@ enum domain_type {
> * @resets: table of iris reset clocks
> * @controller_resets: table of controller reset clocks
> * @iris_platform_data: a structure for platform data
> + * @ubwc_cfg: UBWC configuration for the platform
> * @state: current state of core
> * @iface_q_table_daddr: device address for interface queue table memory
> * @sfr_daddr: device address for SFR (Sub System Failure Reason) register memory
> @@ -95,6 +98,7 @@ struct iris_core {
> struct reset_control_bulk_data *resets;
> struct reset_control_bulk_data *controller_resets;
> const struct iris_platform_data *iris_platform_data;
> + const struct qcom_ubwc_cfg_data *ubwc_cfg;
> enum iris_core_state state;
> dma_addr_t iface_q_table_daddr;
> dma_addr_t sfr_daddr;
> diff --git a/drivers/media/platform/qcom/iris/iris_probe.c b/drivers/media/platform/qcom/iris/iris_probe.c
> index ddaacda523ec..492f85f518eb 100644
> --- a/drivers/media/platform/qcom/iris/iris_probe.c
> +++ b/drivers/media/platform/qcom/iris/iris_probe.c
> @@ -10,6 +10,7 @@
> #include <linux/pm_opp.h>
> #include <linux/pm_runtime.h>
> #include <linux/reset.h>
> +#include <linux/soc/qcom/ubwc.h>
>
> #include "iris_core.h"
> #include "iris_ctrls.h"
> @@ -244,6 +245,10 @@ static int iris_probe(struct platform_device *pdev)
>
> core->iris_platform_data = of_device_get_match_data(core->dev);
>
> + core->ubwc_cfg = qcom_ubwc_config_get_data();
> + if (IS_ERR(core->ubwc_cfg))
> + return PTR_ERR(core->ubwc_cfg);
Afterthought: This change assumes that the presence of a UBWC config
implies Iris UBWC support. However, some platforms (e.g. qcm2290) do have
UBWC data defined at the SoC level but do not support UBWC in the video
firmware, which could potentially surface during SYS_INIT if UBWC is
advertised unconditionally, so this might be worth double‑checking.
Thanks,
Dikshita
> +
> ret = devm_request_threaded_irq(core->dev, core->irq, iris_hfi_isr,
> iris_hfi_isr_handler, IRQF_TRIGGER_HIGH, "iris", core);
> if (ret)
>
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2026-03-26 5:06 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-25 11:30 [PATCH v4 0/9] media: iris: migrate to using global UBWC config Dmitry Baryshkov
2026-01-25 11:30 ` [PATCH v4 1/9] soc: qcom: ubwc: add helper to get min_acc length Dmitry Baryshkov
2026-01-25 11:30 ` [PATCH v4 2/9] soc: qcom: ubwc: add helpers to get programmable values Dmitry Baryshkov
2026-01-25 17:16 ` Connor Abbott
2026-01-26 10:02 ` Konrad Dybcio
2026-02-17 10:55 ` Konrad Dybcio
2026-02-18 0:44 ` Dmitry Baryshkov
2026-01-25 11:30 ` [PATCH v4 3/9] media: iris: retrieve UBWC platform configuration Dmitry Baryshkov
2026-03-26 5:06 ` Dikshita Agarwal
2026-01-25 11:30 ` [PATCH v4 4/9] media: iris: don't specify min_acc_length in the source code Dmitry Baryshkov
2026-01-25 11:30 ` [PATCH v4 5/9] media: iris: don't specify highest_bank_bit " Dmitry Baryshkov
2026-01-25 11:30 ` [PATCH v4 6/9] media: iris: don't specify ubwc_swizzle " Dmitry Baryshkov
2026-01-25 11:30 ` [PATCH v4 7/9] media: iris: don't specify bank_spreading " Dmitry Baryshkov
2026-01-25 11:30 ` [PATCH v4 8/9] media: iris: don't specify max_channels " Dmitry Baryshkov
2026-01-25 11:30 ` [PATCH v4 9/9] media: iris: drop remnants of UBWC configuration Dmitry Baryshkov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox