Squashed commit of the following:

drivers/video/fb.c:  Framebuffer driver is code complete but as of yet untested.
    drivers/video/fb.c:  Add framebuffer character device.  This is basically only the framework for the driver; a lot of logic is still missing.
This commit is contained in:
Gregory Nutt
2017-09-11 16:26:18 -06:00
parent 808238c871
commit bf33f1d63e
5 changed files with 566 additions and 6 deletions
+4
View File
@@ -3,6 +3,10 @@
# see the file kconfig-language.txt in the NuttX tools repository.
#
config VIDEO_FB
bool "Framebuffer character driver"
default n
config VIDEO_OV2640
bool "OV2640 camera chip"
default n
+5 -1
View File
@@ -1,7 +1,7 @@
############################################################################
# drivers/ov2640/Make.defs
#
# Copyright (C) 2013 Gregory Nutt. All rights reserved.
# Copyright (C) 2013, 2017 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
@@ -37,6 +37,10 @@
ifeq ($(CONFIG_VIDEO_DEVICES),y)
ifeq ($(CONFIG_VIDEO_FB),y)
CSRCS += fb.c
endif
# These video drivers depend on I2C support
ifeq ($(CONFIG_I2C),y)
+524
View File
File diff suppressed because it is too large Load Diff
+7 -1
View File
@@ -90,6 +90,7 @@
#define _USBCBASE (0x2500) /* USB-C controller ioctl commands */
#define _MAC802154BASE (0x2600) /* 802.15.4 MAC ioctl commands */
#define _PWRBASE (0x2700) /* Power-related ioctl commands */
#define _FBIOCBASE (0x2800) /* Frame buffer character driver ioctl commands */
/* boardctl() commands share the same number space */
@@ -431,9 +432,14 @@
/* Power-Related IOCTLs *****************************************************/
#define _PWRIOCVALID(c) (_IOC_TYPE(c)==_SMPS_BASE)
#define _PWRIOCVALID(c) (_IOC_TYPE(c)==_PWRBASE)
#define _PWRIOC(nr) _IOC(_PWRBASE,nr)
/* Frame buffer character drivers *******************************************/
#define _FBIOCVALID(c) (_IOC_TYPE(c)==_FBIOCBASE)
#define _FBIOC(nr) _IOC(_FBIOCBASE,nr)
/* boardctl() command definitions *******************************************/
#define _BOARDIOCVALID(c) (_IOC_TYPE(c)==_BOARDBASE)
+26 -4
View File
@@ -42,6 +42,7 @@
#include <nuttx/config.h>
#include <stdint.h>
#include <nuttx/fs/ioctl.h>
/****************************************************************************
* Pre-processor definitions
@@ -190,6 +191,27 @@
#define FB_CUR_XOR 0x10 /* Use XOR vs COPY ROP on image */
#endif
/* FB character driver IOCTL commands ***************************************/
/* ioctls */
#define FBIOGET_VIDEOINFO _FBIOC(0x0001) /* Get color plane info */
/* Argument: writable struct fb_videoinfo_s */
#define FBIOGET_PLANEINFO _FBIOC(0x0002) /* Get video plane info */
/* Argument: writable struct fb_planeinfo_s */
#ifdef CONFIG_FB_CMAP
# define FBIOGET_CMAP _FBIOC(0x0003) /* Get RGB color mapping */
/* Argument: writable struct fb_cmap_s */
# define FBIOPUT_CMAP _FBIOC(0x0004) /* Put RGB color mapping */
/* Argument: read-only struct fb_cmap_s */
#endif
#ifdef CONFIG_FB_HWCURSOR
# define FBIOGET_CURSOR _FBIOC(0x0005) /* Get cursor attributes */
/* Argument: writable struct fb_cursorattrib_s */
# define FBIOPUT_CURSOR _FBIOC(0x0006) /* Set cursor attibutes */
/* Argument: read-only struct fb_setcursor_s */
#endif
/****************************************************************************
* Public Types
****************************************************************************/
@@ -307,8 +329,8 @@ struct fb_setcursor_s
};
#endif
/* The framebuffer "driver" under NuttX is not a driver at all, but simply
* a driver "object" that is accessed through the following vtable:
/* The framebuffer "object" is accessed through within the OS via
* the following vtable:
*/
struct fb_vtable_s
@@ -322,22 +344,22 @@ struct fb_vtable_s
int (*getplaneinfo)(FAR struct fb_vtable_s *vtable, int planeno,
FAR struct fb_planeinfo_s *pinfo);
#ifdef CONFIG_FB_CMAP
/* The following are provided only if the video hardware supports RGB
* color mapping
*/
#ifdef CONFIG_FB_CMAP
int (*getcmap)(FAR struct fb_vtable_s *vtable,
FAR struct fb_cmap_s *cmap);
int (*putcmap)(FAR struct fb_vtable_s *vtable,
FAR const struct fb_cmap_s *cmap);
#endif
#ifdef CONFIG_FB_HWCURSOR
/* The following are provided only if the video hardware supports a
* hardware cursor.
*/
#ifdef CONFIG_FB_HWCURSOR
int (*getcursor)(FAR struct fb_vtable_s *vtable,
FAR struct fb_cursorattrib_s *attrib);
int (*setcursor)(FAR struct fb_vtable_s *vtable,