Commit c815e4e7 authored by Dave Airlie's avatar Dave Airlie

Merge tag 'drm-msm-next-2024-05-07' of https://gitlab.freedesktop.org/drm/msm into drm-next

Updates for v6.10

Core:
- Switched to generating register header files during build process
  instead of shipping pre-generated headers
- Merged DPU and MDP4 format databases.

DP:
- Stop using compat string to distinguish DP and eDP cases
- Added support for X Elite platform (X1E80100)
- Reworked DP aux/audio support
- Added SM6350 DP to the bindings (no driver changes, using SM8350
  as a fallback compat)

GPU:
- a7xx perfcntr reg fixes
- MAINTAINERS updates
- a750 devcoredump support
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
From: Rob Clark <robdclark@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/CAF6AEGtpw6dNR9JBikFTQ=TCpt-9FeFW+SGjXWv+Jv3emm0Pbg@mail.gmail.com
parents f03eee5f b587f413
...@@ -29,6 +29,7 @@ properties: ...@@ -29,6 +29,7 @@ properties:
- qcom,sm8650-dp - qcom,sm8650-dp
- items: - items:
- enum: - enum:
- qcom,sm6350-dp
- qcom,sm8150-dp - qcom,sm8150-dp
- qcom,sm8250-dp - qcom,sm8250-dp
- qcom,sm8450-dp - qcom,sm8450-dp
......
...@@ -53,6 +53,15 @@ patternProperties: ...@@ -53,6 +53,15 @@ patternProperties:
compatible: compatible:
const: qcom,sm6350-dpu const: qcom,sm6350-dpu
"^displayport-controller@[0-9a-f]+$":
type: object
additionalProperties: true
properties:
compatible:
contains:
const: qcom,sm6350-dp
"^dsi@[0-9a-f]+$": "^dsi@[0-9a-f]+$":
type: object type: object
additionalProperties: true additionalProperties: true
......
...@@ -6816,7 +6816,25 @@ T: git https://gitlab.freedesktop.org/drm/misc/kernel.git ...@@ -6816,7 +6816,25 @@ T: git https://gitlab.freedesktop.org/drm/misc/kernel.git
F: Documentation/devicetree/bindings/display/panel/panel-mipi-dbi-spi.yaml F: Documentation/devicetree/bindings/display/panel/panel-mipi-dbi-spi.yaml
F: drivers/gpu/drm/tiny/panel-mipi-dbi.c F: drivers/gpu/drm/tiny/panel-mipi-dbi.c
DRM DRIVER FOR MSM ADRENO GPU DRM DRIVER for Qualcomm Adreno GPUs
M: Rob Clark <robdclark@gmail.com>
R: Sean Paul <sean@poorly.run>
R: Konrad Dybcio <konrad.dybcio@linaro.org>
L: linux-arm-msm@vger.kernel.org
L: dri-devel@lists.freedesktop.org
L: freedreno@lists.freedesktop.org
S: Maintained
B: https://gitlab.freedesktop.org/drm/msm/-/issues
T: git https://gitlab.freedesktop.org/drm/msm.git
F: Documentation/devicetree/bindings/display/msm/gpu.yaml
F: drivers/gpu/drm/msm/adreno/
F: drivers/gpu/drm/msm/msm_gpu.*
F: drivers/gpu/drm/msm/msm_gpu_devfreq.*
F: drivers/gpu/drm/msm/msm_ringbuffer.*
F: drivers/gpu/drm/msm/registers/adreno/
F: include/uapi/drm/msm_drm.h
DRM DRIVER for Qualcomm display hardware
M: Rob Clark <robdclark@gmail.com> M: Rob Clark <robdclark@gmail.com>
M: Abhinav Kumar <quic_abhinavk@quicinc.com> M: Abhinav Kumar <quic_abhinavk@quicinc.com>
M: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> M: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
......
...@@ -54,6 +54,14 @@ config DRM_MSM_GPU_SUDO ...@@ -54,6 +54,14 @@ config DRM_MSM_GPU_SUDO
Only use this if you are a driver developer. This should *not* Only use this if you are a driver developer. This should *not*
be enabled for production kernels. If unsure, say N. be enabled for production kernels. If unsure, say N.
config DRM_MSM_VALIDATE_XML
bool "Validate XML register files against schema"
depends on DRM_MSM && EXPERT
depends on $(success,$(PYTHON3) -c "import lxml")
help
Validate XML files with register definitions against rules-fd schema.
This option is mostly targeting DRM MSM developers. If unsure, say N.
config DRM_MSM_MDSS config DRM_MSM_MDSS
bool bool
depends on DRM_MSM depends on DRM_MSM
......
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
ccflags-y := -I $(srctree)/$(src) ccflags-y := -I $(srctree)/$(src)
ccflags-y += -I $(obj)/generated
ccflags-y += -I $(srctree)/$(src)/disp/dpu1 ccflags-y += -I $(srctree)/$(src)/disp/dpu1
ccflags-$(CONFIG_DRM_MSM_DSI) += -I $(srctree)/$(src)/dsi ccflags-$(CONFIG_DRM_MSM_DSI) += -I $(srctree)/$(src)/dsi
ccflags-$(CONFIG_DRM_MSM_DP) += -I $(srctree)/$(src)/dp ccflags-$(CONFIG_DRM_MSM_DP) += -I $(srctree)/$(src)/dp
msm-y := \ adreno-y := \
adreno/adreno_device.o \ adreno/adreno_device.o \
adreno/adreno_gpu.o \ adreno/adreno_gpu.o \
adreno/a2xx_gpu.o \ adreno/a2xx_gpu.o \
adreno/a2xx_gpummu.o \
adreno/a3xx_gpu.o \ adreno/a3xx_gpu.o \
adreno/a4xx_gpu.o \ adreno/a4xx_gpu.o \
adreno/a5xx_gpu.o \ adreno/a5xx_gpu.o \
...@@ -17,7 +19,11 @@ msm-y := \ ...@@ -17,7 +19,11 @@ msm-y := \
adreno/a6xx_gmu.o \ adreno/a6xx_gmu.o \
adreno/a6xx_hfi.o \ adreno/a6xx_hfi.o \
msm-$(CONFIG_DRM_MSM_HDMI) += \ adreno-$(CONFIG_DEBUG_FS) += adreno/a5xx_debugfs.o \
adreno-$(CONFIG_DRM_MSM_GPU_STATE) += adreno/a6xx_gpu_state.o
msm-display-$(CONFIG_DRM_MSM_HDMI) += \
hdmi/hdmi.o \ hdmi/hdmi.o \
hdmi/hdmi_audio.o \ hdmi/hdmi_audio.o \
hdmi/hdmi_bridge.o \ hdmi/hdmi_bridge.o \
...@@ -30,7 +36,7 @@ msm-$(CONFIG_DRM_MSM_HDMI) += \ ...@@ -30,7 +36,7 @@ msm-$(CONFIG_DRM_MSM_HDMI) += \
hdmi/hdmi_phy_8x74.o \ hdmi/hdmi_phy_8x74.o \
hdmi/hdmi_pll_8960.o \ hdmi/hdmi_pll_8960.o \
msm-$(CONFIG_DRM_MSM_MDP4) += \ msm-display-$(CONFIG_DRM_MSM_MDP4) += \
disp/mdp4/mdp4_crtc.o \ disp/mdp4/mdp4_crtc.o \
disp/mdp4/mdp4_dsi_encoder.o \ disp/mdp4/mdp4_dsi_encoder.o \
disp/mdp4/mdp4_dtv_encoder.o \ disp/mdp4/mdp4_dtv_encoder.o \
...@@ -41,7 +47,7 @@ msm-$(CONFIG_DRM_MSM_MDP4) += \ ...@@ -41,7 +47,7 @@ msm-$(CONFIG_DRM_MSM_MDP4) += \
disp/mdp4/mdp4_kms.o \ disp/mdp4/mdp4_kms.o \
disp/mdp4/mdp4_plane.o \ disp/mdp4/mdp4_plane.o \
msm-$(CONFIG_DRM_MSM_MDP5) += \ msm-display-$(CONFIG_DRM_MSM_MDP5) += \
disp/mdp5/mdp5_cfg.o \ disp/mdp5/mdp5_cfg.o \
disp/mdp5/mdp5_cmd_encoder.o \ disp/mdp5/mdp5_cmd_encoder.o \
disp/mdp5/mdp5_ctl.o \ disp/mdp5/mdp5_ctl.o \
...@@ -54,7 +60,7 @@ msm-$(CONFIG_DRM_MSM_MDP5) += \ ...@@ -54,7 +60,7 @@ msm-$(CONFIG_DRM_MSM_MDP5) += \
disp/mdp5/mdp5_plane.o \ disp/mdp5/mdp5_plane.o \
disp/mdp5/mdp5_smp.o \ disp/mdp5/mdp5_smp.o \
msm-$(CONFIG_DRM_MSM_DPU) += \ msm-display-$(CONFIG_DRM_MSM_DPU) += \
disp/dpu1/dpu_core_perf.o \ disp/dpu1/dpu_core_perf.o \
disp/dpu1/dpu_crtc.o \ disp/dpu1/dpu_crtc.o \
disp/dpu1/dpu_encoder.o \ disp/dpu1/dpu_encoder.o \
...@@ -84,14 +90,16 @@ msm-$(CONFIG_DRM_MSM_DPU) += \ ...@@ -84,14 +90,16 @@ msm-$(CONFIG_DRM_MSM_DPU) += \
disp/dpu1/dpu_vbif.o \ disp/dpu1/dpu_vbif.o \
disp/dpu1/dpu_writeback.o disp/dpu1/dpu_writeback.o
msm-$(CONFIG_DRM_MSM_MDSS) += \ msm-display-$(CONFIG_DRM_MSM_MDSS) += \
msm_mdss.o \ msm_mdss.o \
msm-y += \ msm-display-y += \
disp/mdp_format.o \ disp/mdp_format.o \
disp/mdp_kms.o \ disp/mdp_kms.o \
disp/msm_disp_snapshot.o \ disp/msm_disp_snapshot.o \
disp/msm_disp_snapshot_util.o \ disp/msm_disp_snapshot_util.o \
msm-y += \
msm_atomic.o \ msm_atomic.o \
msm_atomic_tracepoints.o \ msm_atomic_tracepoints.o \
msm_debugfs.o \ msm_debugfs.o \
...@@ -113,14 +121,13 @@ msm-y += \ ...@@ -113,14 +121,13 @@ msm-y += \
msm_ringbuffer.o \ msm_ringbuffer.o \
msm_submitqueue.o \ msm_submitqueue.o \
msm_gpu_tracepoints.o \ msm_gpu_tracepoints.o \
msm_gpummu.o
msm-$(CONFIG_DEBUG_FS) += adreno/a5xx_debugfs.o \ msm-$(CONFIG_DRM_FBDEV_EMULATION) += msm_fbdev.o
dp/dp_debug.o
msm-$(CONFIG_DRM_MSM_GPU_STATE) += adreno/a6xx_gpu_state.o msm-display-$(CONFIG_DEBUG_FS) += \
dp/dp_debug.o
msm-$(CONFIG_DRM_MSM_DP)+= dp/dp_aux.o \ msm-display-$(CONFIG_DRM_MSM_DP)+= dp/dp_aux.o \
dp/dp_catalog.o \ dp/dp_catalog.o \
dp/dp_ctrl.o \ dp/dp_ctrl.o \
dp/dp_display.o \ dp/dp_display.o \
...@@ -130,21 +137,76 @@ msm-$(CONFIG_DRM_MSM_DP)+= dp/dp_aux.o \ ...@@ -130,21 +137,76 @@ msm-$(CONFIG_DRM_MSM_DP)+= dp/dp_aux.o \
dp/dp_audio.o \ dp/dp_audio.o \
dp/dp_utils.o dp/dp_utils.o
msm-$(CONFIG_DRM_FBDEV_EMULATION) += msm_fbdev.o msm-display-$(CONFIG_DRM_MSM_HDMI_HDCP) += hdmi/hdmi_hdcp.o
msm-$(CONFIG_DRM_MSM_HDMI_HDCP) += hdmi/hdmi_hdcp.o
msm-$(CONFIG_DRM_MSM_DSI) += dsi/dsi.o \ msm-display-$(CONFIG_DRM_MSM_DSI) += dsi/dsi.o \
dsi/dsi_cfg.o \ dsi/dsi_cfg.o \
dsi/dsi_host.o \ dsi/dsi_host.o \
dsi/dsi_manager.o \ dsi/dsi_manager.o \
dsi/phy/dsi_phy.o dsi/phy/dsi_phy.o
msm-$(CONFIG_DRM_MSM_DSI_28NM_PHY) += dsi/phy/dsi_phy_28nm.o msm-display-$(CONFIG_DRM_MSM_DSI_28NM_PHY) += dsi/phy/dsi_phy_28nm.o
msm-$(CONFIG_DRM_MSM_DSI_20NM_PHY) += dsi/phy/dsi_phy_20nm.o msm-display-$(CONFIG_DRM_MSM_DSI_20NM_PHY) += dsi/phy/dsi_phy_20nm.o
msm-$(CONFIG_DRM_MSM_DSI_28NM_8960_PHY) += dsi/phy/dsi_phy_28nm_8960.o msm-display-$(CONFIG_DRM_MSM_DSI_28NM_8960_PHY) += dsi/phy/dsi_phy_28nm_8960.o
msm-$(CONFIG_DRM_MSM_DSI_14NM_PHY) += dsi/phy/dsi_phy_14nm.o msm-display-$(CONFIG_DRM_MSM_DSI_14NM_PHY) += dsi/phy/dsi_phy_14nm.o
msm-$(CONFIG_DRM_MSM_DSI_10NM_PHY) += dsi/phy/dsi_phy_10nm.o msm-display-$(CONFIG_DRM_MSM_DSI_10NM_PHY) += dsi/phy/dsi_phy_10nm.o
msm-$(CONFIG_DRM_MSM_DSI_7NM_PHY) += dsi/phy/dsi_phy_7nm.o msm-display-$(CONFIG_DRM_MSM_DSI_7NM_PHY) += dsi/phy/dsi_phy_7nm.o
msm-y += $(adreno-y) $(msm-display-y)
obj-$(CONFIG_DRM_MSM) += msm.o obj-$(CONFIG_DRM_MSM) += msm.o
ifeq (y,$(CONFIG_DRM_MSM_VALIDATE_XML))
headergen-opts += --validate
else
headergen-opts += --no-validate
endif
quiet_cmd_headergen = GENHDR $@
cmd_headergen = mkdir -p $(obj)/generated && $(PYTHON3) $(srctree)/$(src)/registers/gen_header.py \
$(headergen-opts) --rnn $(srctree)/$(src)/registers --xml $< c-defines > $@
$(obj)/generated/%.xml.h: $(src)/registers/adreno/%.xml \
$(src)/registers/adreno/adreno_common.xml \
$(src)/registers/adreno/adreno_pm4.xml \
$(src)/registers/freedreno_copyright.xml \
$(src)/registers/gen_header.py \
$(src)/registers/rules-fd.xsd \
FORCE
$(call if_changed,headergen)
$(obj)/generated/%.xml.h: $(src)/registers/display/%.xml \
$(src)/registers/freedreno_copyright.xml \
$(src)/registers/gen_header.py \
$(src)/registers/rules-fd.xsd \
FORCE
$(call if_changed,headergen)
ADRENO_HEADERS = \
generated/a2xx.xml.h \
generated/a3xx.xml.h \
generated/a4xx.xml.h \
generated/a5xx.xml.h \
generated/a6xx.xml.h \
generated/a6xx_gmu.xml.h \
generated/adreno_common.xml.h \
generated/adreno_pm4.xml.h \
DISPLAY_HEADERS = \
generated/dsi_phy_7nm.xml.h \
generated/dsi_phy_10nm.xml.h \
generated/dsi_phy_14nm.xml.h \
generated/dsi_phy_20nm.xml.h \
generated/dsi_phy_28nm_8960.xml.h \
generated/dsi_phy_28nm.xml.h \
generated/dsi.xml.h \
generated/hdmi.xml.h \
generated/mdp4.xml.h \
generated/mdp5.xml.h \
generated/mdp_common.xml.h \
generated/sfpb.xml.h
$(addprefix $(obj)/,$(adreno-y)): $(addprefix $(obj)/,$(ADRENO_HEADERS))
$(addprefix $(obj)/,$(msm-display-y)): $(addprefix $(obj)/,$(DISPLAY_HEADERS))
targets += $(ADRENO_HEADERS) $(DISPLAY_HEADERS)
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -113,7 +113,7 @@ static int a2xx_hw_init(struct msm_gpu *gpu) ...@@ -113,7 +113,7 @@ static int a2xx_hw_init(struct msm_gpu *gpu)
uint32_t *ptr, len; uint32_t *ptr, len;
int i, ret; int i, ret;
msm_gpummu_params(gpu->aspace->mmu, &pt_base, &tran_error); a2xx_gpummu_params(gpu->aspace->mmu, &pt_base, &tran_error);
DBG("%s", gpu->name); DBG("%s", gpu->name);
...@@ -469,7 +469,7 @@ static struct msm_gpu_state *a2xx_gpu_state_get(struct msm_gpu *gpu) ...@@ -469,7 +469,7 @@ static struct msm_gpu_state *a2xx_gpu_state_get(struct msm_gpu *gpu)
static struct msm_gem_address_space * static struct msm_gem_address_space *
a2xx_create_address_space(struct msm_gpu *gpu, struct platform_device *pdev) a2xx_create_address_space(struct msm_gpu *gpu, struct platform_device *pdev)
{ {
struct msm_mmu *mmu = msm_gpummu_new(&pdev->dev, gpu); struct msm_mmu *mmu = a2xx_gpummu_new(&pdev->dev, gpu);
struct msm_gem_address_space *aspace; struct msm_gem_address_space *aspace;
aspace = msm_gem_address_space_create(mmu, "gpu", SZ_16M, aspace = msm_gem_address_space_create(mmu, "gpu", SZ_16M,
......
...@@ -19,4 +19,8 @@ struct a2xx_gpu { ...@@ -19,4 +19,8 @@ struct a2xx_gpu {
}; };
#define to_a2xx_gpu(x) container_of(x, struct a2xx_gpu, base) #define to_a2xx_gpu(x) container_of(x, struct a2xx_gpu, base)
struct msm_mmu *a2xx_gpummu_new(struct device *dev, struct msm_gpu *gpu);
void a2xx_gpummu_params(struct msm_mmu *mmu, dma_addr_t *pt_base,
dma_addr_t *tran_error);
#endif /* __A2XX_GPU_H__ */ #endif /* __A2XX_GPU_H__ */
...@@ -5,30 +5,33 @@ ...@@ -5,30 +5,33 @@
#include "msm_drv.h" #include "msm_drv.h"
#include "msm_mmu.h" #include "msm_mmu.h"
#include "adreno/adreno_gpu.h"
#include "adreno/a2xx.xml.h"
struct msm_gpummu { #include "adreno_gpu.h"
#include "a2xx_gpu.h"
#include "a2xx.xml.h"
struct a2xx_gpummu {
struct msm_mmu base; struct msm_mmu base;
struct msm_gpu *gpu; struct msm_gpu *gpu;
dma_addr_t pt_base; dma_addr_t pt_base;
uint32_t *table; uint32_t *table;
}; };
#define to_msm_gpummu(x) container_of(x, struct msm_gpummu, base) #define to_a2xx_gpummu(x) container_of(x, struct a2xx_gpummu, base)
#define GPUMMU_VA_START SZ_16M #define GPUMMU_VA_START SZ_16M
#define GPUMMU_VA_RANGE (0xfff * SZ_64K) #define GPUMMU_VA_RANGE (0xfff * SZ_64K)
#define GPUMMU_PAGE_SIZE SZ_4K #define GPUMMU_PAGE_SIZE SZ_4K
#define TABLE_SIZE (sizeof(uint32_t) * GPUMMU_VA_RANGE / GPUMMU_PAGE_SIZE) #define TABLE_SIZE (sizeof(uint32_t) * GPUMMU_VA_RANGE / GPUMMU_PAGE_SIZE)
static void msm_gpummu_detach(struct msm_mmu *mmu) static void a2xx_gpummu_detach(struct msm_mmu *mmu)
{ {
} }
static int msm_gpummu_map(struct msm_mmu *mmu, uint64_t iova, static int a2xx_gpummu_map(struct msm_mmu *mmu, uint64_t iova,
struct sg_table *sgt, size_t len, int prot) struct sg_table *sgt, size_t len, int prot)
{ {
struct msm_gpummu *gpummu = to_msm_gpummu(mmu); struct a2xx_gpummu *gpummu = to_a2xx_gpummu(mmu);
unsigned idx = (iova - GPUMMU_VA_START) / GPUMMU_PAGE_SIZE; unsigned idx = (iova - GPUMMU_VA_START) / GPUMMU_PAGE_SIZE;
struct sg_dma_page_iter dma_iter; struct sg_dma_page_iter dma_iter;
unsigned prot_bits = 0; unsigned prot_bits = 0;
...@@ -53,9 +56,9 @@ static int msm_gpummu_map(struct msm_mmu *mmu, uint64_t iova, ...@@ -53,9 +56,9 @@ static int msm_gpummu_map(struct msm_mmu *mmu, uint64_t iova,
return 0; return 0;
} }
static int msm_gpummu_unmap(struct msm_mmu *mmu, uint64_t iova, size_t len) static int a2xx_gpummu_unmap(struct msm_mmu *mmu, uint64_t iova, size_t len)
{ {
struct msm_gpummu *gpummu = to_msm_gpummu(mmu); struct a2xx_gpummu *gpummu = to_a2xx_gpummu(mmu);
unsigned idx = (iova - GPUMMU_VA_START) / GPUMMU_PAGE_SIZE; unsigned idx = (iova - GPUMMU_VA_START) / GPUMMU_PAGE_SIZE;
unsigned i; unsigned i;
...@@ -68,13 +71,13 @@ static int msm_gpummu_unmap(struct msm_mmu *mmu, uint64_t iova, size_t len) ...@@ -68,13 +71,13 @@ static int msm_gpummu_unmap(struct msm_mmu *mmu, uint64_t iova, size_t len)
return 0; return 0;
} }
static void msm_gpummu_resume_translation(struct msm_mmu *mmu) static void a2xx_gpummu_resume_translation(struct msm_mmu *mmu)
{ {
} }
static void msm_gpummu_destroy(struct msm_mmu *mmu) static void a2xx_gpummu_destroy(struct msm_mmu *mmu)
{ {
struct msm_gpummu *gpummu = to_msm_gpummu(mmu); struct a2xx_gpummu *gpummu = to_a2xx_gpummu(mmu);
dma_free_attrs(mmu->dev, TABLE_SIZE, gpummu->table, gpummu->pt_base, dma_free_attrs(mmu->dev, TABLE_SIZE, gpummu->table, gpummu->pt_base,
DMA_ATTR_FORCE_CONTIGUOUS); DMA_ATTR_FORCE_CONTIGUOUS);
...@@ -83,16 +86,16 @@ static void msm_gpummu_destroy(struct msm_mmu *mmu) ...@@ -83,16 +86,16 @@ static void msm_gpummu_destroy(struct msm_mmu *mmu)
} }
static const struct msm_mmu_funcs funcs = { static const struct msm_mmu_funcs funcs = {
.detach = msm_gpummu_detach, .detach = a2xx_gpummu_detach,
.map = msm_gpummu_map, .map = a2xx_gpummu_map,
.unmap = msm_gpummu_unmap, .unmap = a2xx_gpummu_unmap,
.destroy = msm_gpummu_destroy, .destroy = a2xx_gpummu_destroy,
.resume_translation = msm_gpummu_resume_translation, .resume_translation = a2xx_gpummu_resume_translation,
}; };
struct msm_mmu *msm_gpummu_new(struct device *dev, struct msm_gpu *gpu) struct msm_mmu *a2xx_gpummu_new(struct device *dev, struct msm_gpu *gpu)
{ {
struct msm_gpummu *gpummu; struct a2xx_gpummu *gpummu;
gpummu = kzalloc(sizeof(*gpummu), GFP_KERNEL); gpummu = kzalloc(sizeof(*gpummu), GFP_KERNEL);
if (!gpummu) if (!gpummu)
...@@ -111,10 +114,10 @@ struct msm_mmu *msm_gpummu_new(struct device *dev, struct msm_gpu *gpu) ...@@ -111,10 +114,10 @@ struct msm_mmu *msm_gpummu_new(struct device *dev, struct msm_gpu *gpu)
return &gpummu->base; return &gpummu->base;
} }
void msm_gpummu_params(struct msm_mmu *mmu, dma_addr_t *pt_base, void a2xx_gpummu_params(struct msm_mmu *mmu, dma_addr_t *pt_base,
dma_addr_t *tran_error) dma_addr_t *tran_error)
{ {
dma_addr_t base = to_msm_gpummu(mmu)->pt_base; dma_addr_t base = to_a2xx_gpummu(mmu)->pt_base;
*pt_base = base; *pt_base = base;
*tran_error = base + TABLE_SIZE; /* 32-byte aligned */ *tran_error = base + TABLE_SIZE; /* 32-byte aligned */
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
...@@ -507,7 +507,7 @@ static void a6xx_rpmh_stop(struct a6xx_gmu *gmu) ...@@ -507,7 +507,7 @@ static void a6xx_rpmh_stop(struct a6xx_gmu *gmu)
static inline void pdc_write(void __iomem *ptr, u32 offset, u32 value) static inline void pdc_write(void __iomem *ptr, u32 offset, u32 value)
{ {
msm_writel(value, ptr + (offset << 2)); writel(value, ptr + (offset << 2));
} }
static void __iomem *a6xx_gmu_get_mmio(struct platform_device *pdev, static void __iomem *a6xx_gmu_get_mmio(struct platform_device *pdev,
......
...@@ -103,12 +103,12 @@ struct a6xx_gmu { ...@@ -103,12 +103,12 @@ struct a6xx_gmu {
static inline u32 gmu_read(struct a6xx_gmu *gmu, u32 offset) static inline u32 gmu_read(struct a6xx_gmu *gmu, u32 offset)
{ {
return msm_readl(gmu->mmio + (offset << 2)); return readl(gmu->mmio + (offset << 2));
} }
static inline void gmu_write(struct a6xx_gmu *gmu, u32 offset, u32 value) static inline void gmu_write(struct a6xx_gmu *gmu, u32 offset, u32 value)
{ {
msm_writel(value, gmu->mmio + (offset << 2)); writel(value, gmu->mmio + (offset << 2));
} }
static inline void static inline void
...@@ -131,8 +131,8 @@ static inline u64 gmu_read64(struct a6xx_gmu *gmu, u32 lo, u32 hi) ...@@ -131,8 +131,8 @@ static inline u64 gmu_read64(struct a6xx_gmu *gmu, u32 lo, u32 hi)
{ {
u64 val; u64 val;
val = (u64) msm_readl(gmu->mmio + (lo << 2)); val = (u64) readl(gmu->mmio + (lo << 2));
val |= ((u64) msm_readl(gmu->mmio + (hi << 2)) << 32); val |= ((u64) readl(gmu->mmio + (hi << 2)) << 32);
return val; return val;
} }
...@@ -143,12 +143,12 @@ static inline u64 gmu_read64(struct a6xx_gmu *gmu, u32 lo, u32 hi) ...@@ -143,12 +143,12 @@ static inline u64 gmu_read64(struct a6xx_gmu *gmu, u32 lo, u32 hi)
static inline u32 gmu_read_rscc(struct a6xx_gmu *gmu, u32 offset) static inline u32 gmu_read_rscc(struct a6xx_gmu *gmu, u32 offset)
{ {
return msm_readl(gmu->rscc + (offset << 2)); return readl(gmu->rscc + (offset << 2));
} }
static inline void gmu_write_rscc(struct a6xx_gmu *gmu, u32 offset, u32 value) static inline void gmu_write_rscc(struct a6xx_gmu *gmu, u32 offset, u32 value)
{ {
msm_writel(value, gmu->rscc + (offset << 2)); writel(value, gmu->rscc + (offset << 2));
} }
#define gmu_poll_timeout_rscc(gmu, addr, val, cond, interval, timeout) \ #define gmu_poll_timeout_rscc(gmu, addr, val, cond, interval, timeout) \
......
This diff is collapsed.
...@@ -284,7 +284,7 @@ static void a7xx_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit) ...@@ -284,7 +284,7 @@ static void a7xx_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit)
a6xx_set_pagetable(a6xx_gpu, ring, submit->queue->ctx); a6xx_set_pagetable(a6xx_gpu, ring, submit->queue->ctx);
get_stats_counter(ring, REG_A6XX_RBBM_PERFCTR_CP(0), get_stats_counter(ring, REG_A7XX_RBBM_PERFCTR_CP(0),
rbmemptr_stats(ring, index, cpcycles_start)); rbmemptr_stats(ring, index, cpcycles_start));
get_stats_counter(ring, REG_A6XX_CP_ALWAYS_ON_COUNTER, get_stats_counter(ring, REG_A6XX_CP_ALWAYS_ON_COUNTER,
rbmemptr_stats(ring, index, alwayson_start)); rbmemptr_stats(ring, index, alwayson_start));
...@@ -330,7 +330,7 @@ static void a7xx_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit) ...@@ -330,7 +330,7 @@ static void a7xx_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit)
OUT_PKT7(ring, CP_SET_MARKER, 1); OUT_PKT7(ring, CP_SET_MARKER, 1);
OUT_RING(ring, 0x00e); /* IB1LIST end */ OUT_RING(ring, 0x00e); /* IB1LIST end */
get_stats_counter(ring, REG_A6XX_RBBM_PERFCTR_CP(0), get_stats_counter(ring, REG_A7XX_RBBM_PERFCTR_CP(0),
rbmemptr_stats(ring, index, cpcycles_end)); rbmemptr_stats(ring, index, cpcycles_end));
get_stats_counter(ring, REG_A6XX_CP_ALWAYS_ON_COUNTER, get_stats_counter(ring, REG_A6XX_CP_ALWAYS_ON_COUNTER,
rbmemptr_stats(ring, index, alwayson_end)); rbmemptr_stats(ring, index, alwayson_end));
...@@ -1255,8 +1255,9 @@ static const u32 a730_protect[] = { ...@@ -1255,8 +1255,9 @@ static const u32 a730_protect[] = {
A6XX_PROTECT_NORDWR(0x00699, 0x01e9), A6XX_PROTECT_NORDWR(0x00699, 0x01e9),
A6XX_PROTECT_NORDWR(0x008a0, 0x0008), A6XX_PROTECT_NORDWR(0x008a0, 0x0008),
A6XX_PROTECT_NORDWR(0x008ab, 0x0024), A6XX_PROTECT_NORDWR(0x008ab, 0x0024),
/* 0x008d0-0x008dd are unprotected on purpose for tools like perfetto */ /* 0x008d0-0x008dd and 0x008e0-0x008e6 are unprotected on purpose for tools like perfetto */
A6XX_PROTECT_RDONLY(0x008de, 0x0154), A6XX_PROTECT_NORDWR(0x008de, 0x0001),
A6XX_PROTECT_RDONLY(0x008e7, 0x014b),
A6XX_PROTECT_NORDWR(0x00900, 0x004d), A6XX_PROTECT_NORDWR(0x00900, 0x004d),
A6XX_PROTECT_NORDWR(0x0098d, 0x00b2), A6XX_PROTECT_NORDWR(0x0098d, 0x00b2),
A6XX_PROTECT_NORDWR(0x00a41, 0x01be), A6XX_PROTECT_NORDWR(0x00a41, 0x01be),
...@@ -1291,8 +1292,7 @@ static const u32 a730_protect[] = { ...@@ -1291,8 +1292,7 @@ static const u32 a730_protect[] = {
A6XX_PROTECT_RDONLY(0x1f844, 0x007b), A6XX_PROTECT_RDONLY(0x1f844, 0x007b),
A6XX_PROTECT_NORDWR(0x1f860, 0x0000), A6XX_PROTECT_NORDWR(0x1f860, 0x0000),
A6XX_PROTECT_NORDWR(0x1f878, 0x002a), A6XX_PROTECT_NORDWR(0x1f878, 0x002a),
/* CP_PROTECT_REG[44, 46] are left untouched! */ /* CP_PROTECT_REG[45, 46] are left untouched! */
0,
0, 0,
0, 0,
A6XX_PROTECT_NORDWR(0x1f8c0, 0x00000), A6XX_PROTECT_NORDWR(0x1f8c0, 0x00000),
...@@ -3062,7 +3062,8 @@ struct msm_gpu *a6xx_gpu_init(struct drm_device *dev) ...@@ -3062,7 +3062,8 @@ struct msm_gpu *a6xx_gpu_init(struct drm_device *dev)
ret = a6xx_set_supported_hw(&pdev->dev, config->info); ret = a6xx_set_supported_hw(&pdev->dev, config->info);
if (ret) { if (ret) {
a6xx_destroy(&(a6xx_gpu->base.base)); a6xx_llc_slices_destroy(a6xx_gpu);
kfree(a6xx_gpu);
return ERR_PTR(ret); return ERR_PTR(ret);
} }
......
...@@ -69,12 +69,12 @@ static inline void a6xx_llc_rmw(struct a6xx_gpu *a6xx_gpu, u32 reg, u32 mask, u3 ...@@ -69,12 +69,12 @@ static inline void a6xx_llc_rmw(struct a6xx_gpu *a6xx_gpu, u32 reg, u32 mask, u3
static inline u32 a6xx_llc_read(struct a6xx_gpu *a6xx_gpu, u32 reg) static inline u32 a6xx_llc_read(struct a6xx_gpu *a6xx_gpu, u32 reg)
{ {
return msm_readl(a6xx_gpu->llc_mmio + (reg << 2)); return readl(a6xx_gpu->llc_mmio + (reg << 2));
} }
static inline void a6xx_llc_write(struct a6xx_gpu *a6xx_gpu, u32 reg, u32 value) static inline void a6xx_llc_write(struct a6xx_gpu *a6xx_gpu, u32 reg, u32 value)
{ {
msm_writel(value, a6xx_gpu->llc_mmio + (reg << 2)); writel(value, a6xx_gpu->llc_mmio + (reg << 2));
} }
#define shadowptr(_a6xx_gpu, _ring) ((_a6xx_gpu)->shadow_iova + \ #define shadowptr(_a6xx_gpu, _ring) ((_a6xx_gpu)->shadow_iova + \
......
...@@ -13,15 +13,18 @@ ...@@ -13,15 +13,18 @@
*/ */
#pragma GCC diagnostic push #pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-variable" #pragma GCC diagnostic ignored "-Wunused-variable"
#pragma GCC diagnostic ignored "-Wunused-const-variable"
#include "adreno_gen7_0_0_snapshot.h" #include "adreno_gen7_0_0_snapshot.h"
#include "adreno_gen7_2_0_snapshot.h" #include "adreno_gen7_2_0_snapshot.h"
#include "adreno_gen7_9_0_snapshot.h"
#pragma GCC diagnostic pop #pragma GCC diagnostic pop
struct a6xx_gpu_state_obj { struct a6xx_gpu_state_obj {
const void *handle; const void *handle;
u32 *data; u32 *data;
u32 count; /* optional, used when count potentially read from hw */
}; };
struct a6xx_gpu_state { struct a6xx_gpu_state {
...@@ -192,10 +195,10 @@ static int debugbus_read(struct msm_gpu *gpu, u32 block, u32 offset, ...@@ -192,10 +195,10 @@ static int debugbus_read(struct msm_gpu *gpu, u32 block, u32 offset,
} }
#define cxdbg_write(ptr, offset, val) \ #define cxdbg_write(ptr, offset, val) \
msm_writel((val), (ptr) + ((offset) << 2)) writel((val), (ptr) + ((offset) << 2))
#define cxdbg_read(ptr, offset) \ #define cxdbg_read(ptr, offset) \
msm_readl((ptr) + ((offset) << 2)) readl((ptr) + ((offset) << 2))
/* read a value from the CX debug bus */ /* read a value from the CX debug bus */
static int cx_debugbus_read(void __iomem *cxdbg, u32 block, u32 offset, static int cx_debugbus_read(void __iomem *cxdbg, u32 block, u32 offset,
...@@ -384,21 +387,29 @@ static void a7xx_get_debugbus_blocks(struct msm_gpu *gpu, ...@@ -384,21 +387,29 @@ static void a7xx_get_debugbus_blocks(struct msm_gpu *gpu,
struct a6xx_gpu_state *a6xx_state) struct a6xx_gpu_state *a6xx_state)
{ {
struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu); struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);
int debugbus_blocks_count, total_debugbus_blocks; int debugbus_blocks_count, gbif_debugbus_blocks_count, total_debugbus_blocks;
const u32 *debugbus_blocks; const u32 *debugbus_blocks, *gbif_debugbus_blocks;
int i; int i;
if (adreno_is_a730(adreno_gpu)) { if (adreno_is_a730(adreno_gpu)) {
debugbus_blocks = gen7_0_0_debugbus_blocks; debugbus_blocks = gen7_0_0_debugbus_blocks;
debugbus_blocks_count = ARRAY_SIZE(gen7_0_0_debugbus_blocks); debugbus_blocks_count = ARRAY_SIZE(gen7_0_0_debugbus_blocks);
} else { gbif_debugbus_blocks = a7xx_gbif_debugbus_blocks;
BUG_ON(!adreno_is_a740_family(adreno_gpu)); gbif_debugbus_blocks_count = ARRAY_SIZE(a7xx_gbif_debugbus_blocks);
} else if (adreno_is_a740_family(adreno_gpu)) {
debugbus_blocks = gen7_2_0_debugbus_blocks; debugbus_blocks = gen7_2_0_debugbus_blocks;
debugbus_blocks_count = ARRAY_SIZE(gen7_2_0_debugbus_blocks); debugbus_blocks_count = ARRAY_SIZE(gen7_2_0_debugbus_blocks);
gbif_debugbus_blocks = a7xx_gbif_debugbus_blocks;
gbif_debugbus_blocks_count = ARRAY_SIZE(a7xx_gbif_debugbus_blocks);
} else {
BUG_ON(!adreno_is_a750(adreno_gpu));
debugbus_blocks = gen7_9_0_debugbus_blocks;
debugbus_blocks_count = ARRAY_SIZE(gen7_9_0_debugbus_blocks);
gbif_debugbus_blocks = gen7_9_0_gbif_debugbus_blocks;
gbif_debugbus_blocks_count = ARRAY_SIZE(gen7_9_0_gbif_debugbus_blocks);
} }
total_debugbus_blocks = debugbus_blocks_count + total_debugbus_blocks = debugbus_blocks_count + gbif_debugbus_blocks_count;
ARRAY_SIZE(a7xx_gbif_debugbus_blocks);
a6xx_state->debugbus = state_kcalloc(a6xx_state, total_debugbus_blocks, a6xx_state->debugbus = state_kcalloc(a6xx_state, total_debugbus_blocks,
sizeof(*a6xx_state->debugbus)); sizeof(*a6xx_state->debugbus));
...@@ -410,9 +421,9 @@ static void a7xx_get_debugbus_blocks(struct msm_gpu *gpu, ...@@ -410,9 +421,9 @@ static void a7xx_get_debugbus_blocks(struct msm_gpu *gpu,
&a6xx_state->debugbus[i]); &a6xx_state->debugbus[i]);
} }
for (i = 0; i < ARRAY_SIZE(a7xx_gbif_debugbus_blocks); i++) { for (i = 0; i < gbif_debugbus_blocks_count; i++) {
a6xx_get_debugbus_block(gpu, a6xx_get_debugbus_block(gpu,
a6xx_state, &a7xx_gbif_debugbus_blocks[i], a6xx_state, &a7xx_debugbus_blocks[gbif_debugbus_blocks[i]],
&a6xx_state->debugbus[i + debugbus_blocks_count]); &a6xx_state->debugbus[i + debugbus_blocks_count]);
} }
} }
...@@ -813,10 +824,13 @@ static void a7xx_get_clusters(struct msm_gpu *gpu, ...@@ -813,10 +824,13 @@ static void a7xx_get_clusters(struct msm_gpu *gpu,
if (adreno_is_a730(adreno_gpu)) { if (adreno_is_a730(adreno_gpu)) {
clusters = gen7_0_0_clusters; clusters = gen7_0_0_clusters;
clusters_size = ARRAY_SIZE(gen7_0_0_clusters); clusters_size = ARRAY_SIZE(gen7_0_0_clusters);
} else { } else if (adreno_is_a740_family(adreno_gpu)) {
BUG_ON(!adreno_is_a740_family(adreno_gpu));
clusters = gen7_2_0_clusters; clusters = gen7_2_0_clusters;
clusters_size = ARRAY_SIZE(gen7_2_0_clusters); clusters_size = ARRAY_SIZE(gen7_2_0_clusters);
} else {
BUG_ON(!adreno_is_a750(adreno_gpu));
clusters = gen7_9_0_clusters;
clusters_size = ARRAY_SIZE(gen7_9_0_clusters);
} }
a6xx_state->clusters = state_kcalloc(a6xx_state, a6xx_state->clusters = state_kcalloc(a6xx_state,
...@@ -948,10 +962,13 @@ static void a7xx_get_shaders(struct msm_gpu *gpu, ...@@ -948,10 +962,13 @@ static void a7xx_get_shaders(struct msm_gpu *gpu,
if (adreno_is_a730(adreno_gpu)) { if (adreno_is_a730(adreno_gpu)) {
shader_blocks = gen7_0_0_shader_blocks; shader_blocks = gen7_0_0_shader_blocks;
num_shader_blocks = ARRAY_SIZE(gen7_0_0_shader_blocks); num_shader_blocks = ARRAY_SIZE(gen7_0_0_shader_blocks);
} else { } else if (adreno_is_a740_family(adreno_gpu)) {
BUG_ON(!adreno_is_a740_family(adreno_gpu));
shader_blocks = gen7_2_0_shader_blocks; shader_blocks = gen7_2_0_shader_blocks;
num_shader_blocks = ARRAY_SIZE(gen7_2_0_shader_blocks); num_shader_blocks = ARRAY_SIZE(gen7_2_0_shader_blocks);
} else {
BUG_ON(!adreno_is_a750(adreno_gpu));
shader_blocks = gen7_9_0_shader_blocks;
num_shader_blocks = ARRAY_SIZE(gen7_9_0_shader_blocks);
} }
a6xx_state->shaders = state_kcalloc(a6xx_state, a6xx_state->shaders = state_kcalloc(a6xx_state,
...@@ -1337,10 +1354,13 @@ static void a7xx_get_registers(struct msm_gpu *gpu, ...@@ -1337,10 +1354,13 @@ static void a7xx_get_registers(struct msm_gpu *gpu,
if (adreno_is_a730(adreno_gpu)) { if (adreno_is_a730(adreno_gpu)) {
reglist = gen7_0_0_reg_list; reglist = gen7_0_0_reg_list;
pre_crashdumper_regs = gen7_0_0_pre_crashdumper_gpu_registers; pre_crashdumper_regs = gen7_0_0_pre_crashdumper_gpu_registers;
} else { } else if (adreno_is_a740_family(adreno_gpu)) {
BUG_ON(!adreno_is_a740_family(adreno_gpu));
reglist = gen7_2_0_reg_list; reglist = gen7_2_0_reg_list;
pre_crashdumper_regs = gen7_0_0_pre_crashdumper_gpu_registers; pre_crashdumper_regs = gen7_0_0_pre_crashdumper_gpu_registers;
} else {
BUG_ON(!adreno_is_a750(adreno_gpu));
reglist = gen7_9_0_reg_list;
pre_crashdumper_regs = gen7_9_0_pre_crashdumper_gpu_registers;
} }
count = A7XX_PRE_CRASHDUMPER_SIZE + A7XX_POST_CRASHDUMPER_SIZE; count = A7XX_PRE_CRASHDUMPER_SIZE + A7XX_POST_CRASHDUMPER_SIZE;
...@@ -1388,7 +1408,8 @@ static void a7xx_get_post_crashdumper_registers(struct msm_gpu *gpu, ...@@ -1388,7 +1408,8 @@ static void a7xx_get_post_crashdumper_registers(struct msm_gpu *gpu,
struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu); struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);
const u32 *regs; const u32 *regs;
BUG_ON(!(adreno_is_a730(adreno_gpu) || adreno_is_a740_family(adreno_gpu))); BUG_ON(!(adreno_is_a730(adreno_gpu) || adreno_is_a740_family(adreno_gpu) ||
adreno_is_a750(adreno_gpu)));
regs = gen7_0_0_post_crashdumper_registers; regs = gen7_0_0_post_crashdumper_registers;
a7xx_get_ahb_gpu_registers(gpu, a7xx_get_ahb_gpu_registers(gpu,
...@@ -1417,16 +1438,18 @@ static u32 a7xx_get_cp_roq_size(struct msm_gpu *gpu) ...@@ -1417,16 +1438,18 @@ static u32 a7xx_get_cp_roq_size(struct msm_gpu *gpu)
/* Read a block of data from an indexed register pair */ /* Read a block of data from an indexed register pair */
static void a6xx_get_indexed_regs(struct msm_gpu *gpu, static void a6xx_get_indexed_regs(struct msm_gpu *gpu,
struct a6xx_gpu_state *a6xx_state, struct a6xx_gpu_state *a6xx_state,
struct a6xx_indexed_registers *indexed, const struct a6xx_indexed_registers *indexed,
struct a6xx_gpu_state_obj *obj) struct a6xx_gpu_state_obj *obj)
{ {
u32 count = indexed->count;
int i; int i;
obj->handle = (const void *) indexed; obj->handle = (const void *) indexed;
if (indexed->count_fn) if (indexed->count_fn)
indexed->count = indexed->count_fn(gpu); count = indexed->count_fn(gpu);
obj->data = state_kcalloc(a6xx_state, indexed->count, sizeof(u32)); obj->data = state_kcalloc(a6xx_state, count, sizeof(u32));
obj->count = count;
if (!obj->data) if (!obj->data)
return; return;
...@@ -1434,7 +1457,7 @@ static void a6xx_get_indexed_regs(struct msm_gpu *gpu, ...@@ -1434,7 +1457,7 @@ static void a6xx_get_indexed_regs(struct msm_gpu *gpu,
gpu_write(gpu, indexed->addr, 0); gpu_write(gpu, indexed->addr, 0);
/* Read the data - each read increments the internal address by 1 */ /* Read the data - each read increments the internal address by 1 */
for (i = 0; i < indexed->count; i++) for (i = 0; i < count; i++)
obj->data[i] = gpu_read(gpu, indexed->data); obj->data[i] = gpu_read(gpu, indexed->data);
} }
...@@ -1491,10 +1514,18 @@ static void a7xx_get_indexed_registers(struct msm_gpu *gpu, ...@@ -1491,10 +1514,18 @@ static void a7xx_get_indexed_registers(struct msm_gpu *gpu,
struct a6xx_gpu_state *a6xx_state) struct a6xx_gpu_state *a6xx_state)
{ {
struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu); struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);
const struct a6xx_indexed_registers *indexed_regs;
int i, indexed_count, mempool_count; int i, indexed_count, mempool_count;
BUG_ON(!(adreno_is_a730(adreno_gpu) || adreno_is_a740_family(adreno_gpu))); if (adreno_is_a730(adreno_gpu) || adreno_is_a740_family(adreno_gpu)) {
indexed_count = ARRAY_SIZE(a7xx_indexed_reglist); indexed_regs = a7xx_indexed_reglist;
indexed_count = ARRAY_SIZE(a7xx_indexed_reglist);
} else {
BUG_ON(!adreno_is_a750(adreno_gpu));
indexed_regs = gen7_9_0_cp_indexed_reg_list;
indexed_count = ARRAY_SIZE(gen7_9_0_cp_indexed_reg_list);
}
mempool_count = ARRAY_SIZE(a7xx_cp_bv_mempool_indexed); mempool_count = ARRAY_SIZE(a7xx_cp_bv_mempool_indexed);
a6xx_state->indexed_regs = state_kcalloc(a6xx_state, a6xx_state->indexed_regs = state_kcalloc(a6xx_state,
...@@ -1507,7 +1538,7 @@ static void a7xx_get_indexed_registers(struct msm_gpu *gpu, ...@@ -1507,7 +1538,7 @@ static void a7xx_get_indexed_registers(struct msm_gpu *gpu,
/* First read the common regs */ /* First read the common regs */
for (i = 0; i < indexed_count; i++) for (i = 0; i < indexed_count; i++)
a6xx_get_indexed_regs(gpu, a6xx_state, &a7xx_indexed_reglist[i], a6xx_get_indexed_regs(gpu, a6xx_state, &indexed_regs[i],
&a6xx_state->indexed_regs[i]); &a6xx_state->indexed_regs[i]);
gpu_rmw(gpu, REG_A6XX_CP_CHICKEN_DBG, 0, BIT(2)); gpu_rmw(gpu, REG_A6XX_CP_CHICKEN_DBG, 0, BIT(2));
...@@ -1862,9 +1893,9 @@ static void a6xx_show_indexed_regs(struct a6xx_gpu_state_obj *obj, ...@@ -1862,9 +1893,9 @@ static void a6xx_show_indexed_regs(struct a6xx_gpu_state_obj *obj,
return; return;
print_name(p, " - regs-name: ", indexed->name); print_name(p, " - regs-name: ", indexed->name);
drm_printf(p, " dwords: %d\n", indexed->count); drm_printf(p, " dwords: %d\n", obj->count);
print_ascii85(p, indexed->count << 2, obj->data); print_ascii85(p, obj->count << 2, obj->data);
} }
static void a6xx_show_debugbus_block(const struct a6xx_debugbus_block *block, static void a6xx_show_debugbus_block(const struct a6xx_debugbus_block *block,
......
...@@ -397,7 +397,7 @@ struct a6xx_indexed_registers { ...@@ -397,7 +397,7 @@ struct a6xx_indexed_registers {
u32 (*count_fn)(struct msm_gpu *gpu); u32 (*count_fn)(struct msm_gpu *gpu);
}; };
static struct a6xx_indexed_registers a6xx_indexed_reglist[] = { static const struct a6xx_indexed_registers a6xx_indexed_reglist[] = {
{ "CP_SQE_STAT", REG_A6XX_CP_SQE_STAT_ADDR, { "CP_SQE_STAT", REG_A6XX_CP_SQE_STAT_ADDR,
REG_A6XX_CP_SQE_STAT_DATA, 0x33, NULL }, REG_A6XX_CP_SQE_STAT_DATA, 0x33, NULL },
{ "CP_DRAW_STATE", REG_A6XX_CP_DRAW_STATE_ADDR, { "CP_DRAW_STATE", REG_A6XX_CP_DRAW_STATE_ADDR,
...@@ -408,7 +408,7 @@ static struct a6xx_indexed_registers a6xx_indexed_reglist[] = { ...@@ -408,7 +408,7 @@ static struct a6xx_indexed_registers a6xx_indexed_reglist[] = {
REG_A6XX_CP_ROQ_DBG_DATA, 0, a6xx_get_cp_roq_size}, REG_A6XX_CP_ROQ_DBG_DATA, 0, a6xx_get_cp_roq_size},
}; };
static struct a6xx_indexed_registers a7xx_indexed_reglist[] = { static const struct a6xx_indexed_registers a7xx_indexed_reglist[] = {
{ "CP_SQE_STAT", REG_A6XX_CP_SQE_STAT_ADDR, { "CP_SQE_STAT", REG_A6XX_CP_SQE_STAT_ADDR,
REG_A6XX_CP_SQE_STAT_DATA, 0x33, NULL }, REG_A6XX_CP_SQE_STAT_DATA, 0x33, NULL },
{ "CP_DRAW_STATE", REG_A6XX_CP_DRAW_STATE_ADDR, { "CP_DRAW_STATE", REG_A6XX_CP_DRAW_STATE_ADDR,
...@@ -433,12 +433,12 @@ static struct a6xx_indexed_registers a7xx_indexed_reglist[] = { ...@@ -433,12 +433,12 @@ static struct a6xx_indexed_registers a7xx_indexed_reglist[] = {
REG_A6XX_CP_ROQ_DBG_DATA, 0, a7xx_get_cp_roq_size }, REG_A6XX_CP_ROQ_DBG_DATA, 0, a7xx_get_cp_roq_size },
}; };
static struct a6xx_indexed_registers a6xx_cp_mempool_indexed = { static const struct a6xx_indexed_registers a6xx_cp_mempool_indexed = {
"CP_MEMPOOL", REG_A6XX_CP_MEM_POOL_DBG_ADDR, "CP_MEMPOOL", REG_A6XX_CP_MEM_POOL_DBG_ADDR,
REG_A6XX_CP_MEM_POOL_DBG_DATA, 0x2060, NULL, REG_A6XX_CP_MEM_POOL_DBG_DATA, 0x2060, NULL,
}; };
static struct a6xx_indexed_registers a7xx_cp_bv_mempool_indexed[] = { static const struct a6xx_indexed_registers a7xx_cp_bv_mempool_indexed[] = {
{ "CP_MEMPOOL", REG_A6XX_CP_MEM_POOL_DBG_ADDR, { "CP_MEMPOOL", REG_A6XX_CP_MEM_POOL_DBG_ADDR,
REG_A6XX_CP_MEM_POOL_DBG_DATA, 0x2100, NULL }, REG_A6XX_CP_MEM_POOL_DBG_DATA, 0x2100, NULL },
{ "CP_BV_MEMPOOL", REG_A7XX_CP_BV_MEM_POOL_DBG_ADDR, { "CP_BV_MEMPOOL", REG_A7XX_CP_BV_MEM_POOL_DBG_ADDR,
...@@ -517,9 +517,9 @@ static const struct a6xx_debugbus_block a650_debugbus_blocks[] = { ...@@ -517,9 +517,9 @@ static const struct a6xx_debugbus_block a650_debugbus_blocks[] = {
DEBUGBUS(A6XX_DBGBUS_SPTP_5, 0x100), DEBUGBUS(A6XX_DBGBUS_SPTP_5, 0x100),
}; };
static const struct a6xx_debugbus_block a7xx_gbif_debugbus_blocks[] = { static const u32 a7xx_gbif_debugbus_blocks[] = {
DEBUGBUS(A7XX_DBGBUS_GBIF_CX, 0x100), A7XX_DBGBUS_GBIF_CX,
DEBUGBUS(A7XX_DBGBUS_GBIF_GX, 0x100), A7XX_DBGBUS_GBIF_GX,
}; };
static const struct a6xx_debugbus_block a7xx_cx_debugbus_blocks[] = { static const struct a6xx_debugbus_block a7xx_cx_debugbus_blocks[] = {
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -320,7 +320,7 @@ static bool dpu_crtc_get_scanout_position(struct drm_crtc *crtc, ...@@ -320,7 +320,7 @@ static bool dpu_crtc_get_scanout_position(struct drm_crtc *crtc,
} }
static void _dpu_crtc_setup_blend_cfg(struct dpu_crtc_mixer *mixer, static void _dpu_crtc_setup_blend_cfg(struct dpu_crtc_mixer *mixer,
struct dpu_plane_state *pstate, struct dpu_format *format) struct dpu_plane_state *pstate, const struct msm_format *format)
{ {
struct dpu_hw_mixer *lm = mixer->hw_lm; struct dpu_hw_mixer *lm = mixer->hw_lm;
uint32_t blend_op; uint32_t blend_op;
...@@ -363,7 +363,7 @@ static void _dpu_crtc_setup_blend_cfg(struct dpu_crtc_mixer *mixer, ...@@ -363,7 +363,7 @@ static void _dpu_crtc_setup_blend_cfg(struct dpu_crtc_mixer *mixer,
fg_alpha, bg_alpha, blend_op); fg_alpha, bg_alpha, blend_op);
DRM_DEBUG_ATOMIC("format:%p4cc, alpha_en:%u blend_op:0x%x\n", DRM_DEBUG_ATOMIC("format:%p4cc, alpha_en:%u blend_op:0x%x\n",
&format->base.pixel_format, format->alpha_enable, blend_op); &format->pixel_format, format->alpha_enable, blend_op);
} }
static void _dpu_crtc_program_lm_output_roi(struct drm_crtc *crtc) static void _dpu_crtc_program_lm_output_roi(struct drm_crtc *crtc)
...@@ -395,7 +395,7 @@ static void _dpu_crtc_blend_setup_pipe(struct drm_crtc *crtc, ...@@ -395,7 +395,7 @@ static void _dpu_crtc_blend_setup_pipe(struct drm_crtc *crtc,
struct dpu_crtc_mixer *mixer, struct dpu_crtc_mixer *mixer,
u32 num_mixers, u32 num_mixers,
enum dpu_stage stage, enum dpu_stage stage,
struct dpu_format *format, const struct msm_format *format,
uint64_t modifier, uint64_t modifier,
struct dpu_sw_pipe *pipe, struct dpu_sw_pipe *pipe,
unsigned int stage_idx, unsigned int stage_idx,
...@@ -412,7 +412,7 @@ static void _dpu_crtc_blend_setup_pipe(struct drm_crtc *crtc, ...@@ -412,7 +412,7 @@ static void _dpu_crtc_blend_setup_pipe(struct drm_crtc *crtc,
trace_dpu_crtc_setup_mixer(DRMID(crtc), DRMID(plane), trace_dpu_crtc_setup_mixer(DRMID(crtc), DRMID(plane),
state, to_dpu_plane_state(state), stage_idx, state, to_dpu_plane_state(state), stage_idx,
format->base.pixel_format, format->pixel_format,
modifier); modifier);
DRM_DEBUG_ATOMIC("crtc %d stage:%d - plane %d sspp %d fb %d multirect_idx %d\n", DRM_DEBUG_ATOMIC("crtc %d stage:%d - plane %d sspp %d fb %d multirect_idx %d\n",
...@@ -440,7 +440,7 @@ static void _dpu_crtc_blend_setup_mixer(struct drm_crtc *crtc, ...@@ -440,7 +440,7 @@ static void _dpu_crtc_blend_setup_mixer(struct drm_crtc *crtc,
struct drm_plane_state *state; struct drm_plane_state *state;
struct dpu_crtc_state *cstate = to_dpu_crtc_state(crtc->state); struct dpu_crtc_state *cstate = to_dpu_crtc_state(crtc->state);
struct dpu_plane_state *pstate = NULL; struct dpu_plane_state *pstate = NULL;
struct dpu_format *format; const struct msm_format *format;
struct dpu_hw_ctl *ctl = mixer->lm_ctl; struct dpu_hw_ctl *ctl = mixer->lm_ctl;
uint32_t lm_idx; uint32_t lm_idx;
...@@ -459,7 +459,7 @@ static void _dpu_crtc_blend_setup_mixer(struct drm_crtc *crtc, ...@@ -459,7 +459,7 @@ static void _dpu_crtc_blend_setup_mixer(struct drm_crtc *crtc,
pstate = to_dpu_plane_state(state); pstate = to_dpu_plane_state(state);
fb = state->fb; fb = state->fb;
format = to_dpu_format(msm_framebuffer_format(pstate->base.fb)); format = msm_framebuffer_format(pstate->base.fb);
if (pstate->stage == DPU_STAGE_BASE && format->alpha_enable) if (pstate->stage == DPU_STAGE_BASE && format->alpha_enable)
bg_alpha_enable = true; bg_alpha_enable = true;
......
...@@ -675,7 +675,7 @@ static int dpu_encoder_virt_atomic_check( ...@@ -675,7 +675,7 @@ static int dpu_encoder_virt_atomic_check(
if (disp_info->intf_type == INTF_WB && conn_state->writeback_job) { if (disp_info->intf_type == INTF_WB && conn_state->writeback_job) {
fb = conn_state->writeback_job->fb; fb = conn_state->writeback_job->fb;
if (fb && DPU_FORMAT_IS_YUV(to_dpu_format(msm_framebuffer_format(fb)))) if (fb && MSM_FORMAT_IS_YUV(msm_framebuffer_format(fb)))
topology.needs_cdm = true; topology.needs_cdm = true;
} else if (disp_info->intf_type == INTF_DP) { } else if (disp_info->intf_type == INTF_DP) {
if (msm_dp_is_yuv_420_enabled(priv->dp[disp_info->h_tile_instance[0]], adj_mode)) if (msm_dp_is_yuv_420_enabled(priv->dp[disp_info->h_tile_instance[0]], adj_mode))
...@@ -2184,7 +2184,7 @@ void dpu_encoder_helper_phys_cleanup(struct dpu_encoder_phys *phys_enc) ...@@ -2184,7 +2184,7 @@ void dpu_encoder_helper_phys_cleanup(struct dpu_encoder_phys *phys_enc)
} }
void dpu_encoder_helper_phys_setup_cdm(struct dpu_encoder_phys *phys_enc, void dpu_encoder_helper_phys_setup_cdm(struct dpu_encoder_phys *phys_enc,
const struct dpu_format *dpu_fmt, const struct msm_format *dpu_fmt,
u32 output_type) u32 output_type)
{ {
struct dpu_hw_cdm *hw_cdm; struct dpu_hw_cdm *hw_cdm;
...@@ -2202,9 +2202,9 @@ void dpu_encoder_helper_phys_setup_cdm(struct dpu_encoder_phys *phys_enc, ...@@ -2202,9 +2202,9 @@ void dpu_encoder_helper_phys_setup_cdm(struct dpu_encoder_phys *phys_enc,
if (!hw_cdm) if (!hw_cdm)
return; return;
if (!DPU_FORMAT_IS_YUV(dpu_fmt)) { if (!MSM_FORMAT_IS_YUV(dpu_fmt)) {
DPU_DEBUG("[enc:%d] cdm_disable fmt:%x\n", DRMID(phys_enc->parent), DPU_DEBUG("[enc:%d] cdm_disable fmt:%p4cc\n", DRMID(phys_enc->parent),
dpu_fmt->base.pixel_format); &dpu_fmt->pixel_format);
if (hw_cdm->ops.bind_pingpong_blk) if (hw_cdm->ops.bind_pingpong_blk)
hw_cdm->ops.bind_pingpong_blk(hw_cdm, PINGPONG_NONE); hw_cdm->ops.bind_pingpong_blk(hw_cdm, PINGPONG_NONE);
...@@ -2217,25 +2217,25 @@ void dpu_encoder_helper_phys_setup_cdm(struct dpu_encoder_phys *phys_enc, ...@@ -2217,25 +2217,25 @@ void dpu_encoder_helper_phys_setup_cdm(struct dpu_encoder_phys *phys_enc,
cdm_cfg->output_height = phys_enc->cached_mode.vdisplay; cdm_cfg->output_height = phys_enc->cached_mode.vdisplay;
cdm_cfg->output_fmt = dpu_fmt; cdm_cfg->output_fmt = dpu_fmt;
cdm_cfg->output_type = output_type; cdm_cfg->output_type = output_type;
cdm_cfg->output_bit_depth = DPU_FORMAT_IS_DX(dpu_fmt) ? cdm_cfg->output_bit_depth = MSM_FORMAT_IS_DX(dpu_fmt) ?
CDM_CDWN_OUTPUT_10BIT : CDM_CDWN_OUTPUT_8BIT; CDM_CDWN_OUTPUT_10BIT : CDM_CDWN_OUTPUT_8BIT;
cdm_cfg->csc_cfg = &dpu_csc10_rgb2yuv_601l; cdm_cfg->csc_cfg = &dpu_csc10_rgb2yuv_601l;
/* enable 10 bit logic */ /* enable 10 bit logic */
switch (cdm_cfg->output_fmt->chroma_sample) { switch (cdm_cfg->output_fmt->chroma_sample) {
case DPU_CHROMA_RGB: case CHROMA_FULL:
cdm_cfg->h_cdwn_type = CDM_CDWN_DISABLE; cdm_cfg->h_cdwn_type = CDM_CDWN_DISABLE;
cdm_cfg->v_cdwn_type = CDM_CDWN_DISABLE; cdm_cfg->v_cdwn_type = CDM_CDWN_DISABLE;
break; break;
case DPU_CHROMA_H2V1: case CHROMA_H2V1:
cdm_cfg->h_cdwn_type = CDM_CDWN_COSITE; cdm_cfg->h_cdwn_type = CDM_CDWN_COSITE;
cdm_cfg->v_cdwn_type = CDM_CDWN_DISABLE; cdm_cfg->v_cdwn_type = CDM_CDWN_DISABLE;
break; break;
case DPU_CHROMA_420: case CHROMA_420:
cdm_cfg->h_cdwn_type = CDM_CDWN_COSITE; cdm_cfg->h_cdwn_type = CDM_CDWN_COSITE;
cdm_cfg->v_cdwn_type = CDM_CDWN_OFFSITE; cdm_cfg->v_cdwn_type = CDM_CDWN_OFFSITE;
break; break;
case DPU_CHROMA_H1V2: case CHROMA_H1V2:
default: default:
DPU_ERROR("[enc:%d] unsupported chroma sampling type\n", DPU_ERROR("[enc:%d] unsupported chroma sampling type\n",
DRMID(phys_enc->parent)); DRMID(phys_enc->parent));
...@@ -2244,9 +2244,9 @@ void dpu_encoder_helper_phys_setup_cdm(struct dpu_encoder_phys *phys_enc, ...@@ -2244,9 +2244,9 @@ void dpu_encoder_helper_phys_setup_cdm(struct dpu_encoder_phys *phys_enc,
break; break;
} }
DPU_DEBUG("[enc:%d] cdm_enable:%d,%d,%X,%d,%d,%d,%d]\n", DPU_DEBUG("[enc:%d] cdm_enable:%d,%d,%p4cc,%d,%d,%d,%d]\n",
DRMID(phys_enc->parent), cdm_cfg->output_width, DRMID(phys_enc->parent), cdm_cfg->output_width,
cdm_cfg->output_height, cdm_cfg->output_fmt->base.pixel_format, cdm_cfg->output_height, &cdm_cfg->output_fmt->pixel_format,
cdm_cfg->output_type, cdm_cfg->output_bit_depth, cdm_cfg->output_type, cdm_cfg->output_bit_depth,
cdm_cfg->h_cdwn_type, cdm_cfg->v_cdwn_type); cdm_cfg->h_cdwn_type, cdm_cfg->v_cdwn_type);
......
...@@ -393,7 +393,7 @@ void dpu_encoder_helper_phys_cleanup(struct dpu_encoder_phys *phys_enc); ...@@ -393,7 +393,7 @@ void dpu_encoder_helper_phys_cleanup(struct dpu_encoder_phys *phys_enc);
* @output_type: HDMI/WB * @output_type: HDMI/WB
*/ */
void dpu_encoder_helper_phys_setup_cdm(struct dpu_encoder_phys *phys_enc, void dpu_encoder_helper_phys_setup_cdm(struct dpu_encoder_phys *phys_enc,
const struct dpu_format *dpu_fmt, const struct msm_format *dpu_fmt,
u32 output_type); u32 output_type);
/** /**
......
...@@ -448,9 +448,6 @@ static void dpu_encoder_phys_cmd_enable_helper( ...@@ -448,9 +448,6 @@ static void dpu_encoder_phys_cmd_enable_helper(
_dpu_encoder_phys_cmd_pingpong_config(phys_enc); _dpu_encoder_phys_cmd_pingpong_config(phys_enc);
if (!dpu_encoder_phys_cmd_is_master(phys_enc))
return;
ctl = phys_enc->hw_ctl; ctl = phys_enc->hw_ctl;
ctl->ops.update_pending_flush_intf(ctl, phys_enc->hw_intf->idx); ctl->ops.update_pending_flush_intf(ctl, phys_enc->hw_intf->idx);
} }
......
...@@ -235,7 +235,7 @@ static void dpu_encoder_phys_vid_setup_timing_engine( ...@@ -235,7 +235,7 @@ static void dpu_encoder_phys_vid_setup_timing_engine(
{ {
struct drm_display_mode mode; struct drm_display_mode mode;
struct dpu_hw_intf_timing_params timing_params = { 0 }; struct dpu_hw_intf_timing_params timing_params = { 0 };
const struct dpu_format *fmt = NULL; const struct msm_format *fmt = NULL;
u32 fmt_fourcc; u32 fmt_fourcc;
unsigned long lock_flags; unsigned long lock_flags;
struct dpu_hw_intf_cfg intf_cfg = { 0 }; struct dpu_hw_intf_cfg intf_cfg = { 0 };
...@@ -274,7 +274,7 @@ static void dpu_encoder_phys_vid_setup_timing_engine( ...@@ -274,7 +274,7 @@ static void dpu_encoder_phys_vid_setup_timing_engine(
drm_mode_to_intf_timing_params(phys_enc, &mode, &timing_params); drm_mode_to_intf_timing_params(phys_enc, &mode, &timing_params);
fmt = dpu_get_dpu_format(fmt_fourcc); fmt = mdp_get_format(&phys_enc->dpu_kms->base, fmt_fourcc, 0);
DPU_DEBUG_VIDENC(phys_enc, "fmt_fourcc 0x%X\n", fmt_fourcc); DPU_DEBUG_VIDENC(phys_enc, "fmt_fourcc 0x%X\n", fmt_fourcc);
if (phys_enc->hw_cdm) if (phys_enc->hw_cdm)
...@@ -409,12 +409,12 @@ static int dpu_encoder_phys_vid_control_vblank_irq( ...@@ -409,12 +409,12 @@ static int dpu_encoder_phys_vid_control_vblank_irq(
static void dpu_encoder_phys_vid_enable(struct dpu_encoder_phys *phys_enc) static void dpu_encoder_phys_vid_enable(struct dpu_encoder_phys *phys_enc)
{ {
struct dpu_hw_ctl *ctl; struct dpu_hw_ctl *ctl;
const struct dpu_format *fmt; const struct msm_format *fmt;
u32 fmt_fourcc; u32 fmt_fourcc;
ctl = phys_enc->hw_ctl; ctl = phys_enc->hw_ctl;
fmt_fourcc = dpu_encoder_get_drm_fmt(phys_enc); fmt_fourcc = dpu_encoder_get_drm_fmt(phys_enc);
fmt = dpu_get_dpu_format(fmt_fourcc); fmt = mdp_get_format(&phys_enc->dpu_kms->base, fmt_fourcc, 0);
DPU_DEBUG_VIDENC(phys_enc, "\n"); DPU_DEBUG_VIDENC(phys_enc, "\n");
......
...@@ -322,11 +322,11 @@ static void dpu_encoder_phys_wb_setup( ...@@ -322,11 +322,11 @@ static void dpu_encoder_phys_wb_setup(
struct dpu_encoder_phys_wb *wb_enc = to_dpu_encoder_phys_wb(phys_enc); struct dpu_encoder_phys_wb *wb_enc = to_dpu_encoder_phys_wb(phys_enc);
struct drm_writeback_job *wb_job; struct drm_writeback_job *wb_job;
const struct msm_format *format; const struct msm_format *format;
const struct dpu_format *dpu_fmt; const struct msm_format *dpu_fmt;
wb_job = wb_enc->wb_job; wb_job = wb_enc->wb_job;
format = msm_framebuffer_format(wb_enc->wb_job->fb); format = msm_framebuffer_format(wb_enc->wb_job->fb);
dpu_fmt = dpu_get_dpu_format_ext(format->pixel_format, wb_job->fb->modifier); dpu_fmt = mdp_get_format(&phys_enc->dpu_kms->base, format->pixel_format, wb_job->fb->modifier);
DPU_DEBUG("[mode_set:%d, \"%s\",%d,%d]\n", DPU_DEBUG("[mode_set:%d, \"%s\",%d,%d]\n",
hw_wb->idx - WB_0, mode.name, hw_wb->idx - WB_0, mode.name,
...@@ -576,11 +576,11 @@ static void dpu_encoder_phys_wb_prepare_wb_job(struct dpu_encoder_phys *phys_enc ...@@ -576,11 +576,11 @@ static void dpu_encoder_phys_wb_prepare_wb_job(struct dpu_encoder_phys *phys_enc
format = msm_framebuffer_format(job->fb); format = msm_framebuffer_format(job->fb);
wb_cfg->dest.format = dpu_get_dpu_format_ext( wb_cfg->dest.format = mdp_get_format(&phys_enc->dpu_kms->base,
format->pixel_format, job->fb->modifier); format->pixel_format, job->fb->modifier);
if (!wb_cfg->dest.format) { if (!wb_cfg->dest.format) {
/* this error should be detected during atomic_check */ /* this error should be detected during atomic_check */
DPU_ERROR("failed to get format %x\n", format->pixel_format); DPU_ERROR("failed to get format %p4cc\n", &format->pixel_format);
return; return;
} }
...@@ -594,7 +594,7 @@ static void dpu_encoder_phys_wb_prepare_wb_job(struct dpu_encoder_phys *phys_enc ...@@ -594,7 +594,7 @@ static void dpu_encoder_phys_wb_prepare_wb_job(struct dpu_encoder_phys *phys_enc
wb_cfg->dest.height = job->fb->height; wb_cfg->dest.height = job->fb->height;
wb_cfg->dest.num_planes = wb_cfg->dest.format->num_planes; wb_cfg->dest.num_planes = wb_cfg->dest.format->num_planes;
if ((wb_cfg->dest.format->fetch_planes == DPU_PLANE_PLANAR) && if ((wb_cfg->dest.format->fetch_type == MDP_PLANE_PLANAR) &&
(wb_cfg->dest.format->element[0] == C1_B_Cb)) (wb_cfg->dest.format->element[0] == C1_B_Cb))
swap(wb_cfg->dest.plane_addr[1], wb_cfg->dest.plane_addr[2]); swap(wb_cfg->dest.plane_addr[1], wb_cfg->dest.plane_addr[2]);
......
This diff is collapsed.
...@@ -9,17 +9,6 @@ ...@@ -9,17 +9,6 @@
#include "msm_gem.h" #include "msm_gem.h"
#include "dpu_hw_mdss.h" #include "dpu_hw_mdss.h"
/**
* dpu_get_dpu_format_ext() - Returns dpu format structure pointer.
* @format: DRM FourCC Code
* @modifiers: format modifier array from client, one per plane
*/
const struct dpu_format *dpu_get_dpu_format_ext(
const uint32_t format,
const uint64_t modifier);
#define dpu_get_dpu_format(f) dpu_get_dpu_format_ext(f, 0)
/** /**
* dpu_find_format - validate if the pixel format is supported * dpu_find_format - validate if the pixel format is supported
* @format: dpu format * @format: dpu format
...@@ -42,23 +31,11 @@ static inline bool dpu_find_format(u32 format, const u32 *supported_formats, ...@@ -42,23 +31,11 @@ static inline bool dpu_find_format(u32 format, const u32 *supported_formats,
return false; return false;
} }
/**
* dpu_get_msm_format - get an dpu_format by its msm_format base
* callback function registers with the msm_kms layer
* @kms: kms driver
* @format: DRM FourCC Code
* @modifiers: data layout modifier
*/
const struct msm_format *dpu_get_msm_format(
struct msm_kms *kms,
const uint32_t format,
const uint64_t modifiers);
/** /**
* dpu_format_check_modified_format - validate format and buffers for * dpu_format_check_modified_format - validate format and buffers for
* dpu non-standard, i.e. modified format * dpu non-standard, i.e. modified format
* @kms: kms driver * @kms: kms driver
* @msm_fmt: pointer to the msm_fmt base pointer of an dpu_format * @msm_fmt: pointer to the msm_fmt base pointer of an msm_format
* @cmd: fb_cmd2 structure user request * @cmd: fb_cmd2 structure user request
* @bos: gem buffer object list * @bos: gem buffer object list
* *
......
...@@ -170,7 +170,7 @@ static int dpu_hw_cdm_setup_cdwn(struct dpu_hw_cdm *ctx, struct dpu_hw_cdm_cfg * ...@@ -170,7 +170,7 @@ static int dpu_hw_cdm_setup_cdwn(struct dpu_hw_cdm *ctx, struct dpu_hw_cdm_cfg *
static int dpu_hw_cdm_enable(struct dpu_hw_cdm *ctx, struct dpu_hw_cdm_cfg *cdm) static int dpu_hw_cdm_enable(struct dpu_hw_cdm *ctx, struct dpu_hw_cdm_cfg *cdm)
{ {
struct dpu_hw_blk_reg_map *c = &ctx->hw; struct dpu_hw_blk_reg_map *c = &ctx->hw;
const struct dpu_format *fmt; const struct msm_format *fmt;
u32 opmode = 0; u32 opmode = 0;
u32 csc = 0; u32 csc = 0;
...@@ -179,14 +179,14 @@ static int dpu_hw_cdm_enable(struct dpu_hw_cdm *ctx, struct dpu_hw_cdm_cfg *cdm) ...@@ -179,14 +179,14 @@ static int dpu_hw_cdm_enable(struct dpu_hw_cdm *ctx, struct dpu_hw_cdm_cfg *cdm)
fmt = cdm->output_fmt; fmt = cdm->output_fmt;
if (!DPU_FORMAT_IS_YUV(fmt)) if (!MSM_FORMAT_IS_YUV(fmt))
return -EINVAL; return -EINVAL;
dpu_hw_csc_setup(&ctx->hw, CDM_CSC_10_MATRIX_COEFF_0, cdm->csc_cfg, true); dpu_hw_csc_setup(&ctx->hw, CDM_CSC_10_MATRIX_COEFF_0, cdm->csc_cfg, true);
dpu_hw_cdm_setup_cdwn(ctx, cdm); dpu_hw_cdm_setup_cdwn(ctx, cdm);
if (cdm->output_type == CDM_CDWN_OUTPUT_HDMI) { if (cdm->output_type == CDM_CDWN_OUTPUT_HDMI) {
if (fmt->chroma_sample == DPU_CHROMA_H1V2) if (fmt->chroma_sample == CHROMA_H1V2)
return -EINVAL; /*unsupported format */ return -EINVAL; /*unsupported format */
opmode = CDM_HDMI_PACK_OP_MODE_EN; opmode = CDM_HDMI_PACK_OP_MODE_EN;
opmode |= (fmt->chroma_sample << 1); opmode |= (fmt->chroma_sample << 1);
......
...@@ -19,7 +19,7 @@ struct dpu_hw_cdm; ...@@ -19,7 +19,7 @@ struct dpu_hw_cdm;
* @output_bit_depth: output bit-depth of CDM block * @output_bit_depth: output bit-depth of CDM block
* @h_cdwn_type: downsample type used for horizontal pixels * @h_cdwn_type: downsample type used for horizontal pixels
* @v_cdwn_type: downsample type used for vertical pixels * @v_cdwn_type: downsample type used for vertical pixels
* @output_fmt: handle to dpu_format of CDM block * @output_fmt: handle to msm_format of CDM block
* @csc_cfg: handle to CSC matrix programmed for CDM block * @csc_cfg: handle to CSC matrix programmed for CDM block
* @output_type: interface to which CDM is paired (HDMI/WB) * @output_type: interface to which CDM is paired (HDMI/WB)
* @pp_id: ping-pong block to which CDM is bound to * @pp_id: ping-pong block to which CDM is bound to
...@@ -30,7 +30,7 @@ struct dpu_hw_cdm_cfg { ...@@ -30,7 +30,7 @@ struct dpu_hw_cdm_cfg {
u32 output_bit_depth; u32 output_bit_depth;
u32 h_cdwn_type; u32 h_cdwn_type;
u32 v_cdwn_type; u32 v_cdwn_type;
const struct dpu_format *output_fmt; const struct msm_format *output_fmt;
const struct dpu_csc_cfg *csc_cfg; const struct dpu_csc_cfg *csc_cfg;
u32 output_type; u32 output_type;
int pp_id; int pp_id;
......
...@@ -545,6 +545,7 @@ static void dpu_hw_ctl_intf_cfg_v1(struct dpu_hw_ctl *ctx, ...@@ -545,6 +545,7 @@ static void dpu_hw_ctl_intf_cfg_v1(struct dpu_hw_ctl *ctx,
{ {
struct dpu_hw_blk_reg_map *c = &ctx->hw; struct dpu_hw_blk_reg_map *c = &ctx->hw;
u32 intf_active = 0; u32 intf_active = 0;
u32 dsc_active = 0;
u32 wb_active = 0; u32 wb_active = 0;
u32 mode_sel = 0; u32 mode_sel = 0;
...@@ -560,6 +561,7 @@ static void dpu_hw_ctl_intf_cfg_v1(struct dpu_hw_ctl *ctx, ...@@ -560,6 +561,7 @@ static void dpu_hw_ctl_intf_cfg_v1(struct dpu_hw_ctl *ctx,
intf_active = DPU_REG_READ(c, CTL_INTF_ACTIVE); intf_active = DPU_REG_READ(c, CTL_INTF_ACTIVE);
wb_active = DPU_REG_READ(c, CTL_WB_ACTIVE); wb_active = DPU_REG_READ(c, CTL_WB_ACTIVE);
dsc_active = DPU_REG_READ(c, CTL_DSC_ACTIVE);
if (cfg->intf) if (cfg->intf)
intf_active |= BIT(cfg->intf - INTF_0); intf_active |= BIT(cfg->intf - INTF_0);
...@@ -567,17 +569,18 @@ static void dpu_hw_ctl_intf_cfg_v1(struct dpu_hw_ctl *ctx, ...@@ -567,17 +569,18 @@ static void dpu_hw_ctl_intf_cfg_v1(struct dpu_hw_ctl *ctx,
if (cfg->wb) if (cfg->wb)
wb_active |= BIT(cfg->wb - WB_0); wb_active |= BIT(cfg->wb - WB_0);
if (cfg->dsc)
dsc_active |= cfg->dsc;
DPU_REG_WRITE(c, CTL_TOP, mode_sel); DPU_REG_WRITE(c, CTL_TOP, mode_sel);
DPU_REG_WRITE(c, CTL_INTF_ACTIVE, intf_active); DPU_REG_WRITE(c, CTL_INTF_ACTIVE, intf_active);
DPU_REG_WRITE(c, CTL_WB_ACTIVE, wb_active); DPU_REG_WRITE(c, CTL_WB_ACTIVE, wb_active);
DPU_REG_WRITE(c, CTL_DSC_ACTIVE, dsc_active);
if (cfg->merge_3d) if (cfg->merge_3d)
DPU_REG_WRITE(c, CTL_MERGE_3D_ACTIVE, DPU_REG_WRITE(c, CTL_MERGE_3D_ACTIVE,
BIT(cfg->merge_3d - MERGE_3D_0)); BIT(cfg->merge_3d - MERGE_3D_0));
if (cfg->dsc)
DPU_REG_WRITE(c, CTL_DSC_ACTIVE, cfg->dsc);
if (cfg->cdm) if (cfg->cdm)
DPU_REG_WRITE(c, CTL_CDM_ACTIVE, cfg->cdm); DPU_REG_WRITE(c, CTL_CDM_ACTIVE, cfg->cdm);
} }
......
...@@ -223,9 +223,11 @@ static void dpu_core_irq_callback_handler(struct dpu_kms *dpu_kms, unsigned int ...@@ -223,9 +223,11 @@ static void dpu_core_irq_callback_handler(struct dpu_kms *dpu_kms, unsigned int
VERB("IRQ=[%d, %d]\n", DPU_IRQ_REG(irq_idx), DPU_IRQ_BIT(irq_idx)); VERB("IRQ=[%d, %d]\n", DPU_IRQ_REG(irq_idx), DPU_IRQ_BIT(irq_idx));
if (!irq_entry->cb) if (!irq_entry->cb) {
DRM_ERROR("no registered cb, IRQ=[%d, %d]\n", DRM_ERROR("no registered cb, IRQ=[%d, %d]\n",
DPU_IRQ_REG(irq_idx), DPU_IRQ_BIT(irq_idx)); DPU_IRQ_REG(irq_idx), DPU_IRQ_BIT(irq_idx));
return;
}
atomic_inc(&irq_entry->count); atomic_inc(&irq_entry->count);
......
...@@ -96,11 +96,11 @@ ...@@ -96,11 +96,11 @@
#define INTF_CFG2_DCE_DATA_COMPRESS BIT(12) #define INTF_CFG2_DCE_DATA_COMPRESS BIT(12)
static void dpu_hw_intf_setup_timing_engine(struct dpu_hw_intf *ctx, static void dpu_hw_intf_setup_timing_engine(struct dpu_hw_intf *intf,
const struct dpu_hw_intf_timing_params *p, const struct dpu_hw_intf_timing_params *p,
const struct dpu_format *fmt) const struct msm_format *fmt)
{ {
struct dpu_hw_blk_reg_map *c = &ctx->hw; struct dpu_hw_blk_reg_map *c = &intf->hw;
u32 hsync_period, vsync_period; u32 hsync_period, vsync_period;
u32 display_v_start, display_v_end; u32 display_v_start, display_v_end;
u32 hsync_start_x, hsync_end_x; u32 hsync_start_x, hsync_end_x;
...@@ -118,7 +118,7 @@ static void dpu_hw_intf_setup_timing_engine(struct dpu_hw_intf *ctx, ...@@ -118,7 +118,7 @@ static void dpu_hw_intf_setup_timing_engine(struct dpu_hw_intf *ctx,
/* read interface_cfg */ /* read interface_cfg */
intf_cfg = DPU_REG_READ(c, INTF_CONFIG); intf_cfg = DPU_REG_READ(c, INTF_CONFIG);
if (ctx->cap->type == INTF_DP) if (intf->cap->type == INTF_DP)
dp_intf = true; dp_intf = true;
hsync_period = p->hsync_pulse_width + p->h_back_porch + p->width + hsync_period = p->hsync_pulse_width + p->h_back_porch + p->width +
...@@ -194,16 +194,16 @@ static void dpu_hw_intf_setup_timing_engine(struct dpu_hw_intf *ctx, ...@@ -194,16 +194,16 @@ static void dpu_hw_intf_setup_timing_engine(struct dpu_hw_intf *ctx,
(p->vsync_polarity << 1) | /* VSYNC Polarity */ (p->vsync_polarity << 1) | /* VSYNC Polarity */
(p->hsync_polarity << 0); /* HSYNC Polarity */ (p->hsync_polarity << 0); /* HSYNC Polarity */
if (!DPU_FORMAT_IS_YUV(fmt)) if (!MSM_FORMAT_IS_YUV(fmt))
panel_format = (fmt->bits[C0_G_Y] | panel_format = (fmt->bpc_g_y |
(fmt->bits[C1_B_Cb] << 2) | (fmt->bpc_b_cb << 2) |
(fmt->bits[C2_R_Cr] << 4) | (fmt->bpc_r_cr << 4) |
(0x21 << 8)); (0x21 << 8));
else else
/* Interface treats all the pixel data in RGB888 format */ /* Interface treats all the pixel data in RGB888 format */
panel_format = (COLOR_8BIT | panel_format = (BPC8 |
(COLOR_8BIT << 2) | (BPC8 << 2) |
(COLOR_8BIT << 4) | (BPC8 << 4) |
(0x21 << 8)); (0x21 << 8));
DPU_REG_WRITE(c, INTF_HSYNC_CTL, hsync_ctl); DPU_REG_WRITE(c, INTF_HSYNC_CTL, hsync_ctl);
...@@ -223,7 +223,7 @@ static void dpu_hw_intf_setup_timing_engine(struct dpu_hw_intf *ctx, ...@@ -223,7 +223,7 @@ static void dpu_hw_intf_setup_timing_engine(struct dpu_hw_intf *ctx,
DPU_REG_WRITE(c, INTF_FRAME_LINE_COUNT_EN, 0x3); DPU_REG_WRITE(c, INTF_FRAME_LINE_COUNT_EN, 0x3);
DPU_REG_WRITE(c, INTF_CONFIG, intf_cfg); DPU_REG_WRITE(c, INTF_CONFIG, intf_cfg);
DPU_REG_WRITE(c, INTF_PANEL_FORMAT, panel_format); DPU_REG_WRITE(c, INTF_PANEL_FORMAT, panel_format);
if (ctx->cap->features & BIT(DPU_DATA_HCTL_EN)) { if (intf->cap->features & BIT(DPU_DATA_HCTL_EN)) {
/* /*
* DATA_HCTL_EN controls data timing which can be different from * DATA_HCTL_EN controls data timing which can be different from
* video timing. It is recommended to enable it for all cases, except * video timing. It is recommended to enable it for all cases, except
...@@ -518,10 +518,10 @@ static void dpu_hw_intf_disable_autorefresh(struct dpu_hw_intf *intf, ...@@ -518,10 +518,10 @@ static void dpu_hw_intf_disable_autorefresh(struct dpu_hw_intf *intf,
} }
static void dpu_hw_intf_program_intf_cmd_cfg(struct dpu_hw_intf *ctx, static void dpu_hw_intf_program_intf_cmd_cfg(struct dpu_hw_intf *intf,
struct dpu_hw_intf_cmd_mode_cfg *cmd_mode_cfg) struct dpu_hw_intf_cmd_mode_cfg *cmd_mode_cfg)
{ {
u32 intf_cfg2 = DPU_REG_READ(&ctx->hw, INTF_CONFIG2); u32 intf_cfg2 = DPU_REG_READ(&intf->hw, INTF_CONFIG2);
if (cmd_mode_cfg->data_compress) if (cmd_mode_cfg->data_compress)
intf_cfg2 |= INTF_CFG2_DCE_DATA_COMPRESS; intf_cfg2 |= INTF_CFG2_DCE_DATA_COMPRESS;
...@@ -529,7 +529,7 @@ static void dpu_hw_intf_program_intf_cmd_cfg(struct dpu_hw_intf *ctx, ...@@ -529,7 +529,7 @@ static void dpu_hw_intf_program_intf_cmd_cfg(struct dpu_hw_intf *ctx,
if (cmd_mode_cfg->wide_bus_en) if (cmd_mode_cfg->wide_bus_en)
intf_cfg2 |= INTF_CFG2_DATABUS_WIDEN; intf_cfg2 |= INTF_CFG2_DATABUS_WIDEN;
DPU_REG_WRITE(&ctx->hw, INTF_CONFIG2, intf_cfg2); DPU_REG_WRITE(&intf->hw, INTF_CONFIG2, intf_cfg2);
} }
struct dpu_hw_intf *dpu_hw_intf_init(struct drm_device *dev, struct dpu_hw_intf *dpu_hw_intf_init(struct drm_device *dev,
......
...@@ -81,7 +81,7 @@ struct dpu_hw_intf_cmd_mode_cfg { ...@@ -81,7 +81,7 @@ struct dpu_hw_intf_cmd_mode_cfg {
struct dpu_hw_intf_ops { struct dpu_hw_intf_ops {
void (*setup_timing_gen)(struct dpu_hw_intf *intf, void (*setup_timing_gen)(struct dpu_hw_intf *intf,
const struct dpu_hw_intf_timing_params *p, const struct dpu_hw_intf_timing_params *p,
const struct dpu_format *fmt); const struct msm_format *fmt);
void (*setup_prg_fetch)(struct dpu_hw_intf *intf, void (*setup_prg_fetch)(struct dpu_hw_intf *intf,
const struct dpu_hw_intf_prog_fetch *fetch); const struct dpu_hw_intf_prog_fetch *fetch);
......
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
#include "msm_drv.h" #include "msm_drv.h"
#include "disp/mdp_format.h"
#define DPU_DBG_NAME "dpu" #define DPU_DBG_NAME "dpu"
#define DPU_NONE 0 #define DPU_NONE 0
...@@ -35,28 +37,6 @@ ...@@ -35,28 +37,6 @@
#define DPU_MAX_DE_CURVES 3 #define DPU_MAX_DE_CURVES 3
#endif #endif
enum dpu_format_flags {
DPU_FORMAT_FLAG_YUV_BIT,
DPU_FORMAT_FLAG_DX_BIT,
DPU_FORMAT_FLAG_COMPRESSED_BIT,
DPU_FORMAT_FLAG_BIT_MAX,
};
#define DPU_FORMAT_FLAG_YUV BIT(DPU_FORMAT_FLAG_YUV_BIT)
#define DPU_FORMAT_FLAG_DX BIT(DPU_FORMAT_FLAG_DX_BIT)
#define DPU_FORMAT_FLAG_COMPRESSED BIT(DPU_FORMAT_FLAG_COMPRESSED_BIT)
#define DPU_FORMAT_IS_YUV(X) \
(test_bit(DPU_FORMAT_FLAG_YUV_BIT, (X)->flag))
#define DPU_FORMAT_IS_DX(X) \
(test_bit(DPU_FORMAT_FLAG_DX_BIT, (X)->flag))
#define DPU_FORMAT_IS_LINEAR(X) ((X)->fetch_mode == DPU_FETCH_LINEAR)
#define DPU_FORMAT_IS_TILE(X) \
(((X)->fetch_mode == DPU_FETCH_UBWC) && \
!test_bit(DPU_FORMAT_FLAG_COMPRESSED_BIT, (X)->flag))
#define DPU_FORMAT_IS_UBWC(X) \
(((X)->fetch_mode == DPU_FETCH_UBWC) && \
test_bit(DPU_FORMAT_FLAG_COMPRESSED_BIT, (X)->flag))
#define DPU_BLEND_FG_ALPHA_FG_CONST (0 << 0) #define DPU_BLEND_FG_ALPHA_FG_CONST (0 << 0)
#define DPU_BLEND_FG_ALPHA_BG_CONST (1 << 0) #define DPU_BLEND_FG_ALPHA_BG_CONST (1 << 0)
#define DPU_BLEND_FG_ALPHA_FG_PIXEL (2 << 0) #define DPU_BLEND_FG_ALPHA_FG_PIXEL (2 << 0)
...@@ -290,67 +270,6 @@ enum dpu_vbif { ...@@ -290,67 +270,6 @@ enum dpu_vbif {
VBIF_MAX, VBIF_MAX,
}; };
/**
* DPU HW,Component order color map
*/
enum {
C0_G_Y = 0,
C1_B_Cb = 1,
C2_R_Cr = 2,
C3_ALPHA = 3
};
/**
* enum dpu_plane_type - defines how the color component pixel packing
* @DPU_PLANE_INTERLEAVED : Color components in single plane
* @DPU_PLANE_PLANAR : Color component in separate planes
* @DPU_PLANE_PSEUDO_PLANAR : Chroma components interleaved in separate plane
*/
enum dpu_plane_type {
DPU_PLANE_INTERLEAVED,
DPU_PLANE_PLANAR,
DPU_PLANE_PSEUDO_PLANAR,
};
/**
* enum dpu_chroma_samp_type - chroma sub-samplng type
* @DPU_CHROMA_RGB : No chroma subsampling
* @DPU_CHROMA_H2V1 : Chroma pixels are horizontally subsampled
* @DPU_CHROMA_H1V2 : Chroma pixels are vertically subsampled
* @DPU_CHROMA_420 : 420 subsampling
*/
enum dpu_chroma_samp_type {
DPU_CHROMA_RGB,
DPU_CHROMA_H2V1,
DPU_CHROMA_H1V2,
DPU_CHROMA_420
};
/**
* dpu_fetch_type - Defines How DPU HW fetches data
* @DPU_FETCH_LINEAR : fetch is line by line
* @DPU_FETCH_TILE : fetches data in Z order from a tile
* @DPU_FETCH_UBWC : fetch and decompress data
*/
enum dpu_fetch_type {
DPU_FETCH_LINEAR,
DPU_FETCH_TILE,
DPU_FETCH_UBWC
};
/**
* Value of enum chosen to fit the number of bits
* expected by the HW programming.
*/
enum {
COLOR_ALPHA_1BIT = 0,
COLOR_ALPHA_4BIT = 1,
COLOR_4BIT = 0,
COLOR_5BIT = 1, /* No 5-bit Alpha */
COLOR_6BIT = 2, /* 6-Bit Alpha also = 2 */
COLOR_8BIT = 3, /* 8-Bit Alpha also = 3 */
};
/** /**
* enum dpu_3d_blend_mode * enum dpu_3d_blend_mode
* Desribes how the 3d data is blended * Desribes how the 3d data is blended
...@@ -370,43 +289,6 @@ enum dpu_3d_blend_mode { ...@@ -370,43 +289,6 @@ enum dpu_3d_blend_mode {
BLEND_3D_MAX BLEND_3D_MAX
}; };
/** struct dpu_format - defines the format configuration which
* allows DPU HW to correctly fetch and decode the format
* @base: base msm_format structure containing fourcc code
* @fetch_planes: how the color components are packed in pixel format
* @element: element color ordering
* @bits: element bit widths
* @chroma_sample: chroma sub-samplng type
* @unpack_align_msb: unpack aligned, 0 to LSB, 1 to MSB
* @unpack_tight: 0 for loose, 1 for tight
* @unpack_count: 0 = 1 component, 1 = 2 component
* @bpp: bytes per pixel
* @alpha_enable: whether the format has an alpha channel
* @num_planes: number of planes (including meta data planes)
* @fetch_mode: linear, tiled, or ubwc hw fetch behavior
* @flag: usage bit flags
* @tile_width: format tile width
* @tile_height: format tile height
*/
struct dpu_format {
struct msm_format base;
enum dpu_plane_type fetch_planes;
u8 element[DPU_MAX_PLANES];
u8 bits[DPU_MAX_PLANES];
enum dpu_chroma_samp_type chroma_sample;
u8 unpack_align_msb;
u8 unpack_tight;
u8 unpack_count;
u8 bpp;
u8 alpha_enable;
u8 num_planes;
enum dpu_fetch_type fetch_mode;
DECLARE_BITMAP(flag, DPU_FORMAT_FLAG_BIT_MAX);
u16 tile_width;
u16 tile_height;
};
#define to_dpu_format(x) container_of(x, struct dpu_format, base)
/** /**
* struct dpu_hw_fmt_layout - format information of the source pixel data * struct dpu_hw_fmt_layout - format information of the source pixel data
* @format: pixel format parameters * @format: pixel format parameters
...@@ -419,7 +301,7 @@ struct dpu_format { ...@@ -419,7 +301,7 @@ struct dpu_format {
* @plane_pitch: pitch of each plane * @plane_pitch: pitch of each plane
*/ */
struct dpu_hw_fmt_layout { struct dpu_hw_fmt_layout {
const struct dpu_format *format; const struct msm_format *format;
uint32_t num_planes; uint32_t num_planes;
uint32_t width; uint32_t width;
uint32_t height; uint32_t height;
......
...@@ -208,7 +208,7 @@ static void _sspp_setup_csc10_opmode(struct dpu_hw_sspp *ctx, ...@@ -208,7 +208,7 @@ static void _sspp_setup_csc10_opmode(struct dpu_hw_sspp *ctx,
* Setup source pixel format, flip, * Setup source pixel format, flip,
*/ */
static void dpu_hw_sspp_setup_format(struct dpu_sw_pipe *pipe, static void dpu_hw_sspp_setup_format(struct dpu_sw_pipe *pipe,
const struct dpu_format *fmt, u32 flags) const struct msm_format *fmt, u32 flags)
{ {
struct dpu_hw_sspp *ctx = pipe->sspp; struct dpu_hw_sspp *ctx = pipe->sspp;
struct dpu_hw_blk_reg_map *c; struct dpu_hw_blk_reg_map *c;
...@@ -243,20 +243,20 @@ static void dpu_hw_sspp_setup_format(struct dpu_sw_pipe *pipe, ...@@ -243,20 +243,20 @@ static void dpu_hw_sspp_setup_format(struct dpu_sw_pipe *pipe,
chroma_samp = fmt->chroma_sample; chroma_samp = fmt->chroma_sample;
if (flags & DPU_SSPP_SOURCE_ROTATED_90) { if (flags & DPU_SSPP_SOURCE_ROTATED_90) {
if (chroma_samp == DPU_CHROMA_H2V1) if (chroma_samp == CHROMA_H2V1)
chroma_samp = DPU_CHROMA_H1V2; chroma_samp = CHROMA_H1V2;
else if (chroma_samp == DPU_CHROMA_H1V2) else if (chroma_samp == CHROMA_H1V2)
chroma_samp = DPU_CHROMA_H2V1; chroma_samp = CHROMA_H2V1;
} }
src_format = (chroma_samp << 23) | (fmt->fetch_planes << 19) | src_format = (chroma_samp << 23) | (fmt->fetch_type << 19) |
(fmt->bits[C3_ALPHA] << 6) | (fmt->bits[C2_R_Cr] << 4) | (fmt->bpc_a << 6) | (fmt->bpc_r_cr << 4) |
(fmt->bits[C1_B_Cb] << 2) | (fmt->bits[C0_G_Y] << 0); (fmt->bpc_b_cb << 2) | (fmt->bpc_g_y << 0);
if (flags & DPU_SSPP_ROT_90) if (flags & DPU_SSPP_ROT_90)
src_format |= BIT(11); /* ROT90 */ src_format |= BIT(11); /* ROT90 */
if (fmt->alpha_enable && fmt->fetch_planes == DPU_PLANE_INTERLEAVED) if (fmt->alpha_enable && fmt->fetch_type == MDP_PLANE_INTERLEAVED)
src_format |= BIT(8); /* SRCC3_EN */ src_format |= BIT(8); /* SRCC3_EN */
if (flags & DPU_SSPP_SOLID_FILL) if (flags & DPU_SSPP_SOLID_FILL)
...@@ -265,12 +265,12 @@ static void dpu_hw_sspp_setup_format(struct dpu_sw_pipe *pipe, ...@@ -265,12 +265,12 @@ static void dpu_hw_sspp_setup_format(struct dpu_sw_pipe *pipe,
unpack = (fmt->element[3] << 24) | (fmt->element[2] << 16) | unpack = (fmt->element[3] << 24) | (fmt->element[2] << 16) |
(fmt->element[1] << 8) | (fmt->element[0] << 0); (fmt->element[1] << 8) | (fmt->element[0] << 0);
src_format |= ((fmt->unpack_count - 1) << 12) | src_format |= ((fmt->unpack_count - 1) << 12) |
(fmt->unpack_tight << 17) | ((fmt->flags & MSM_FORMAT_FLAG_UNPACK_TIGHT ? 1 : 0) << 17) |
(fmt->unpack_align_msb << 18) | ((fmt->flags & MSM_FORMAT_FLAG_UNPACK_ALIGN_MSB ? 1 : 0) << 18) |
((fmt->bpp - 1) << 9); ((fmt->bpp - 1) << 9);
if (fmt->fetch_mode != DPU_FETCH_LINEAR) { if (fmt->fetch_mode != MDP_FETCH_LINEAR) {
if (DPU_FORMAT_IS_UBWC(fmt)) if (MSM_FORMAT_IS_UBWC(fmt))
opmode |= MDSS_MDP_OP_BWC_EN; opmode |= MDSS_MDP_OP_BWC_EN;
src_format |= (fmt->fetch_mode & 3) << 30; /*FRAME_FORMAT */ src_format |= (fmt->fetch_mode & 3) << 30; /*FRAME_FORMAT */
DPU_REG_WRITE(c, SSPP_FETCH_CONFIG, DPU_REG_WRITE(c, SSPP_FETCH_CONFIG,
...@@ -297,7 +297,7 @@ static void dpu_hw_sspp_setup_format(struct dpu_sw_pipe *pipe, ...@@ -297,7 +297,7 @@ static void dpu_hw_sspp_setup_format(struct dpu_sw_pipe *pipe,
break; break;
case UBWC_4_0: case UBWC_4_0:
DPU_REG_WRITE(c, SSPP_UBWC_STATIC_CTRL, DPU_REG_WRITE(c, SSPP_UBWC_STATIC_CTRL,
DPU_FORMAT_IS_YUV(fmt) ? 0 : BIT(30)); MSM_FORMAT_IS_YUV(fmt) ? 0 : BIT(30));
break; break;
} }
} }
...@@ -305,20 +305,20 @@ static void dpu_hw_sspp_setup_format(struct dpu_sw_pipe *pipe, ...@@ -305,20 +305,20 @@ static void dpu_hw_sspp_setup_format(struct dpu_sw_pipe *pipe,
opmode |= MDSS_MDP_OP_PE_OVERRIDE; opmode |= MDSS_MDP_OP_PE_OVERRIDE;
/* if this is YUV pixel format, enable CSC */ /* if this is YUV pixel format, enable CSC */
if (DPU_FORMAT_IS_YUV(fmt)) if (MSM_FORMAT_IS_YUV(fmt))
src_format |= BIT(15); src_format |= BIT(15);
if (DPU_FORMAT_IS_DX(fmt)) if (MSM_FORMAT_IS_DX(fmt))
src_format |= BIT(14); src_format |= BIT(14);
/* update scaler opmode, if appropriate */ /* update scaler opmode, if appropriate */
if (test_bit(DPU_SSPP_CSC, &ctx->cap->features)) if (test_bit(DPU_SSPP_CSC, &ctx->cap->features))
_sspp_setup_opmode(ctx, VIG_OP_CSC_EN | VIG_OP_CSC_SRC_DATAFMT, _sspp_setup_opmode(ctx, VIG_OP_CSC_EN | VIG_OP_CSC_SRC_DATAFMT,
DPU_FORMAT_IS_YUV(fmt)); MSM_FORMAT_IS_YUV(fmt));
else if (test_bit(DPU_SSPP_CSC_10BIT, &ctx->cap->features)) else if (test_bit(DPU_SSPP_CSC_10BIT, &ctx->cap->features))
_sspp_setup_csc10_opmode(ctx, _sspp_setup_csc10_opmode(ctx,
VIG_CSC_10_EN | VIG_CSC_10_SRC_DATAFMT, VIG_CSC_10_EN | VIG_CSC_10_SRC_DATAFMT,
DPU_FORMAT_IS_YUV(fmt)); MSM_FORMAT_IS_YUV(fmt));
DPU_REG_WRITE(c, format_off, src_format); DPU_REG_WRITE(c, format_off, src_format);
DPU_REG_WRITE(c, unpack_pat_off, unpack); DPU_REG_WRITE(c, unpack_pat_off, unpack);
...@@ -387,7 +387,7 @@ static void dpu_hw_sspp_setup_pe_config(struct dpu_hw_sspp *ctx, ...@@ -387,7 +387,7 @@ static void dpu_hw_sspp_setup_pe_config(struct dpu_hw_sspp *ctx,
static void _dpu_hw_sspp_setup_scaler3(struct dpu_hw_sspp *ctx, static void _dpu_hw_sspp_setup_scaler3(struct dpu_hw_sspp *ctx,
struct dpu_hw_scaler3_cfg *scaler3_cfg, struct dpu_hw_scaler3_cfg *scaler3_cfg,
const struct dpu_format *format) const struct msm_format *format)
{ {
if (!ctx || !scaler3_cfg) if (!ctx || !scaler3_cfg)
return; return;
...@@ -558,7 +558,7 @@ static void dpu_hw_sspp_setup_qos_ctrl(struct dpu_hw_sspp *ctx, ...@@ -558,7 +558,7 @@ static void dpu_hw_sspp_setup_qos_ctrl(struct dpu_hw_sspp *ctx,
} }
static void dpu_hw_sspp_setup_cdp(struct dpu_sw_pipe *pipe, static void dpu_hw_sspp_setup_cdp(struct dpu_sw_pipe *pipe,
const struct dpu_format *fmt, const struct msm_format *fmt,
bool enable) bool enable)
{ {
struct dpu_hw_sspp *ctx = pipe->sspp; struct dpu_hw_sspp *ctx = pipe->sspp;
......
...@@ -183,7 +183,7 @@ struct dpu_hw_sspp_ops { ...@@ -183,7 +183,7 @@ struct dpu_hw_sspp_ops {
* @flags: Extra flags for format config * @flags: Extra flags for format config
*/ */
void (*setup_format)(struct dpu_sw_pipe *pipe, void (*setup_format)(struct dpu_sw_pipe *pipe,
const struct dpu_format *fmt, u32 flags); const struct msm_format *fmt, u32 flags);
/** /**
* setup_rects - setup pipe ROI rectangles * setup_rects - setup pipe ROI rectangles
...@@ -279,7 +279,7 @@ struct dpu_hw_sspp_ops { ...@@ -279,7 +279,7 @@ struct dpu_hw_sspp_ops {
*/ */
void (*setup_scaler)(struct dpu_hw_sspp *ctx, void (*setup_scaler)(struct dpu_hw_sspp *ctx,
struct dpu_hw_scaler3_cfg *scaler3_cfg, struct dpu_hw_scaler3_cfg *scaler3_cfg,
const struct dpu_format *format); const struct msm_format *format);
/** /**
* setup_cdp - setup client driven prefetch * setup_cdp - setup client driven prefetch
...@@ -288,7 +288,7 @@ struct dpu_hw_sspp_ops { ...@@ -288,7 +288,7 @@ struct dpu_hw_sspp_ops {
* @enable: whether the CDP should be enabled for this pipe * @enable: whether the CDP should be enabled for this pipe
*/ */
void (*setup_cdp)(struct dpu_sw_pipe *pipe, void (*setup_cdp)(struct dpu_sw_pipe *pipe,
const struct dpu_format *fmt, const struct msm_format *fmt,
bool enable); bool enable);
}; };
......
...@@ -282,7 +282,7 @@ static void _dpu_hw_setup_scaler3_de(struct dpu_hw_blk_reg_map *c, ...@@ -282,7 +282,7 @@ static void _dpu_hw_setup_scaler3_de(struct dpu_hw_blk_reg_map *c,
void dpu_hw_setup_scaler3(struct dpu_hw_blk_reg_map *c, void dpu_hw_setup_scaler3(struct dpu_hw_blk_reg_map *c,
struct dpu_hw_scaler3_cfg *scaler3_cfg, struct dpu_hw_scaler3_cfg *scaler3_cfg,
u32 scaler_offset, u32 scaler_version, u32 scaler_offset, u32 scaler_version,
const struct dpu_format *format) const struct msm_format *format)
{ {
u32 op_mode = 0; u32 op_mode = 0;
u32 phase_init, preload, src_y_rgb, src_uv, dst; u32 phase_init, preload, src_y_rgb, src_uv, dst;
...@@ -293,7 +293,7 @@ void dpu_hw_setup_scaler3(struct dpu_hw_blk_reg_map *c, ...@@ -293,7 +293,7 @@ void dpu_hw_setup_scaler3(struct dpu_hw_blk_reg_map *c,
op_mode |= BIT(0); op_mode |= BIT(0);
op_mode |= (scaler3_cfg->y_rgb_filter_cfg & 0x3) << 16; op_mode |= (scaler3_cfg->y_rgb_filter_cfg & 0x3) << 16;
if (format && DPU_FORMAT_IS_YUV(format)) { if (format && MSM_FORMAT_IS_YUV(format)) {
op_mode |= BIT(12); op_mode |= BIT(12);
op_mode |= (scaler3_cfg->uv_filter_cfg & 0x3) << 24; op_mode |= (scaler3_cfg->uv_filter_cfg & 0x3) << 24;
} }
...@@ -367,7 +367,7 @@ void dpu_hw_setup_scaler3(struct dpu_hw_blk_reg_map *c, ...@@ -367,7 +367,7 @@ void dpu_hw_setup_scaler3(struct dpu_hw_blk_reg_map *c,
DPU_REG_WRITE(c, QSEED3_DST_SIZE + scaler_offset, dst); DPU_REG_WRITE(c, QSEED3_DST_SIZE + scaler_offset, dst);
end: end:
if (format && !DPU_FORMAT_IS_DX(format)) if (format && !MSM_FORMAT_IS_DX(format))
op_mode |= BIT(14); op_mode |= BIT(14);
if (format && format->alpha_enable) { if (format && format->alpha_enable) {
...@@ -522,16 +522,16 @@ int dpu_hw_collect_misr(struct dpu_hw_blk_reg_map *c, ...@@ -522,16 +522,16 @@ int dpu_hw_collect_misr(struct dpu_hw_blk_reg_map *c,
#define CDP_PRELOAD_AHEAD_64 BIT(3) #define CDP_PRELOAD_AHEAD_64 BIT(3)
void dpu_setup_cdp(struct dpu_hw_blk_reg_map *c, u32 offset, void dpu_setup_cdp(struct dpu_hw_blk_reg_map *c, u32 offset,
const struct dpu_format *fmt, bool enable) const struct msm_format *fmt, bool enable)
{ {
u32 cdp_cntl = CDP_PRELOAD_AHEAD_64; u32 cdp_cntl = CDP_PRELOAD_AHEAD_64;
if (enable) if (enable)
cdp_cntl |= CDP_ENABLE; cdp_cntl |= CDP_ENABLE;
if (DPU_FORMAT_IS_UBWC(fmt)) if (MSM_FORMAT_IS_UBWC(fmt))
cdp_cntl |= CDP_UBWC_META_ENABLE; cdp_cntl |= CDP_UBWC_META_ENABLE;
if (DPU_FORMAT_IS_UBWC(fmt) || if (MSM_FORMAT_IS_UBWC(fmt) ||
DPU_FORMAT_IS_TILE(fmt)) MSM_FORMAT_IS_TILE(fmt))
cdp_cntl |= CDP_TILE_AMORTIZE_ENABLE; cdp_cntl |= CDP_TILE_AMORTIZE_ENABLE;
DPU_REG_WRITE(c, offset, cdp_cntl); DPU_REG_WRITE(c, offset, cdp_cntl);
......
...@@ -344,14 +344,14 @@ void *dpu_hw_util_get_dir(void); ...@@ -344,14 +344,14 @@ void *dpu_hw_util_get_dir(void);
void dpu_hw_setup_scaler3(struct dpu_hw_blk_reg_map *c, void dpu_hw_setup_scaler3(struct dpu_hw_blk_reg_map *c,
struct dpu_hw_scaler3_cfg *scaler3_cfg, struct dpu_hw_scaler3_cfg *scaler3_cfg,
u32 scaler_offset, u32 scaler_version, u32 scaler_offset, u32 scaler_version,
const struct dpu_format *format); const struct msm_format *format);
void dpu_hw_csc_setup(struct dpu_hw_blk_reg_map *c, void dpu_hw_csc_setup(struct dpu_hw_blk_reg_map *c,
u32 csc_reg_off, u32 csc_reg_off,
const struct dpu_csc_cfg *data, bool csc10); const struct dpu_csc_cfg *data, bool csc10);
void dpu_setup_cdp(struct dpu_hw_blk_reg_map *c, u32 offset, void dpu_setup_cdp(struct dpu_hw_blk_reg_map *c, u32 offset,
const struct dpu_format *fmt, bool enable); const struct msm_format *fmt, bool enable);
u64 _dpu_hw_get_qos_lut(const struct dpu_qos_lut_tbl *tbl, u64 _dpu_hw_get_qos_lut(const struct dpu_qos_lut_tbl *tbl,
u32 total_fl); u32 total_fl);
......
...@@ -67,7 +67,7 @@ static void dpu_hw_wb_setup_format(struct dpu_hw_wb *ctx, ...@@ -67,7 +67,7 @@ static void dpu_hw_wb_setup_format(struct dpu_hw_wb *ctx,
struct dpu_hw_wb_cfg *data) struct dpu_hw_wb_cfg *data)
{ {
struct dpu_hw_blk_reg_map *c = &ctx->hw; struct dpu_hw_blk_reg_map *c = &ctx->hw;
const struct dpu_format *fmt = data->dest.format; const struct msm_format *fmt = data->dest.format;
u32 dst_format, pattern, ystride0, ystride1, outsize, chroma_samp; u32 dst_format, pattern, ystride0, ystride1, outsize, chroma_samp;
u32 write_config = 0; u32 write_config = 0;
u32 opmode = 0; u32 opmode = 0;
...@@ -76,20 +76,20 @@ static void dpu_hw_wb_setup_format(struct dpu_hw_wb *ctx, ...@@ -76,20 +76,20 @@ static void dpu_hw_wb_setup_format(struct dpu_hw_wb *ctx,
chroma_samp = fmt->chroma_sample; chroma_samp = fmt->chroma_sample;
dst_format = (chroma_samp << 23) | dst_format = (chroma_samp << 23) |
(fmt->fetch_planes << 19) | (fmt->fetch_type << 19) |
(fmt->bits[C3_ALPHA] << 6) | (fmt->bpc_a << 6) |
(fmt->bits[C2_R_Cr] << 4) | (fmt->bpc_r_cr << 4) |
(fmt->bits[C1_B_Cb] << 2) | (fmt->bpc_b_cb << 2) |
(fmt->bits[C0_G_Y] << 0); (fmt->bpc_g_y << 0);
if (fmt->bits[C3_ALPHA] || fmt->alpha_enable) { if (fmt->bpc_a || fmt->alpha_enable) {
dst_format |= BIT(8); /* DSTC3_EN */ dst_format |= BIT(8); /* DSTC3_EN */
if (!fmt->alpha_enable || if (!fmt->alpha_enable ||
!(ctx->caps->features & BIT(DPU_WB_PIPE_ALPHA))) !(ctx->caps->features & BIT(DPU_WB_PIPE_ALPHA)))
dst_format |= BIT(14); /* DST_ALPHA_X */ dst_format |= BIT(14); /* DST_ALPHA_X */
} }
if (DPU_FORMAT_IS_YUV(fmt)) if (MSM_FORMAT_IS_YUV(fmt))
dst_format |= BIT(15); dst_format |= BIT(15);
pattern = (fmt->element[3] << 24) | pattern = (fmt->element[3] << 24) |
...@@ -97,8 +97,8 @@ static void dpu_hw_wb_setup_format(struct dpu_hw_wb *ctx, ...@@ -97,8 +97,8 @@ static void dpu_hw_wb_setup_format(struct dpu_hw_wb *ctx,
(fmt->element[1] << 8) | (fmt->element[1] << 8) |
(fmt->element[0] << 0); (fmt->element[0] << 0);
dst_format |= (fmt->unpack_align_msb << 18) | dst_format |= ((fmt->flags & MSM_FORMAT_FLAG_UNPACK_ALIGN_MSB ? 1 : 0) << 18) |
(fmt->unpack_tight << 17) | ((fmt->flags & MSM_FORMAT_FLAG_UNPACK_TIGHT ? 1 : 0) << 17) |
((fmt->unpack_count - 1) << 12) | ((fmt->unpack_count - 1) << 12) |
((fmt->bpp - 1) << 9); ((fmt->bpp - 1) << 9);
...@@ -149,7 +149,7 @@ static void dpu_hw_wb_setup_qos_lut(struct dpu_hw_wb *ctx, ...@@ -149,7 +149,7 @@ static void dpu_hw_wb_setup_qos_lut(struct dpu_hw_wb *ctx,
} }
static void dpu_hw_wb_setup_cdp(struct dpu_hw_wb *ctx, static void dpu_hw_wb_setup_cdp(struct dpu_hw_wb *ctx,
const struct dpu_format *fmt, const struct msm_format *fmt,
bool enable) bool enable)
{ {
if (!ctx) if (!ctx)
......
...@@ -46,7 +46,7 @@ struct dpu_hw_wb_ops { ...@@ -46,7 +46,7 @@ struct dpu_hw_wb_ops {
struct dpu_hw_qos_cfg *cfg); struct dpu_hw_qos_cfg *cfg);
void (*setup_cdp)(struct dpu_hw_wb *ctx, void (*setup_cdp)(struct dpu_hw_wb *ctx,
const struct dpu_format *fmt, const struct msm_format *fmt,
bool enable); bool enable);
bool (*setup_clk_force_ctrl)(struct dpu_hw_wb *ctx, bool (*setup_clk_force_ctrl)(struct dpu_hw_wb *ctx,
......
...@@ -348,9 +348,18 @@ static void dpu_kms_global_destroy_state(struct drm_private_obj *obj, ...@@ -348,9 +348,18 @@ static void dpu_kms_global_destroy_state(struct drm_private_obj *obj,
kfree(dpu_state); kfree(dpu_state);
} }
static void dpu_kms_global_print_state(struct drm_printer *p,
const struct drm_private_state *state)
{
const struct dpu_global_state *global_state = to_dpu_global_state(state);
dpu_rm_print_state(p, global_state);
}
static const struct drm_private_state_funcs dpu_kms_global_state_funcs = { static const struct drm_private_state_funcs dpu_kms_global_state_funcs = {
.atomic_duplicate_state = dpu_kms_global_duplicate_state, .atomic_duplicate_state = dpu_kms_global_duplicate_state,
.atomic_destroy_state = dpu_kms_global_destroy_state, .atomic_destroy_state = dpu_kms_global_destroy_state,
.atomic_print_state = dpu_kms_global_print_state,
}; };
static int dpu_kms_global_obj_init(struct dpu_kms *dpu_kms) static int dpu_kms_global_obj_init(struct dpu_kms *dpu_kms)
...@@ -364,6 +373,9 @@ static int dpu_kms_global_obj_init(struct dpu_kms *dpu_kms) ...@@ -364,6 +373,9 @@ static int dpu_kms_global_obj_init(struct dpu_kms *dpu_kms)
drm_atomic_private_obj_init(dpu_kms->dev, &dpu_kms->global_state, drm_atomic_private_obj_init(dpu_kms->dev, &dpu_kms->global_state,
&state->base, &state->base,
&dpu_kms_global_state_funcs); &dpu_kms_global_state_funcs);
state->rm = &dpu_kms->rm;
return 0; return 0;
} }
...@@ -970,7 +982,6 @@ static const struct msm_kms_funcs kms_funcs = { ...@@ -970,7 +982,6 @@ static const struct msm_kms_funcs kms_funcs = {
.enable_vblank = dpu_kms_enable_vblank, .enable_vblank = dpu_kms_enable_vblank,
.disable_vblank = dpu_kms_disable_vblank, .disable_vblank = dpu_kms_disable_vblank,
.check_modified_format = dpu_format_check_modified_format, .check_modified_format = dpu_format_check_modified_format,
.get_format = dpu_get_msm_format,
.destroy = dpu_kms_destroy, .destroy = dpu_kms_destroy,
.snapshot = dpu_kms_mdp_snapshot, .snapshot = dpu_kms_mdp_snapshot,
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS
......
...@@ -130,6 +130,8 @@ struct vsync_info { ...@@ -130,6 +130,8 @@ struct vsync_info {
struct dpu_global_state { struct dpu_global_state {
struct drm_private_state base; struct drm_private_state base;
struct dpu_rm *rm;
uint32_t pingpong_to_enc_id[PINGPONG_MAX - PINGPONG_0]; uint32_t pingpong_to_enc_id[PINGPONG_MAX - PINGPONG_0];
uint32_t mixer_to_enc_id[LM_MAX - LM_0]; uint32_t mixer_to_enc_id[LM_MAX - LM_0];
uint32_t ctl_to_enc_id[CTL_MAX - CTL_0]; uint32_t ctl_to_enc_id[CTL_MAX - CTL_0];
......
This diff is collapsed.
...@@ -758,3 +758,59 @@ int dpu_rm_get_assigned_resources(struct dpu_rm *rm, ...@@ -758,3 +758,59 @@ int dpu_rm_get_assigned_resources(struct dpu_rm *rm,
return num_blks; return num_blks;
} }
static void dpu_rm_print_state_helper(struct drm_printer *p,
struct dpu_hw_blk *blk,
uint32_t mapping)
{
if (!blk)
drm_puts(p, "- ");
else if (!mapping)
drm_puts(p, "# ");
else
drm_printf(p, "%d ", mapping);
}
void dpu_rm_print_state(struct drm_printer *p,
const struct dpu_global_state *global_state)
{
const struct dpu_rm *rm = global_state->rm;
int i;
drm_puts(p, "resource mapping:\n");
drm_puts(p, "\tpingpong=");
for (i = 0; i < ARRAY_SIZE(global_state->pingpong_to_enc_id); i++)
dpu_rm_print_state_helper(p, rm->pingpong_blks[i],
global_state->pingpong_to_enc_id[i]);
drm_puts(p, "\n");
drm_puts(p, "\tmixer=");
for (i = 0; i < ARRAY_SIZE(global_state->mixer_to_enc_id); i++)
dpu_rm_print_state_helper(p, rm->mixer_blks[i],
global_state->mixer_to_enc_id[i]);
drm_puts(p, "\n");
drm_puts(p, "\tctl=");
for (i = 0; i < ARRAY_SIZE(global_state->ctl_to_enc_id); i++)
dpu_rm_print_state_helper(p, rm->ctl_blks[i],
global_state->ctl_to_enc_id[i]);
drm_puts(p, "\n");
drm_puts(p, "\tdspp=");
for (i = 0; i < ARRAY_SIZE(global_state->dspp_to_enc_id); i++)
dpu_rm_print_state_helper(p, rm->dspp_blks[i],
global_state->dspp_to_enc_id[i]);
drm_puts(p, "\n");
drm_puts(p, "\tdsc=");
for (i = 0; i < ARRAY_SIZE(global_state->dsc_to_enc_id); i++)
dpu_rm_print_state_helper(p, rm->dsc_blks[i],
global_state->dsc_to_enc_id[i]);
drm_puts(p, "\n");
drm_puts(p, "\tcdm=");
dpu_rm_print_state_helper(p, rm->cdm_blk,
global_state->cdm_to_enc_id);
drm_puts(p, "\n");
}
...@@ -89,6 +89,14 @@ int dpu_rm_get_assigned_resources(struct dpu_rm *rm, ...@@ -89,6 +89,14 @@ int dpu_rm_get_assigned_resources(struct dpu_rm *rm,
struct dpu_global_state *global_state, uint32_t enc_id, struct dpu_global_state *global_state, uint32_t enc_id,
enum dpu_hw_blk_type type, struct dpu_hw_blk **blks, int blks_size); enum dpu_hw_blk_type type, struct dpu_hw_blk **blks, int blks_size);
/**
* dpu_rm_print_state - output the RM private state
* @p: DRM printer
* @global_state: global state
*/
void dpu_rm_print_state(struct drm_printer *p,
const struct dpu_global_state *global_state);
/** /**
* dpu_rm_get_intf - Return a struct dpu_hw_intf instance given it's index. * dpu_rm_get_intf - Return a struct dpu_hw_intf instance given it's index.
* @rm: DPU Resource Manager handle * @rm: DPU Resource Manager handle
......
This diff is collapsed.
...@@ -182,8 +182,8 @@ static void blend_setup(struct drm_crtc *crtc) ...@@ -182,8 +182,8 @@ static void blend_setup(struct drm_crtc *crtc)
enum mdp4_pipe pipe_id = mdp4_plane_pipe(plane); enum mdp4_pipe pipe_id = mdp4_plane_pipe(plane);
int idx = idxs[pipe_id]; int idx = idxs[pipe_id];
if (idx > 0) { if (idx > 0) {
const struct mdp_format *format = const struct msm_format *format =
to_mdp_format(msm_framebuffer_format(plane->state->fb)); msm_framebuffer_format(plane->state->fb);
alpha[idx-1] = format->alpha_enable; alpha[idx-1] = format->alpha_enable;
} }
} }
......
...@@ -151,7 +151,6 @@ static const struct mdp_kms_funcs kms_funcs = { ...@@ -151,7 +151,6 @@ static const struct mdp_kms_funcs kms_funcs = {
.flush_commit = mdp4_flush_commit, .flush_commit = mdp4_flush_commit,
.wait_flush = mdp4_wait_flush, .wait_flush = mdp4_wait_flush,
.complete_commit = mdp4_complete_commit, .complete_commit = mdp4_complete_commit,
.get_format = mdp_get_format,
.round_pixclk = mdp4_round_pixclk, .round_pixclk = mdp4_round_pixclk,
.destroy = mdp4_destroy, .destroy = mdp4_destroy,
}, },
......
...@@ -44,12 +44,12 @@ struct mdp4_kms { ...@@ -44,12 +44,12 @@ struct mdp4_kms {
static inline void mdp4_write(struct mdp4_kms *mdp4_kms, u32 reg, u32 data) static inline void mdp4_write(struct mdp4_kms *mdp4_kms, u32 reg, u32 data)
{ {
msm_writel(data, mdp4_kms->mmio + reg); writel(data, mdp4_kms->mmio + reg);
} }
static inline u32 mdp4_read(struct mdp4_kms *mdp4_kms, u32 reg) static inline u32 mdp4_read(struct mdp4_kms *mdp4_kms, u32 reg)
{ {
return msm_readl(mdp4_kms->mmio + reg); return readl(mdp4_kms->mmio + reg);
} }
static inline uint32_t pipe2flush(enum mdp4_pipe pipe) static inline uint32_t pipe2flush(enum mdp4_pipe pipe)
......
This diff is collapsed.
This diff is collapsed.
...@@ -69,6 +69,16 @@ struct mdp5_mdp_block { ...@@ -69,6 +69,16 @@ struct mdp5_mdp_block {
uint32_t caps; /* MDP capabilities: MDP_CAP_xxx bits */ uint32_t caps; /* MDP capabilities: MDP_CAP_xxx bits */
}; };
struct mdp5_wb_instance {
int id;
int lm;
};
struct mdp5_wb_block {
MDP5_SUB_BLOCK_DEFINITION;
struct mdp5_wb_instance instances[MAX_BASES];
};
#define MDP5_INTF_NUM_MAX 5 #define MDP5_INTF_NUM_MAX 5
struct mdp5_intf_block { struct mdp5_intf_block {
...@@ -98,6 +108,7 @@ struct mdp5_cfg_hw { ...@@ -98,6 +108,7 @@ struct mdp5_cfg_hw {
struct mdp5_sub_block pp; struct mdp5_sub_block pp;
struct mdp5_sub_block dsc; struct mdp5_sub_block dsc;
struct mdp5_sub_block cdm; struct mdp5_sub_block cdm;
struct mdp5_wb_block wb;
struct mdp5_intf_block intf; struct mdp5_intf_block intf;
struct mdp5_perf_block perf; struct mdp5_perf_block perf;
......
...@@ -216,7 +216,7 @@ static void blend_setup(struct drm_crtc *crtc) ...@@ -216,7 +216,7 @@ static void blend_setup(struct drm_crtc *crtc)
struct mdp5_kms *mdp5_kms = get_kms(crtc); struct mdp5_kms *mdp5_kms = get_kms(crtc);
struct drm_plane *plane; struct drm_plane *plane;
struct mdp5_plane_state *pstate, *pstates[STAGE_MAX + 1] = {NULL}; struct mdp5_plane_state *pstate, *pstates[STAGE_MAX + 1] = {NULL};
const struct mdp_format *format; const struct msm_format *format;
struct mdp5_hw_mixer *mixer = pipeline->mixer; struct mdp5_hw_mixer *mixer = pipeline->mixer;
uint32_t lm = mixer->lm; uint32_t lm = mixer->lm;
struct mdp5_hw_mixer *r_mixer = pipeline->r_mixer; struct mdp5_hw_mixer *r_mixer = pipeline->r_mixer;
...@@ -274,7 +274,7 @@ static void blend_setup(struct drm_crtc *crtc) ...@@ -274,7 +274,7 @@ static void blend_setup(struct drm_crtc *crtc)
ctl_blend_flags |= MDP5_CTL_BLEND_OP_FLAG_BORDER_OUT; ctl_blend_flags |= MDP5_CTL_BLEND_OP_FLAG_BORDER_OUT;
DBG("Border Color is enabled"); DBG("Border Color is enabled");
} else if (plane_cnt) { } else if (plane_cnt) {
format = to_mdp_format(msm_framebuffer_format(pstates[STAGE_BASE]->base.fb)); format = msm_framebuffer_format(pstates[STAGE_BASE]->base.fb);
if (format->alpha_enable) if (format->alpha_enable)
bg_alpha_enabled = true; bg_alpha_enabled = true;
...@@ -285,8 +285,7 @@ static void blend_setup(struct drm_crtc *crtc) ...@@ -285,8 +285,7 @@ static void blend_setup(struct drm_crtc *crtc)
if (!pstates[i]) if (!pstates[i])
continue; continue;
format = to_mdp_format( format = msm_framebuffer_format(pstates[i]->base.fb);
msm_framebuffer_format(pstates[i]->base.fb));
plane = pstates[i]->base.plane; plane = pstates[i]->base.plane;
blend_op = MDP5_LM_BLEND_OP_MODE_FG_ALPHA(FG_CONST) | blend_op = MDP5_LM_BLEND_OP_MODE_FG_ALPHA(FG_CONST) |
MDP5_LM_BLEND_OP_MODE_BG_ALPHA(BG_CONST); MDP5_LM_BLEND_OP_MODE_BG_ALPHA(BG_CONST);
......
...@@ -224,7 +224,6 @@ static const struct mdp_kms_funcs kms_funcs = { ...@@ -224,7 +224,6 @@ static const struct mdp_kms_funcs kms_funcs = {
.prepare_commit = mdp5_prepare_commit, .prepare_commit = mdp5_prepare_commit,
.wait_flush = mdp5_wait_flush, .wait_flush = mdp5_wait_flush,
.complete_commit = mdp5_complete_commit, .complete_commit = mdp5_complete_commit,
.get_format = mdp_get_format,
.destroy = mdp5_kms_destroy, .destroy = mdp5_kms_destroy,
}, },
.set_irqmask = mdp5_set_irqmask, .set_irqmask = mdp5_set_irqmask,
......
...@@ -171,13 +171,13 @@ struct mdp5_encoder { ...@@ -171,13 +171,13 @@ struct mdp5_encoder {
static inline void mdp5_write(struct mdp5_kms *mdp5_kms, u32 reg, u32 data) static inline void mdp5_write(struct mdp5_kms *mdp5_kms, u32 reg, u32 data)
{ {
WARN_ON(mdp5_kms->enable_count <= 0); WARN_ON(mdp5_kms->enable_count <= 0);
msm_writel(data, mdp5_kms->mmio + reg); writel(data, mdp5_kms->mmio + reg);
} }
static inline u32 mdp5_read(struct mdp5_kms *mdp5_kms, u32 reg) static inline u32 mdp5_read(struct mdp5_kms *mdp5_kms, u32 reg)
{ {
WARN_ON(mdp5_kms->enable_count <= 0); WARN_ON(mdp5_kms->enable_count <= 0);
return msm_readl(mdp5_kms->mmio + reg); return readl(mdp5_kms->mmio + reg);
} }
static inline const char *stage2name(enum mdp_mixer_stage_id stage) static inline const char *stage2name(enum mdp_mixer_stage_id stage)
......
This diff is collapsed.
...@@ -114,10 +114,10 @@ static void set_fifo_thresholds(struct mdp5_smp *smp, ...@@ -114,10 +114,10 @@ static void set_fifo_thresholds(struct mdp5_smp *smp,
* presumably happens during the dma from scanout buffer). * presumably happens during the dma from scanout buffer).
*/ */
uint32_t mdp5_smp_calculate(struct mdp5_smp *smp, uint32_t mdp5_smp_calculate(struct mdp5_smp *smp,
const struct mdp_format *format, const struct msm_format *format,
u32 width, bool hdecim) u32 width, bool hdecim)
{ {
const struct drm_format_info *info = drm_format_info(format->base.pixel_format); const struct drm_format_info *info = drm_format_info(format->pixel_format);
struct mdp5_kms *mdp5_kms = get_kms(smp); struct mdp5_kms *mdp5_kms = get_kms(smp);
int rev = mdp5_cfg_get_hw_rev(mdp5_kms->cfg); int rev = mdp5_cfg_get_hw_rev(mdp5_kms->cfg);
int i, hsub, nplanes, nlines; int i, hsub, nplanes, nlines;
......
...@@ -74,7 +74,7 @@ void mdp5_smp_dump(struct mdp5_smp *smp, struct drm_printer *p, ...@@ -74,7 +74,7 @@ void mdp5_smp_dump(struct mdp5_smp *smp, struct drm_printer *p,
struct mdp5_global_state *global_state); struct mdp5_global_state *global_state);
uint32_t mdp5_smp_calculate(struct mdp5_smp *smp, uint32_t mdp5_smp_calculate(struct mdp5_smp *smp,
const struct mdp_format *format, const struct msm_format *format,
u32 width, bool hdecim); u32 width, bool hdecim);
int mdp5_smp_assign(struct mdp5_smp *smp, struct mdp5_smp_state *state, int mdp5_smp_assign(struct mdp5_smp *smp, struct mdp5_smp_state *state,
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/regulator/consumer.h> #include <linux/regulator/consumer.h>
#include "mdp_format.h"
#include "msm_drv.h" #include "msm_drv.h"
#include "msm_kms.h" #include "msm_kms.h"
#include "mdp_common.xml.h" #include "mdp_common.xml.h"
...@@ -77,23 +78,6 @@ void mdp_irq_update(struct mdp_kms *mdp_kms); ...@@ -77,23 +78,6 @@ void mdp_irq_update(struct mdp_kms *mdp_kms);
* pixel format helpers: * pixel format helpers:
*/ */
struct mdp_format {
struct msm_format base;
enum mdp_bpc bpc_r, bpc_g, bpc_b;
enum mdp_bpc_alpha bpc_a;
uint8_t unpack[4];
bool alpha_enable, unpack_tight;
uint8_t cpp, unpack_count;
enum mdp_fetch_type fetch_type;
enum mdp_chroma_samp_type chroma_sample;
bool is_yuv;
};
#define to_mdp_format(x) container_of(x, struct mdp_format, base)
#define MDP_FORMAT_IS_YUV(mdp_format) ((mdp_format)->is_yuv)
uint32_t mdp_get_formats(uint32_t *formats, uint32_t max_formats, bool rgb_only);
const struct msm_format *mdp_get_format(struct msm_kms *kms, uint32_t format, uint64_t modifier);
/* MDP capabilities */ /* MDP capabilities */
#define MDP_CAP_SMP BIT(0) /* Shared Memory Pool */ #define MDP_CAP_SMP BIT(0) /* Shared Memory Pool */
#define MDP_CAP_DSC BIT(1) /* VESA Display Stream Compression */ #define MDP_CAP_DSC BIT(1) /* VESA Display Stream Compression */
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment