mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 20:32:04 +09:00
video: rockchip: rga3: Update version to 1.1.5
1. Modify the definition of version number. 2. Add to get the driver version interface. 3. Add to get the hardware version interface. Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com> Change-Id: Ia8d8bcb476adc6af5a64a009f0e5cade93e083ac
This commit is contained in:
@@ -5,6 +5,15 @@
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/scatterlist.h>
|
||||
|
||||
/* Use 'r' as magic number */
|
||||
#define RGA_IOC_MAGIC 'r'
|
||||
#define RGA_IOW(nr, type) _IOW(RGA_IOC_MAGIC, nr, type)
|
||||
#define RGA_IOR(nr, type) _IOR(RGA_IOC_MAGIC, nr, type)
|
||||
#define RGA_IOWR(nr, type) _IOWR(RGA_IOC_MAGIC, nr, type)
|
||||
|
||||
#define RGA_IOC_GET_DRVIER_VERSION RGA_IOR(0x1, struct rga_version_t)
|
||||
#define RGA_IOC_GET_HW_VERSION RGA_IOR(0x2, struct rga_hw_versions_t)
|
||||
|
||||
#define RGA_BLIT_SYNC 0x5017
|
||||
#define RGA_BLIT_ASYNC 0x5018
|
||||
#define RGA_FLUSH 0x5019
|
||||
@@ -146,6 +155,21 @@ enum {
|
||||
#define RGA_SCHED_PRIORITY_DEFAULT 0
|
||||
#define RGA_SCHED_PRIORITY_MAX 6
|
||||
|
||||
#define RGA_VERSION_SIZE 16
|
||||
#define RGA_HW_SIZE 5
|
||||
|
||||
struct rga_version_t {
|
||||
uint32_t major;
|
||||
uint32_t minor;
|
||||
uint32_t revision;
|
||||
uint8_t str[RGA_VERSION_SIZE];
|
||||
};
|
||||
|
||||
struct rga_hw_versions_t {
|
||||
struct rga_version_t version[RGA_HW_SIZE];
|
||||
uint32_t size;
|
||||
};
|
||||
|
||||
struct rga_mmu_info_t {
|
||||
unsigned long src0_base_addr;
|
||||
unsigned long src1_base_addr;
|
||||
|
||||
@@ -63,8 +63,16 @@
|
||||
/* Driver information */
|
||||
#define DRIVER_DESC "RGA multicore Device Driver"
|
||||
#define DRIVER_NAME "rga_multicore"
|
||||
#define DRIVER_VERSION "1.1.4"
|
||||
#define RGA3_VERSION "2.000"
|
||||
|
||||
#define STR_HELPER(x) #x
|
||||
#define STR(x) STR_HELPER(x)
|
||||
|
||||
#define DRIVER_MAJOR_VERISON 1
|
||||
#define DRIVER_MINOR_VERSION 1
|
||||
#define DRIVER_REVISION_VERSION 5
|
||||
|
||||
#define DRIVER_VERSION (STR(DRIVER_MAJOR_VERISON) "." STR(DRIVER_MINOR_VERSION) \
|
||||
"." STR(DRIVER_REVISION_VERSION))
|
||||
|
||||
/* time limit */
|
||||
#define RGA_ASYNC_TIMEOUT_DELAY HZ
|
||||
@@ -227,7 +235,7 @@ struct rga_scheduler_t {
|
||||
const struct rga_hw_data *data;
|
||||
int job_count;
|
||||
int irq;
|
||||
char version[16];
|
||||
struct rga_version_t version;
|
||||
int core;
|
||||
unsigned int core_offset;
|
||||
};
|
||||
|
||||
@@ -2533,8 +2533,12 @@ int rga2_get_version(struct rga_scheduler_t *scheduler)
|
||||
if (!major_version && !minor_version)
|
||||
major_version = 2;
|
||||
|
||||
snprintf(scheduler->version, 10, "%x.%01x.%05x", major_version,
|
||||
snprintf(scheduler->version.str, 10, "%x.%01x.%05x", major_version,
|
||||
minor_version, svn_version);
|
||||
|
||||
scheduler->version.major = major_version;
|
||||
scheduler->version.minor = minor_version;
|
||||
scheduler->version.revision = svn_version;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2067,8 +2067,12 @@ int rga3_get_version(struct rga_scheduler_t *scheduler)
|
||||
minor_version = (reg_version & RGA3_MINOR_VERSION_MASK) >> 20;
|
||||
svn_version = (reg_version & RGA3_SVN_VERSION_MASK);
|
||||
|
||||
snprintf(scheduler->version, 10, "%x.%01x.%05x", major_version,
|
||||
snprintf(scheduler->version.str, 10, "%x.%01x.%05x", major_version,
|
||||
minor_version, svn_version);
|
||||
|
||||
scheduler->version.major = major_version;
|
||||
scheduler->version.minor = minor_version;
|
||||
scheduler->version.revision = svn_version;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -108,6 +108,8 @@ static long rga_ioctl(struct file *file, uint32_t cmd, unsigned long arg)
|
||||
int i = 0;
|
||||
int major_version = 0, minor_version = 0;
|
||||
char version[16] = { 0 };
|
||||
struct rga_version_t driver_version;
|
||||
struct rga_hw_versions_t hw_versions;
|
||||
|
||||
if (!rga) {
|
||||
pr_err("rga_drvdata is null, rga is not init\n");
|
||||
@@ -150,7 +152,7 @@ static long rga_ioctl(struct file *file, uint32_t cmd, unsigned long arg)
|
||||
case RGA_GET_RESULT:
|
||||
break;
|
||||
case RGA_GET_VERSION:
|
||||
sscanf(rga->rga_scheduler[i]->version, "%x.%x.%*x",
|
||||
sscanf(rga->rga_scheduler[i]->version.str, "%x.%x.%*x",
|
||||
&major_version, &minor_version);
|
||||
snprintf(version, 5, "%x.%02x", major_version, minor_version);
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0))
|
||||
@@ -167,8 +169,8 @@ static long rga_ioctl(struct file *file, uint32_t cmd, unsigned long arg)
|
||||
for (i = 0; i < rga->num_of_scheduler; i++) {
|
||||
if (rga->rga_scheduler[i]->ops == &rga2_ops) {
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0))
|
||||
if (copy_to_user((void *)arg, rga->rga_scheduler[i]->version,
|
||||
sizeof(rga->rga_scheduler[i]->version)))
|
||||
if (copy_to_user((void *)arg, rga->rga_scheduler[i]->version.str,
|
||||
sizeof(rga->rga_scheduler[i]->version.str)))
|
||||
ret = -EFAULT;
|
||||
#else
|
||||
if (copy_to_user((void *)arg, RGA3_VERSION,
|
||||
@@ -188,6 +190,37 @@ static long rga_ioctl(struct file *file, uint32_t cmd, unsigned long arg)
|
||||
|
||||
break;
|
||||
|
||||
case RGA_IOC_GET_HW_VERSION:
|
||||
/* RGA hardware version */
|
||||
hw_versions.size = rga->num_of_scheduler > RGA_HW_SIZE ?
|
||||
RGA_HW_SIZE : rga->num_of_scheduler;
|
||||
|
||||
for (i = 0; i < hw_versions.size; i++) {
|
||||
memcpy(&hw_versions.version[i], &rga->rga_scheduler[i]->version,
|
||||
sizeof(rga->rga_scheduler[i]->version));
|
||||
}
|
||||
|
||||
if (copy_to_user((void *)arg, &hw_versions, sizeof(hw_versions)))
|
||||
ret = -EFAULT;
|
||||
else
|
||||
ret = true;
|
||||
|
||||
break;
|
||||
|
||||
case RGA_IOC_GET_DRVIER_VERSION:
|
||||
/* Driver version */
|
||||
driver_version.major = DRIVER_MAJOR_VERISON;
|
||||
driver_version.minor = DRIVER_MINOR_VERSION;
|
||||
driver_version.revision = DRIVER_REVISION_VERSION;
|
||||
strncpy((char *)driver_version.str, DRIVER_VERSION, sizeof(driver_version.str));
|
||||
|
||||
if (copy_to_user((void *)arg, &driver_version, sizeof(driver_version)))
|
||||
ret = -EFAULT;
|
||||
else
|
||||
ret = true;
|
||||
|
||||
break;
|
||||
|
||||
case RGA_IMPORT_DMA:
|
||||
case RGA_RELEASE_DMA:
|
||||
default:
|
||||
@@ -588,7 +621,7 @@ static int rga_drv_probe(struct platform_device *pdev)
|
||||
|
||||
rga_scheduler->ops->get_version(rga_scheduler);
|
||||
pr_err("Driver loaded successfully rga[%d] ver:%s\n", i,
|
||||
rga_scheduler->version);
|
||||
rga_scheduler->version.str);
|
||||
|
||||
data->rga_scheduler[data->num_of_scheduler] = rga_scheduler;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user