Changeset 68848 in vbox for trunk/src/VBox/Additions/linux
- Timestamp:
- Sep 24, 2017 4:58:46 PM (7 years ago)
- Location:
- trunk/src/VBox/Additions/linux/drm
- Files:
-
- 1 deleted
- 4 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/drm/files_vboxvideo_drv
r68769 r68848 31 31 ${PATH_ROOT}/src/VBox/Additions/common/VBoxVideo/Modesetting.cpp=>modesetting.c \ 32 32 ${PATH_ROOT}/src/VBox/Additions/common/VBoxVideo/VBVABase.cpp=>vbva_base.c \ 33 ${PATH_ROOT}/src/VBox/Additions/linux/drm/HGSMIBase.h=>hgsmi_base.h \34 ${PATH_ROOT}/src/VBox/Additions/linux/drm/VBoxVideoIPRT.h=>vboxvideo_iprt.h \35 33 ${PATH_ROOT}/src/VBox/Additions/linux/drm/vbox_drv.c=>vbox_drv.c \ 36 34 ${PATH_ROOT}/src/VBox/Additions/linux/drm/vbox_drv.h=>vbox_drv.h \ 35 ${PATH_ROOT}/src/VBox/Additions/linux/drm/vbox_err.h=>vbox_err.h \ 37 36 ${PATH_ROOT}/src/VBox/Additions/linux/drm/vbox_fb.c=>vbox_fb.c \ 38 37 ${PATH_ROOT}/src/VBox/Additions/linux/drm/vbox_irq.c=>vbox_irq.c \ -
trunk/src/VBox/Additions/linux/drm/indent.sed
r68769 r68848 23 23 24 24 # Replace up to six leading groups of four spaces with tabs. 25 s/^ /\t\t\t\t\t\t/g25 s/^ */\t\t\t\t\t\t/g 26 26 s/^ /\t\t\t\t\t/g 27 27 s/^ /\t\t\t\t/g … … 29 29 s/^ /\t\t/g 30 30 s/^ /\t/g 31 # Remove any spaces left after the tabs. This also limits maximum indentation.32 s/^\(\t\t*\) */\1/g33 31 34 32 # Change various symbols and file names to fit kernel conventions. 35 33 34 # Miscellaneous: 35 # Remove @file headers. 36 \|/\*\* @file| { 37 :start 38 N 39 s|\*/|\*/|g 40 T start 41 N 42 d 43 } 44 /^\/\* \$Id:.*\*\/$/d 45 /^typedef .* HGSMIOFFSET;$/d 46 s/^#\( *\)include <\([^/]*\)>$/#\1include "\2"/g 47 36 48 # File names: 37 s/\bHGSMIBase\.h\b/ hgsmi_base.h/g49 s/\bHGSMIBase\.h\b/vbox_drv.h/g 38 50 s/\bHGSMIChannels\.h\b/hgsmi_channels.h/g 39 51 s/\bHGSMIChSetup\.h\b/hgsmi_ch_setup.h/g … … 42 54 s/\bVBoxVideoGuest\.h\b/vboxvideo_guest.h/g 43 55 s/\bVBoxVideo\.h\b/vboxvideo.h/g 44 s/\bVBoxVideoIPRT\.h\b/vbox video_iprt.h/g56 s/\bVBoxVideoIPRT\.h\b/vbox_err.h/g 45 57 s/\bVBoxVideoVBE\.h\b/vboxvideo_vbe.h/g 46 58 … … 69 81 s/\bvboxVBVAInformHost\b/vbva_inform_host/g 70 82 s/\bvboxVBVASetupBufferContext\b/vbva_setup_buffer_context/g 83 s/\bVBVO_PORT_READ_U8\b/inb/g 84 s/\bVBVO_PORT_READ_U16\b/inw/g 85 s/\bVBVO_PORT_READ_U32\b/inl/g 86 s/\bVBVO_PORT_WRITE_U8\b/outb/g 87 s/\bVBVO_PORT_WRITE_U16\b/outw/g 88 s/\bVBVO_PORT_WRITE_U32\b/outl/g 71 89 72 90 # Macros: 91 s/\b_1K\b/1024/g 92 s/\b_4M\b/4*1024*1024/g 93 s/\bAssert\b\([^;]*\);$/WARN_ON_ONCE(!(\1));/g 94 s/\bAssertCompile\b/assert_compile/g 95 s/\bAssertCompileSize\b/assert_compile_size/g 96 s/\bAssertPtr\b\([^;]*\);$/WARN_ON_ONCE(!(\1));/g 97 /AssertPtrNullReturnVoid/d 98 s/\bAssertRC\b\([^;]*\);$/WARN_ON_ONCE(RT_FAILURE\1);/g 99 s/\bDECLCALLBACK\b(\([^)]*\))/\1/g 100 s/\bDECLCALLBACKMEMBER\b(\([^,)]*\), *\([^,)]*\))/\1 (*\2)/g 101 s/^\bDECLHIDDEN\b(\([^)]*\))/\1/g 102 s/\bDECLINLINE\b(\([^)]*\))/static inline \1/g 103 s/\bRT_BIT\b/BIT/g 104 s/\bRT_BOOL\b(\([^)]*\))/(!!(\1))/g 105 /RT_C_DECLS/d 106 s/\bUINT16_MAX\b/U16_MAX/g 107 s/\bUINT32_MAX\b/U32_MAX/g 108 s/\bUINT32_C\b(\(.*\))/\1u/g 73 109 s/!VALID_PTR(/WARN_ON(!/g 74 110 75 111 # Type names: 76 112 s/\bint32_t\b/s32/g 113 s/\buint8_t\b/u8/g 77 114 s/\buint16_t\b/u16/g 78 115 s/\buint32_t\b/u32/g 116 s/(HGSMIBUFFERLOCATION \*)//g # Remove C++ casts from void. 117 s/typedef struct HGSMIBUFFERLOCATION/struct hgsmi_buffer_location/g 79 118 s/struct HGSMIBUFFERLOCATION/struct hgsmi_buffer_location/g 80 s/} HGSMIBUFFERLOCATION/} hgsmi_buffer_location/g119 s/} HGSMIBUFFERLOCATION/}/g 81 120 s/\bHGSMIBUFFERLOCATION\b/struct hgsmi_buffer_location/g 121 s/\([^*] *\)\bPHGSMIGUESTCOMMANDCONTEXT\b/\1struct gen_pool */g 122 s/(HGSMIHOSTFLAGS \*)//g # Remove C++ casts from void. 123 s/typedef struct HGSMIHOSTFLAGS/struct hgsmi_host_flags/g 124 s/struct HGSMIHOSTFLAGS/struct hgsmi_host_flags/g 125 s/} HGSMIHOSTFLAGS/}/g 126 s/\bHGSMIHOSTFLAGS\b/struct hgsmi_host_flags/g 127 s/\bHGSMIOFFSET\b/u32/g 128 s/\bHGSMISIZE\b/u32/g 129 s/\bRTRECT\b/void/g 130 s/(VBVABUFFERCONTEXT \*)//g # Remove C++ casts from void. 82 131 s/struct VBVABUFFERCONTEXT/struct vbva_buf_context/g 83 132 s/} VBVABUFFERCONTEXT/} vbva_buf_context/g 84 133 s/\bVBVABUFFERCONTEXT\b/struct vbva_buf_context/g 85 134 s/\([^*] *\)\bPVBVABUFFERCONTEXT\b/\1struct vbva_buf_context */g 135 s/(VBVACAPS \*)//g # Remove C++ casts from void. 136 s/struct VBVACAPS/struct vbva_caps/g 137 s/} VBVACAPS/} vbva_caps/g 138 s/\bVBVACAPS\b/struct vbva_caps/g 139 s/(VBVACONF32 \*)//g # Remove C++ casts from void. 86 140 s/struct VBVACONF32/struct vbva_conf32/g 87 141 s/} VBVACONF32/} vbva_conf32/g 88 142 s/\bVBVACONF32\b/struct vbva_conf32/g 143 s/(VBVACURSORPOSITION \*)//g # Remove C++ casts from void. 89 144 s/struct VBVACURSORPOSITION/struct vbva_cursor_position/g 90 145 s/} VBVACURSORPOSITION/} vbva_cursor_position/g 91 146 s/\bVBVACURSORPOSITION\b/struct vbva_cursor_position/g 147 s/(VBVAENABLE_EX \*)//g # Remove C++ casts from void. 92 148 s/struct VBVAENABLE_EX/struct vbva_enable_ex/g 93 149 s/} VBVAENABLE_EX/} vbva_enable_ex/g 94 150 s/\bVBVAENABLE_EX\b/struct vbva_enable_ex/g 151 s/(VBVAMOUSEPOINTERSHAPE \*)//g # Remove C++ casts from void. 95 152 s/struct VBVAMOUSEPOINTERSHAPE/struct vbva_mouse_pointer_shape/g 96 153 s/} VBVAMOUSEPOINTERSHAPE/} vbva_mouse_pointer_shape/g 97 154 s/\bVBVAMOUSEPOINTERSHAPE\b/struct vbva_mouse_pointer_shape/g 155 s/(VBVAMODEHINT \*)//g # Remove C++ casts from void. 98 156 s/struct VBVAMODEHINT/struct vbva_modehint/g 99 157 s/} VBVAMODEHINT/} vbva_modehint/g 100 158 s/\bVBVAMODEHINT\b/struct vbva_modehint/g 159 s/(VBVAQUERYMODEHINTS \*)//g # Remove C++ casts from void. 101 160 s/struct VBVAQUERYMODEHINTS/struct vbva_query_mode_hints/g 102 161 s/} VBVAQUERYMODEHINTS/} vbva_query_mode_hints/g 103 162 s/\bVBVAQUERYMODEHINTS\b/struct vbva_query_mode_hints/g 163 s/(VBVAREPORTINPUTMAPPING \*)//g # Remove C++ casts from void. 104 164 s/struct VBVAREPORTINPUTMAPPING/struct vbva_report_input_mapping/g 105 165 s/} VBVAREPORTINPUTMAPPING/} vbva_report_input_mapping/g … … 109 169 s/\baRecords\b/records/g 110 170 s/\bau8Data\b/data/g 171 s/\bau32Reserved\b/reserved/g 111 172 s/\bBase\b/base/g 112 173 s/\bbEnable\b/enable/g … … 119 180 s/\bcbHwBufferAvail\b/available/g 120 181 s/\bcbLength\b/len/g 182 s/\bcbLocation\b/buf_len/g 121 183 s/\bcbPartialWriteThreshold\b/partial_write_tresh/g ## @todo fix this? 122 184 s/\bcbPitch\b/pitch/g 185 s/\bcbPixels\b/pixel_len/g 123 186 s/\bcBPP\b/bpp/g 124 187 s/\bcbRecord\b/len_and_flags/g ## @todo fix this? … … 165 228 s/\bu32Height\b/height/g 166 229 s/\bu32HostEvents\b/host_events/g 230 s/\bu32HostFlags\b/host_flags/g 167 231 s/\bu32HotX\b/hot_x/g 168 232 s/\bu32HotY\b/hot_y/g … … 179 243 s/\bulValue\b/value/g 180 244 245 # Header file guard: 246 s/__HGSMIChannels_h__/__HGSMI_CHANNELS_H__/g 247 s/___VBox_Graphics_HGSMIChSetup_h/__HGSMI_CH_SETUP_H__/g 248 181 249 # And move braces. This must be the last expression as it jumps to the next 182 250 # line. … … 190 258 :try_brace 191 259 s/^\([\t ].*\)\n[\t ][\t ]*{/\1 {/g 260 s/^\([^#()]*\)\n[\t ]*{/\1 {/g 192 261 t done_brace 193 262 P -
trunk/src/VBox/Additions/linux/drm/vbox_drv.h
r68337 r68848 38 38 #define LOG_GROUP LOG_GROUP_DEV_VGA 39 39 40 #include < VBoxVideoGuest.h>41 42 #i nclude <drm/drmP.h>43 # include <drm/drm_fb_helper.h>44 45 # include <drm/ttm/ttm_bo_api.h>46 #include <drm/ttm/ttm_bo_driver.h> 47 #include < drm/ttm/ttm_placement.h>48 #include < drm/ttm/ttm_memory.h>49 #include < drm/ttm/ttm_module.h>40 #include <linux/version.h> 41 42 #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0) 43 # include <linux/types.h> 44 # include <linux/spinlock_types.h> 45 #endif 46 47 #include <linux/genalloc.h> 48 #include <linux/io.h> 49 #include <linux/string.h> 50 50 51 51 #if defined(RHEL_MAJOR) && defined(RHEL_MINOR) … … 58 58 #endif 59 59 60 #include <drm/drmP.h> 60 61 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0) || defined(RHEL_73) 61 62 #include <drm/drm_gem.h> 62 63 #endif 64 #include <drm/drm_fb_helper.h> 63 65 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) 64 66 #include <drm/drm_encoder.h> 65 67 #endif 68 69 #include <drm/ttm/ttm_bo_api.h> 70 #include <drm/ttm/ttm_bo_driver.h> 71 #include <drm/ttm/ttm_placement.h> 72 #include <drm/ttm/ttm_memory.h> 73 #include <drm/ttm/ttm_module.h> 74 75 #include "vboxvideo_guest.h" 76 #include "vboxvideo_vbe.h" 77 #include "hgsmi_ch_setup.h" 66 78 67 79 #include "product-generated.h" … … 341 353 irqreturn_t vbox_irq_handler(int irq, void *arg); 342 354 343 #endif 355 /* vbox_hgsmi.c */ 356 void *hgsmi_buffer_alloc(struct gen_pool *guest_pool, size_t size, 357 u8 channel, u16 channel_info); 358 void hgsmi_buffer_free(struct gen_pool *guest_pool, void *buf); 359 int hgsmi_buffer_submit(struct gen_pool *guest_pool, void *buf); 360 361 static inline void vbox_write_ioport(u16 index, u16 data) 362 { 363 outw(index, VBE_DISPI_IOPORT_INDEX); 364 outw(data, VBE_DISPI_IOPORT_DATA); 365 } 366 367 #endif -
trunk/src/VBox/Additions/linux/drm/vbox_err.h
r68847 r68848 26 26 */ 27 27 28 #ifndef ___VBox_Graphic_VBoxVideoIPRT_h 29 #define ___VBox_Graphic_VBoxVideoIPRT_h 30 31 #include <asm/io.h> 32 #include <linux/string.h> 33 #include <linux/version.h> 28 #ifndef __VBOX_ERR_H__ 29 #define __VBOX_ERR_H__ 34 30 35 31 /** @name VirtualBox error macros … … 55 51 /** @} */ 56 52 57 /** @name VirtualBox helper functions53 /** @name VirtualBox assertions 58 54 * @{ */ 59 55 60 #define ASMCompilerBarrier() mb() 56 /* Unlike BUILD_BUG_ON(), these can be used outside of functions. */ 57 extern int vbox_assert_var[1]; 58 #define assert_compile(expr) \ 59 extern int vbox_assert_var[1] __attribute__((__unused__)), \ 60 vbox_assert_var[(expr) ? 1 : 0] __attribute__((__unused__)) 61 #define assert_compile_size(type, size) \ 62 assert_compile(sizeof(type) == (size)) 61 63 62 64 /** @} */ 63 65 64 /** @name VirtualBox assertions 65 * @{ */ 66 67 #define Assert(a) WARN_ON_ONCE(!(a)) 68 #define AssertPtr(a) WARN_ON_ONCE(!(a)) 69 #define AssertReturnVoid(a) do { if (WARN_ON_ONCE(!(a))) return; } while(0) 70 #define AssertRC(a) WARN_ON_ONCE(RT_FAILURE(a)) 71 #define AssertPtrNullReturnVoid(a) do {} while(0) 72 #define AssertPtrReturnVoid(a) do { if (WARN_ON_ONCE(!(a))) return; } while(0) 73 74 extern int RTASSERTVAR[1]; 75 #define AssertCompile(expr) \ 76 extern int RTASSERTVAR[1] __attribute__((__unused__)), \ 77 RTASSERTVAR[(expr) ? 1 : 0] __attribute__((__unused__)) 78 #define AssertCompileSize(type, size) \ 79 AssertCompile(sizeof(type) == (size)) 80 81 #define VALID_PTR(p) ((p) != NULL) 82 83 /** @} */ 84 85 /** @name Port I/O helpers 86 * @{ */ 87 /** Write an 8-bit value to an I/O port. */ 88 #define VBVO_PORT_WRITE_U8(Port, Value) \ 89 outb(Value, Port) 90 /** Write a 16-bit value to an I/O port. */ 91 #define VBVO_PORT_WRITE_U16(Port, Value) \ 92 outw(Value, Port) 93 /** Write a 32-bit value to an I/O port. */ 94 #define VBVO_PORT_WRITE_U32(Port, Value) \ 95 outl(Value, Port) 96 /** Read an 8-bit value from an I/O port. */ 97 #define VBVO_PORT_READ_U8(Port) \ 98 inb(Port) 99 /** Read a 16-bit value from an I/O port. */ 100 #define VBVO_PORT_READ_U16(Port) \ 101 inw(Port) 102 /** Read a 32-bit value from an I/O port. */ 103 #define VBVO_PORT_READ_U32(Port) \ 104 inl(Port) 105 106 /** @} */ 107 108 /** @name types for VirtualBox OS-independent code 109 * @{ */ 110 111 typedef void RTRECT; 112 113 #define UINT32_C(val) (val ## U) 114 #define UINT32_MAX UINT32_C(0xffffffff) 115 116 /** @} */ 117 118 /** @name iprt/desc.h replacement macros 119 * @{ */ 120 121 #define RT_C_DECLS_BEGIN 122 #define RT_C_DECLS_END 123 #define DECLCALLBACK(type) type 124 #define DECLCALLBACKMEMBER(type, name) type (*name) 125 #define DECLHIDDEN(type) __attribute__((visibility("hidden"))) type 126 #define DECLINLINE(type) static __inline__ type 127 #define RT_BOOL(val) (!!(val)) 128 #define RT_BIT BIT 129 #define _1K 0x00000400 130 131 /** @} */ 132 133 #endif /* !___VBox_Graphic_VBoxVideoIPRT_h */ 134 66 #endif -
trunk/src/VBox/Additions/linux/drm/vbox_mode.c
r68334 r68848 38 38 */ 39 39 #include "vbox_drv.h" 40 41 #include <VBoxVideo.h>42 43 40 #include <linux/export.h> 44 41 #include <drm/drm_crtc_helper.h> … … 46 43 #include <drm/drm_plane_helper.h> 47 44 #endif 45 46 #include "VBoxVideo.h" 47 #include "hgsmi_channels.h" 48 48 49 49 static int vbox_cursor_set2(struct drm_crtc *crtc, struct drm_file *file_priv,
Note:
See TracChangeset
for help on using the changeset viewer.