Skip to content

Commit 24fe21a

Browse files
pengcheng chenakiernan
authored andcommitted
osd: add osd dump cmd for drm
PD#152825: add osd dump cmd for drm Change-Id: I9557ee84cecf00036b6ed59819aedd8e53ec6693 Signed-off-by: pengcheng chen <[email protected]>
1 parent 59b14f9 commit 24fe21a

File tree

2 files changed

+36
-2
lines changed

2 files changed

+36
-2
lines changed

drivers/amlogic/media/osd/osd_drm.c

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,28 @@ static ssize_t osd_clear_write_file(struct file *file,
437437
return count;
438438
}
439439

440+
static ssize_t osd_dump_read_file(struct file *file,
441+
char __user *userbuf,
442+
size_t count, loff_t *ppos)
443+
{
444+
char __iomem *buf;
445+
struct seq_file *s = file->private_data;
446+
int osd_id = *(int *)s;
447+
ssize_t len;
448+
449+
osd_restore_screen_info(osd_id, &buf, &len);
450+
if (buf && len)
451+
return simple_read_from_buffer(userbuf, count, ppos, buf, len);
452+
else
453+
return 0;
454+
}
455+
456+
static ssize_t osd_dump_write_file(struct file *file,
457+
const char __user *userbuf,
458+
size_t count, loff_t *ppos)
459+
{
460+
return 0;
461+
}
440462

441463

442464
static const struct file_operations loglevel_file_ops = {
@@ -509,6 +531,11 @@ static const struct file_operations osd_clear_file_ops = {
509531
.write = osd_clear_write_file,
510532
};
511533

534+
static const struct file_operations osd_dump_file_ops = {
535+
.open = simple_open,
536+
.read = osd_dump_read_file,
537+
.write = osd_dump_write_file,
538+
};
512539

513540

514541
struct osd_drm_debugfs_files_s {
@@ -530,6 +557,7 @@ static struct osd_drm_debugfs_files_s osd_drm_debugfs_files[] = {
530557
{"order", S_IFREG | 0640, &osd_order_file_ops},
531558
{"osd_afbcd", S_IFREG | 0640, &osd_afbcd_file_ops},
532559
{"osd_clear", S_IFREG | 0220, &osd_clear_file_ops},
560+
{"osd_dump", S_IFREG | 0640, &osd_dump_file_ops},
533561
};
534562

535563
void osd_drm_debugfs_add(

drivers/amlogic/media/osd/osd_hw.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4435,8 +4435,11 @@ static bool osd_direct_render(struct osd_plane_map_s *plane_map)
44354435
void *vaddr = NULL;
44364436

44374437
phy_addr = phy_addr + plane_map->byte_stride * plane_map->src_y;
4438+
vaddr = phys_to_virt(phy_addr);
4439+
osd_hw.screen_base[index] = vaddr;
4440+
osd_hw.screen_size[index] =
4441+
plane_map->byte_stride * plane_map->src_h;
44384442
if (osd_hw.osd_clear[index]) {
4439-
vaddr = phys_to_virt(phy_addr);
44404443
if (vaddr)
44414444
memset(vaddr, 0x0,
44424445
plane_map->byte_stride*plane_map->src_h);
@@ -4616,8 +4619,11 @@ static void osd_cursor_move(struct osd_plane_map_s *plane_map)
46164619
if (index != OSD2)
46174620
return;
46184621
phy_addr = phy_addr + plane_map->byte_stride * plane_map->src_y;
4622+
vaddr = phys_to_virt(phy_addr);
4623+
osd_hw.screen_base[index] = vaddr;
4624+
osd_hw.screen_size[index] =
4625+
plane_map->byte_stride * plane_map->src_h;
46194626
if (osd_hw.osd_clear[index]) {
4620-
vaddr = phys_to_virt(phy_addr);
46214627
if (vaddr)
46224628
memset(vaddr, 0x0,
46234629
plane_map->byte_stride*plane_map->src_h);

0 commit comments

Comments
 (0)