Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
video: rockchip/mpp_device: new common device design
-------------- --------------- ------------------ | | | | | mpp device | | mpp device |<-->| mpp service |<-->| implementation| | top | | | | and buttom | -------------- --------------- ------------------ The mpp common device will do the top part, but still allow the mpp device implementation change the default behaviour. The mpp device implementation will register itself to the mpp device framework. But the mpp common device is the base class not the top class. The mpp common device framework also in charge of the communication with mpp service. The clocks and power are all moved into the runtime power domain management, we don't need to assign the clocks in the driver but leaves those work to the rockchip power domain and common driver, we just need to configure the clocks in our device node. The link mode will be regard as a bundle of tasks. The functions with rockchip_mpp_* prefix are used internal for the task operation. This device mode is not just suitable for the video IP but also IEP I think. I now make the mpp common device become a module and a different mpp device implementation will be module as well. The iommu and video acceleration can work independently. Change-Id: I97dd4eaf20a925f820133a6cb2d954fb97367cb3 Signed-off-by: Randy Li <randy.li@rock-chips.com> Signed-off-by: ayaka <ayaka@soulik.info>
- Loading branch information
Randy Li
committed
May 21, 2018
1 parent
4c0ced0
commit d5709ce
Showing
18 changed files
with
1,213 additions
and
7,063 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# SPDX-License-Identifier: GPL-2.0 | ||
obj-$(CONFIG_ROCKCHIP_MPP_SERVICE) += mpp_service.o | ||
obj-$(CONFIG_ROCKCHIP_MPP_DEVICE) += mpp_dev_rkvenc.o mpp_dev_vepu.o \ | ||
mpp_dev_h265e.o mpp_dev_common.o vpu_iommu_drm.o vpu_iommu_ion.o \ | ||
vpu_iommu_ops.o | ||
rk-mpp-service-objs := mpp_service.o | ||
rk-mpp-device-objs := mpp_dev_common.o mpp_iommu_dma.o | ||
|
||
obj-$(CONFIG_ROCKCHIP_MPP_SERVICE) += rk-mpp-service.o | ||
obj-$(CONFIG_ROCKCHIP_MPP_DEVICE) += rk-mpp-device.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
/* SPDX-License-Identifier: GPL-2.0-or-later */ | ||
/* | ||
* Copyright (C) 2016 - 2017 Fuzhou Rockchip Electronics Co., Ltd | ||
* | ||
* This software is licensed under the terms of the GNU General Public | ||
* License version 2, as published by the Free Software Foundation, and | ||
* may be copied, distributed, and modified under those terms. | ||
* | ||
* 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 _ROCKCHIP_MPP_DEBUG_H_ | ||
#define _ROCKCHIP_MPP_DEBUG_H_ | ||
|
||
#include <linux/types.h> | ||
|
||
/* | ||
* debug flag usage: | ||
* +------+-------------------+ | ||
* | 8bit | 24bit | | ||
* +------+-------------------+ | ||
* 0~23 bit is for different information type | ||
* 24~31 bit is for information print format | ||
*/ | ||
|
||
#define DEBUG_POWER 0x00000001 | ||
#define DEBUG_CLOCK 0x00000002 | ||
#define DEBUG_IRQ_STATUS 0x00000004 | ||
#define DEBUG_IOMMU 0x00000008 | ||
#define DEBUG_IOCTL 0x00000010 | ||
#define DEBUG_FUNCTION 0x00000020 | ||
#define DEBUG_REGISTER 0x00000040 | ||
#define DEBUG_EXTRA_INFO 0x00000080 | ||
#define DEBUG_TIMING 0x00000100 | ||
#define DEBUG_TASK_INFO 0x00000200 | ||
#define DEBUG_DUMP_ERR_REG 0x00000400 | ||
#define DEBUG_LINK_TABLE 0x00000800 | ||
|
||
#define DEBUG_SET_REG 0x00001000 | ||
#define DEBUG_GET_REG 0x00002000 | ||
#define DEBUG_PPS_FILL 0x00004000 | ||
#define DEBUG_IRQ_CHECK 0x00008000 | ||
#define DEBUG_CACHE_32B 0x00010000 | ||
|
||
#define DEBUG_RESET 0x00020000 | ||
|
||
#define PRINT_FUNCTION 0x80000000 | ||
#define PRINT_LINE 0x40000000 | ||
|
||
#define mpp_debug_func(type, fmt, args...) \ | ||
do { \ | ||
if (unlikely(debug & type)) { \ | ||
pr_info("%s:%d: " fmt, \ | ||
__func__, __LINE__, ##args); \ | ||
} \ | ||
} while (0) | ||
#define mpp_debug(type, fmt, args...) \ | ||
do { \ | ||
if (unlikely(debug & type)) { \ | ||
pr_info(fmt, ##args); \ | ||
} \ | ||
} while (0) | ||
|
||
#define mpp_debug_enter() \ | ||
do { \ | ||
if (unlikely(debug & DEBUG_FUNCTION)) { \ | ||
pr_info("%s:%d: enter\n", \ | ||
__func__, __LINE__); \ | ||
} \ | ||
} while (0) | ||
|
||
#define mpp_debug_leave() \ | ||
do { \ | ||
if (unlikely(debug & DEBUG_FUNCTION)) { \ | ||
pr_info("%s:%d: leave\n", \ | ||
__func__, __LINE__); \ | ||
} \ | ||
} while (0) | ||
|
||
#define mpp_err(fmt, args...) \ | ||
pr_err("%s:%d: " fmt, __func__, __LINE__, ##args) | ||
|
||
#endif |
Oops, something went wrong.