Files
android/drivers/misc/mediatek/apusys/vpu/p1/vpu_dump.h
T
threeeye bc1d038eac REVVL 6 Pro kernel bring-up: full working tree snapshot (2026-09-12)
Squashed backup commit (no shallow-clone history issues) of
xiaomi-mt6833-dev/kernel_xiaomi_mt6833 (lineage-23.2 branch, upstream
commit 9eece662e) plus all fixes applied to get everpal_defconfig building
clean against a modern (GCC 15.2.0) toolchain -- see the previous commit
message on the lineage-23.2 branch (also in this repo history is not
available here since this is a squashed snapshot; full incremental history
lives in the local DL380 checkout and the upstream GitHub remote).

Upstream: https://github.com/xiaomi-mt6833-dev/kernel_xiaomi_mt6833 (lineage-23.2)
2026-09-12 13:36:46 +00:00

98 lines
2.5 KiB
C

/*
* Copyright (C) 2019 MediaTek Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __VPU_DUMP_H__
#define __VPU_DUMP_H__
#include "vpu_cfg.h"
#include "vpu_ioctl.h"
#include "vpu_algo.h"
#include "vpu_cmd.h"
struct vpu_device;
struct vpu_dmp {
// general info
int read_cnt; // counter of AEE reads the dump from debugfs.
char info[VPU_DMP_INFO_SZ];
uint64_t time;
struct vpu_request req;
// device
int vd_state;
uint32_t vd_dev_state;
int vd_pw_boost;
// registers
uint32_t r_info[VPU_DMP_REG_CNT_INFO];
uint32_t r_dbg[VPU_DMP_REG_CNT_DBG];
uint32_t r_mbox[VPU_DMP_REG_CNT_MBOX];
uint32_t r_CG_CON;
uint32_t r_SW_RST;
uint32_t r_DONE_ST;
uint32_t r_CTRL;
// command
struct vpu_cmd_ctl c_ctl[VPU_MAX_PRIORITY];
struct __vpu_algo c_alg[VPU_MAX_PRIORITY];
int c_prio;
int c_prio_max;
int c_active;
uint64_t c_timeout;
// memory
uint8_t m_reset[VPU_DMP_RESET_SZ];
uint8_t m_main[VPU_DMP_MAIN_SZ];
uint8_t m_kernel[VPU_DMP_KERNEL_SZ];
uint8_t m_iram[VPU_DMP_IRAM_SZ];
uint8_t m_work[VPU_DMP_WORK_SZ];
uint8_t m_reg[VPU_DMP_REG_SZ];
uint8_t m_imem[VPU_DMP_IMEM_SZ];
uint8_t m_dmem[VPU_DMP_DMEM_SZ];
#if VPU_XOS
uint8_t m_pl_algo[VPU_MAX_PRIORITY][VPU_DMP_PRELOAD_SZ];
uint8_t m_pl_iram[VPU_MAX_PRIORITY][VPU_DMP_IRAM_SZ];
#endif
};
void vpu_dmp_init(struct vpu_device *vd);
void vpu_dmp_exit(struct vpu_device *vd);
int vpu_dmp_create_locked(struct vpu_device *vd, struct vpu_request *req,
const char *fmt, ...);
void vpu_dmp_free_locked(struct vpu_device *vd);
void vpu_dmp_free_all(void);
void vpu_dmp_seq_core(struct seq_file *s, struct vpu_device *vd);
void vpu_dmp_seq(struct seq_file *s);
#define vpu_dmp_create(vd, req, fmt, args...) do { \
pr_debug("%s: vpu_dmp_create\n", __func__); \
vpu_cmd_lock_all(vd); \
if (!vpu_pwr_get_locked_nb(vd)) { \
if (!vpu_dev_boot(vd)) { \
vpu_dmp_create_locked(vd, req, fmt, ##args); \
} \
vpu_pwr_put_locked_nb(vd); \
} \
vpu_cmd_unlock_all(vd); \
} while (0)
#define vpu_dmp_free(vd) do { \
pr_debug("%s: vpu_dmp_free\n", __func__); \
vpu_cmd_lock_all(vd); \
vpu_dmp_free_locked(vd); \
vpu_cmd_unlock_all(vd); \
} while (0)
#endif