~ubuntu-branches/ubuntu/trusty/qemu/trusty

« back to all changes in this revision

Viewing changes to .pc/ubuntu/linaro/0046-dsi-add-transfer-done-callback.patch/include/hw/dsi.h

  • Committer: Package Import Robot
  • Author(s): Serge Hallyn
  • Date: 2014-02-04 12:13:08 UTC
  • mfrom: (10.1.45 sid)
  • Revision ID: package-import@ubuntu.com-20140204121308-1xq92lrfs75agw2g
Tags: 1.7.0+dfsg-3ubuntu1~ppa1
* Merge 1.7.0+dfsg-3 from debian.  Remaining changes:
  - debian/patches/ubuntu:
    * expose-vmx_qemu64cpu.patch
    * linaro (omap3) and arm64 patches
    * ubuntu/target-ppc-add-stubs-for-kvm-breakpoints: fix FTBFS
      on ppc
    * ubuntu/CVE-2013-4377.patch: fix denial of service via virtio
  - debian/qemu-system-x86.modprobe: set kvm_intel nested=1 options
  - debian/control:
    * add arm64 to Architectures
    * add qemu-common and qemu-system-aarch64 packages
  - debian/qemu-system-common.install: add debian/tmp/usr/lib
  - debian/qemu-system-common.preinst: add kvm group
  - debian/qemu-system-common.postinst: remove acl placed by udev,
    and add udevadm trigger.
  - qemu-system-x86.links: add eepro100.rom, remove pxe-virtio,
    pxe-e1000 and pxe-rtl8139.
  - add qemu-system-x86.qemu-kvm.upstart and .default
  - qemu-user-static.postinst-in: remove arm64 binfmt
  - debian/rules:
    * allow parallel build
    * add aarch64 to system_targets and sys_systems
    * add qemu-kvm-spice links
    * install qemu-system-x86.modprobe
  - add debian/qemu-system-common.links for OVMF.fd link
* Remove kvm-img, kvm-nbd, kvm-ifup and kvm-ifdown symlinks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * MIPI DSI interface.
 
3
 *
 
4
 * Copyright (C) 2008-2010 Nokia Corporation
 
5
 *
 
6
 * This program is free software; you can redistribute it and/or
 
7
 * modify it under the terms of the GNU General Public License as
 
8
 * published by the Free Software Foundation; either version 2 or
 
9
 * (at your option) any later version of the License.
 
10
 *
 
11
 * This program is distributed in the hope that it will be useful,
 
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 * GNU General Public License for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU General Public License along
 
17
 * with this program; if not, write to the Free Software Foundation, Inc.,
 
18
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
19
 */
 
20
#ifndef HW_DSI_H__
 
21
#define HW_DSI_H__
 
22
#include "qdev.h"
 
23
#include "hw/display/framebuffer.h"
 
24
 
 
25
#define DSI_MAKERETURNBYTE(b) ((((b) & 0xff) << 8) | 0x21)
 
26
#define DSI_MAKERETURNWORD(w) ((((w) & 0xffff) << 8) | 0x22)
 
27
#define DSI_MAKERETURNERROR(e) ((((e) & 0xffff) << 8) | 0x02)
 
28
 
 
29
typedef struct DSIDevice DSIDevice;
 
30
typedef struct DSICommonDevice DSICommonDevice;
 
31
typedef struct DSIHost DSIHost;
 
32
 
 
33
#define TYPE_DSI_DEVICE "dsi-device"
 
34
#define DSI_DEVICE(obj) \
 
35
    OBJECT_CHECK(DSIDevice, (obj), TYPE_DSI_DEVICE)
 
36
#define DSI_DEVICE_CLASS(klass) \
 
37
    OBJECT_CLASS_CHECK(DSIDeviceClass, (klass), TYPE_DSI_DEVICE)
 
38
#define DSI_DEVICE_GET_CLASS(obj) \
 
39
    OBJECT_GET_CLASS(DSIDeviceClass, (obj), TYPE_DSI_DEVICE)
 
40
 
 
41
#define TYPE_DSI_COMMON_DEVICE "dsi-common-device"
 
42
#define DSI_COMMON_DEVICE(obj) \
 
43
    OBJECT_CHECK(DSICommonDevice, (obj), TYPE_DSI_COMMON_DEVICE)
 
44
#define DSI_COMMON_DEVICE_CLASS(klass) \
 
45
    OBJECT_CLASS_CHECK(DSICommonDeviceClass, (klass), TYPE_DSI_COMMON_DEVICE)
 
46
#define DSI_COMMON_DEVICE_GET_CLASS(obj) \
 
47
    OBJECT_GET_CLASS(DSICommonDeviceClass, (obj), TYPE_DSI_COMMON_DEVICE)
 
48
 
 
49
 
 
50
 
 
51
/* device callbacks */
 
52
typedef int (*dsi_device_initfn)(DSIDevice *dev);
 
53
typedef void (*dsi_write_cb)(DSIDevice *dev, uint32_t data, int len);
 
54
typedef uint32_t (*dsi_read_cb)(DSIDevice *dev, uint32_t data, int len);
 
55
typedef int (*dsi_blt_cb)(DSIDevice *dev, void *data, int width, int height,
 
56
                          int col_pitch, int row_pitch, int format);
 
57
 
 
58
/* common device callbacks */
 
59
typedef void (*dsi_common_write_cb)(DSICommonDevice *dev, uint32_t data,
 
60
                                    int len);
 
61
typedef uint32_t (*dsi_common_read_cb)(DSICommonDevice *dev, uint32_t data,
 
62
                                       int len);
 
63
typedef void (*dsi_common_device_resetfn)(DSICommonDevice *dev);
 
64
typedef void (*dsi_powermode_changed_cb)(DSICommonDevice *dev);
 
65
typedef void (*dsi_temode_changed_cb)(DSICommonDevice *dev);
 
66
 
 
67
/* host callbacks */
 
68
typedef void (*dsi_te_trigger_cb)(DeviceState *dev, int vc);
 
69
typedef drawfn (*dsi_get_drawfn_cb)(const DeviceState *dev, int format,
 
70
                                    int bpp);
 
71
 
 
72
typedef struct {
 
73
    DeviceClass parent_class;
 
74
    dsi_device_initfn init;
 
75
    dsi_write_cb write;
 
76
    dsi_read_cb read;
 
77
    dsi_blt_cb blt;
 
78
} DSIDeviceClass;
 
79
 
 
80
typedef struct {
 
81
    DSIDeviceClass parent_class;
 
82
    dsi_common_write_cb write;
 
83
    dsi_common_read_cb read;
 
84
    dsi_common_device_resetfn reset;
 
85
    dsi_powermode_changed_cb powermode_changed;
 
86
    dsi_temode_changed_cb temode_changed;
 
87
} DSICommonDeviceClass;
 
88
 
 
89
struct DSIDevice {
 
90
    DeviceState qdev;
 
91
 
 
92
    /* internal fields used by DSI code */
 
93
    DSIHost *host;
 
94
    uint8_t vchannel;
 
95
    uint16_t max_return_size;
 
96
};
 
97
 
 
98
struct DSICommonDevice {
 
99
    DSIDevice dsi;
 
100
    enum { bs_cmd, bs_data } bs;
 
101
    uint8_t cmd;
 
102
    uint8_t powermode;
 
103
    uint8_t addrmode;
 
104
    uint8_t bpp_dpi;
 
105
    uint8_t bpp_dbi;
 
106
    uint8_t dr;
 
107
    uint32_t sc;
 
108
    uint32_t ec;
 
109
    uint32_t cc;
 
110
    uint32_t sp;
 
111
    uint32_t ep;
 
112
    uint32_t cp;
 
113
    enum {
 
114
        te_off = -1,
 
115
        te_vsync = 0,
 
116
        te_hvsync = 1
 
117
    } te_mode;
 
118
};
 
119
 
 
120
/* host functions */
 
121
DSIHost *dsi_init_host(DeviceState *parent, const char *name,
 
122
                       dsi_te_trigger_cb te_trigger_cb,
 
123
                       dsi_get_drawfn_cb get_drawfn_cb);
 
124
uint32_t dsi_short_write(DSIHost *host, uint32_t data);
 
125
void dsi_long_write(DSIHost *host, uint32_t header, uint32_t payload,
 
126
                    uint32_t counter);
 
127
int dsi_blt(DSIHost *host, int vc, void *data, int width, int height,
 
128
            int col_pitch, int row_pitch, int format);
 
129
 
 
130
/* device -> host functions */
 
131
void dsi_te_trigger(const DSIDevice *dev);
 
132
drawfn dsi_get_drawfn(const DSIDevice *dev, int format, int bpp);
 
133
 
 
134
#define DSI_DEVICE_FROM_QDEV(dev) DO_UPCAST(DSIDevice, qdev, dev)
 
135
#define DSI_COMMON_DEVICE_FROM_QDEV(dev) DO_UPCAST(DSICommonDevice, dsi, \
 
136
                                                   DSI_DEVICE_FROM_QDEV(dev))
 
137
#define FROM_DSI_DEVICE(type, dev) DO_UPCAST(type, dsi, dev)
 
138
 
 
139
DeviceState *dsi_create_device(DSIHost *host, const char *name, int vc);
 
140
DeviceState *dsi_create_device_noinit(DSIHost *host, const char *name, int vc);
 
141
DeviceState *dsi_create_common_device(DSIHost *host, const char *name, int vc);
 
142
DeviceState *dsi_create_common_device_noinit(DSIHost *host, const char *name,
 
143
                                             int vc);
 
144
 
 
145
#endif