This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new e6490694a1 drivers/video: passthrough unknown ioctl commands for 
customized scenarios in fb driver
e6490694a1 is described below

commit e6490694a1c111a2183d03ccd476937708eda2bb
Author: rongyichang <rongyich...@xiaomi.com>
AuthorDate: Fri Feb 10 18:39:23 2023 +0800

    drivers/video: passthrough unknown ioctl commands for customized scenarios 
in fb
    driver
    
    Signed-off-by: rongyichang <rongyich...@xiaomi.com>
---
 drivers/video/fb.c       | 11 +++++++++--
 include/nuttx/video/fb.h |  4 ++++
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/drivers/video/fb.c b/drivers/video/fb.c
index 508ef84257..a1b2877b7a 100644
--- a/drivers/video/fb.c
+++ b/drivers/video/fb.c
@@ -685,8 +685,15 @@ static int fb_ioctl(FAR struct file *filep, int cmd, 
unsigned long arg)
         break;
 
       default:
-        gerr("ERROR: Unsupported IOCTL command: %d\n", cmd);
-        ret = -ENOTTY;
+        if (fb->vtable->ioctl != NULL)
+          {
+            ret = fb->vtable->ioctl(fb->vtable, cmd, arg);
+          }
+        else
+          {
+            gerr("ERROR: Unsupported IOCTL command: %d\n", cmd);
+            ret = -ENOTTY;
+          }
         break;
     }
 
diff --git a/include/nuttx/video/fb.h b/include/nuttx/video/fb.h
index 3c39fdbe09..9e12383d0b 100644
--- a/include/nuttx/video/fb.h
+++ b/include/nuttx/video/fb.h
@@ -793,6 +793,10 @@ struct fb_vtable_s
 
   int (*setpower)(FAR struct fb_vtable_s *vtable, int power);
 
+  /* Passthrough the unknown ioctl commands. */
+
+  int (*ioctl)(FAR struct fb_vtable_s *vtable, int cmd, unsigned long arg);
+
   /* Pointer to framebuffer device private data. */
 
   FAR void *priv;

Reply via email to