@@ -437,6 +437,28 @@ static ssize_t osd_clear_write_file(struct file *file,
437
437
return count ;
438
438
}
439
439
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
+ }
440
462
441
463
442
464
static const struct file_operations loglevel_file_ops = {
@@ -509,6 +531,11 @@ static const struct file_operations osd_clear_file_ops = {
509
531
.write = osd_clear_write_file ,
510
532
};
511
533
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
+ };
512
539
513
540
514
541
struct osd_drm_debugfs_files_s {
@@ -530,6 +557,7 @@ static struct osd_drm_debugfs_files_s osd_drm_debugfs_files[] = {
530
557
{"order" , S_IFREG | 0640 , & osd_order_file_ops },
531
558
{"osd_afbcd" , S_IFREG | 0640 , & osd_afbcd_file_ops },
532
559
{"osd_clear" , S_IFREG | 0220 , & osd_clear_file_ops },
560
+ {"osd_dump" , S_IFREG | 0640 , & osd_dump_file_ops },
533
561
};
534
562
535
563
void osd_drm_debugfs_add (
0 commit comments