linux/drivers/gpu/drm/bochs/bochs.h
<<
>>
Prefs
   1/* SPDX-License-Identifier: GPL-2.0 */
   2
   3#include <linux/io.h>
   4#include <linux/console.h>
   5
   6#include <drm/drm_crtc.h>
   7#include <drm/drm_crtc_helper.h>
   8#include <drm/drm_encoder.h>
   9#include <drm/drm_fb_helper.h>
  10#include <drm/drm_gem.h>
  11#include <drm/drm_gem_vram_helper.h>
  12#include <drm/drm_simple_kms_helper.h>
  13
  14/* ---------------------------------------------------------------------- */
  15
  16#define VBE_DISPI_IOPORT_INDEX           0x01CE
  17#define VBE_DISPI_IOPORT_DATA            0x01CF
  18
  19#define VBE_DISPI_INDEX_ID               0x0
  20#define VBE_DISPI_INDEX_XRES             0x1
  21#define VBE_DISPI_INDEX_YRES             0x2
  22#define VBE_DISPI_INDEX_BPP              0x3
  23#define VBE_DISPI_INDEX_ENABLE           0x4
  24#define VBE_DISPI_INDEX_BANK             0x5
  25#define VBE_DISPI_INDEX_VIRT_WIDTH       0x6
  26#define VBE_DISPI_INDEX_VIRT_HEIGHT      0x7
  27#define VBE_DISPI_INDEX_X_OFFSET         0x8
  28#define VBE_DISPI_INDEX_Y_OFFSET         0x9
  29#define VBE_DISPI_INDEX_VIDEO_MEMORY_64K 0xa
  30
  31#define VBE_DISPI_ID0                    0xB0C0
  32#define VBE_DISPI_ID1                    0xB0C1
  33#define VBE_DISPI_ID2                    0xB0C2
  34#define VBE_DISPI_ID3                    0xB0C3
  35#define VBE_DISPI_ID4                    0xB0C4
  36#define VBE_DISPI_ID5                    0xB0C5
  37
  38#define VBE_DISPI_DISABLED               0x00
  39#define VBE_DISPI_ENABLED                0x01
  40#define VBE_DISPI_GETCAPS                0x02
  41#define VBE_DISPI_8BIT_DAC               0x20
  42#define VBE_DISPI_LFB_ENABLED            0x40
  43#define VBE_DISPI_NOCLEARMEM             0x80
  44
  45/* ---------------------------------------------------------------------- */
  46
  47enum bochs_types {
  48        BOCHS_QEMU_STDVGA,
  49        BOCHS_UNKNOWN,
  50};
  51
  52struct bochs_device {
  53        /* hw */
  54        void __iomem   *mmio;
  55        int            ioports;
  56        void __iomem   *fb_map;
  57        unsigned long  fb_base;
  58        unsigned long  fb_size;
  59        unsigned long  qext_size;
  60
  61        /* mode */
  62        u16 xres;
  63        u16 yres;
  64        u16 yres_virtual;
  65        u32 stride;
  66        u32 bpp;
  67        struct edid *edid;
  68
  69        /* drm */
  70        struct drm_device *dev;
  71        struct drm_simple_display_pipe pipe;
  72        struct drm_connector connector;
  73};
  74
  75/* ---------------------------------------------------------------------- */
  76
  77/* bochs_hw.c */
  78int bochs_hw_init(struct drm_device *dev);
  79void bochs_hw_fini(struct drm_device *dev);
  80
  81void bochs_hw_blank(struct bochs_device *bochs, bool blank);
  82void bochs_hw_setmode(struct bochs_device *bochs,
  83                      struct drm_display_mode *mode);
  84void bochs_hw_setformat(struct bochs_device *bochs,
  85                        const struct drm_format_info *format);
  86void bochs_hw_setbase(struct bochs_device *bochs,
  87                      int x, int y, int stride, u64 addr);
  88int bochs_hw_load_edid(struct bochs_device *bochs);
  89
  90/* bochs_mm.c */
  91int bochs_mm_init(struct bochs_device *bochs);
  92void bochs_mm_fini(struct bochs_device *bochs);
  93
  94/* bochs_kms.c */
  95int bochs_kms_init(struct bochs_device *bochs);
  96
  97/* bochs_fbdev.c */
  98extern const struct drm_mode_config_funcs bochs_mode_funcs;
  99