VirtualBox

Changeset 68769 in vbox for trunk/src/VBox/Additions/linux


Ignore:
Timestamp:
Sep 14, 2017 6:37:25 PM (7 years ago)
Author:
vboxsync
Message:

Additions/linux/drm: translate file names and identifiers to kernel style.
bugref:8524: Additions/linux: play nicely with distribution-installed Additions

Use a sed script to translate identifiers inside the drm driver files from
VirtualBox style to kernel style when we install them to the Additions
installation archive. This lets us keep our own coding style inside our
source tree and still be able to easily compare the driver against the
in-kernel version.

Location:
trunk/src/VBox/Additions/linux/drm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/linux/drm/files_vboxvideo_drv

    r68306 r68769  
    2121    ${PATH_OUT}/revision-generated.h=>revision-generated.h \
    2222    ${PATH_OUT}/product-generated.h=>product-generated.h \
    23     ${PATH_ROOT}/include/VBox/Graphics/VBoxVideo.h=>VBoxVideo.h \
    24     ${PATH_ROOT}/include/VBox/Graphics/VBoxVideoGuest.h=>VBoxVideoGuest.h \
    25     ${PATH_ROOT}/include/VBox/Graphics/HGSMIChannels.h=>HGSMIChannels.h \
    26     ${PATH_ROOT}/include/VBox/Graphics/HGSMIChSetup.h=>HGSMIChSetup.h \
    27     ${PATH_ROOT}/include/VBox/Graphics/HGSMIContext.h=>HGSMIContext.h \
    28     ${PATH_ROOT}/include/VBox/Graphics/HGSMIDefs.h=>HGSMIDefs.h \
    29     ${PATH_ROOT}/include/VBox/Graphics/VBoxVideoVBE.h=>VBoxVideoVBE.h \
     23    ${PATH_ROOT}/include/VBox/Graphics/VBoxVideo.h=>vboxvideo.h \
     24    ${PATH_ROOT}/include/VBox/Graphics/VBoxVideoGuest.h=>vboxvideo_guest.h \
     25    ${PATH_ROOT}/include/VBox/Graphics/HGSMIChannels.h=>hgsmi_channels.h \
     26    ${PATH_ROOT}/include/VBox/Graphics/HGSMIChSetup.h=>hgsmi_ch_setup.h \
     27    ${PATH_ROOT}/include/VBox/Graphics/HGSMIContext.h=>hgsmi_context.h \
     28    ${PATH_ROOT}/include/VBox/Graphics/HGSMIDefs.h=>hgsmi_defs.h \
     29    ${PATH_ROOT}/include/VBox/Graphics/VBoxVideoVBE.h=>vboxvideo_vbe.h \
    3030    ${PATH_ROOT}/src/VBox/Additions/common/VBoxVideo/HGSMIBase.cpp=>hgsmi_base.c \
    3131    ${PATH_ROOT}/src/VBox/Additions/common/VBoxVideo/Modesetting.cpp=>modesetting.c \
    3232    ${PATH_ROOT}/src/VBox/Additions/common/VBoxVideo/VBVABase.cpp=>vbva_base.c \
    33     ${PATH_ROOT}/src/VBox/Additions/linux/drm/HGSMIBase.h=>include/HGSMIBase.h \
    34     ${PATH_ROOT}/src/VBox/Additions/linux/drm/VBoxVideoIPRT.h=>include/VBoxVideoIPRT.h \
     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 \
    3535    ${PATH_ROOT}/src/VBox/Additions/linux/drm/vbox_drv.c=>vbox_drv.c \
    3636    ${PATH_ROOT}/src/VBox/Additions/linux/drm/vbox_drv.h=>vbox_drv.h \
  • trunk/src/VBox/Additions/linux/drm/indent.sed

    r68308 r68769  
    3131# Remove any spaces left after the tabs.  This also limits maximum indentation.
    3232s/^\(\t\t*\) */\1/g
     33
     34# Change various symbols and file names to fit kernel conventions.
     35
     36# File names:
     37s/\bHGSMIBase\.h\b/hgsmi_base.h/g
     38s/\bHGSMIChannels\.h\b/hgsmi_channels.h/g
     39s/\bHGSMIChSetup\.h\b/hgsmi_ch_setup.h/g
     40s/\bHGSMIContext\.h\b/hgsmi_context.h/g
     41s/\bHGSMIDefs\.h\b/hgsmi_defs.h/g
     42s/\bVBoxVideoGuest\.h\b/vboxvideo_guest.h/g
     43s/\bVBoxVideo\.h\b/vboxvideo.h/g
     44s/\bVBoxVideoIPRT\.h\b/vboxvideo_iprt.h/g
     45s/\bVBoxVideoVBE\.h\b/vboxvideo_vbe.h/g
     46
     47# Function names:
     48s/\btestQueryConf\b/hgsmi_test_query_conf/g
     49s/\bVBoxHGSMIBufferAlloc\b/hgsmi_buffer_alloc/g
     50s/\bVBoxHGSMIBufferFree\b/hgsmi_buffer_free/g
     51s/\bVBoxHGSMIBufferSubmit\b/hgsmi_buffer_submit/g
     52s/\bVBoxHGSMICursorPosition\b/hgsmi_cursor_position/g
     53s/\bVBoxHGSMIGetModeHints\b/hgsmi_get_mode_hints/g
     54s/\bVBoxHGSMIProcessDisplayInfo\b/hgsmi_process_display_info/g
     55s/\bVBoxHGSMIReportFlagsLocation\b/hgsmi_report_flags_location/g
     56s/\bVBoxHGSMISendCapsInfo\b/hgsmi_send_caps_info/g
     57s/\bVBoxHGSMIUpdateInputMapping\b/hgsmi_update_input_mapping/g
     58s/\bVBoxHGSMIUpdatePointerShape\b/hgsmi_update_pointer_shape/g
     59s/\bvboxHwBufferAvail\b/vbva_buffer_available/g
     60s/\bvboxHwBufferEndUpdate\b/vbva_buffer_end_update/g
     61s/\bvboxHwBufferFlush\b/vbva_buffer_flush/g
     62s/\bvboxHwBufferPlaceDataAt\b/vbva_buffer_place_data_at/g
     63s/\bvboxHwBufferWrite\b/vbva_write/g
     64s/\bVBoxQueryConfHGSMI\b/hgsmi_query_conf/g
     65s/\bVBoxVBVABufferBeginUpdate\b/vbva_buffer_begin_update/g
     66s/\bVBoxVBVABufferEndUpdate\b/vbva_buffer_end_update/g
     67s/\bVBoxVBVADisable\b/vbva_disable/g
     68s/\bVBoxVBVAEnable\b/vbva_enable/g
     69s/\bvboxVBVAInformHost\b/vbva_inform_host/g
     70s/\bvboxVBVASetupBufferContext\b/vbva_setup_buffer_context/g
     71
     72# Macros:
     73s/!VALID_PTR(/WARN_ON(!/g
     74
     75# Type names:
     76s/\bint32_t\b/s32/g
     77s/\buint16_t\b/u16/g
     78s/\buint32_t\b/u32/g
     79s/struct HGSMIBUFFERLOCATION/struct hgsmi_buffer_location/g
     80s/} HGSMIBUFFERLOCATION/} hgsmi_buffer_location/g
     81s/\bHGSMIBUFFERLOCATION\b/struct hgsmi_buffer_location/g
     82s/struct VBVABUFFERCONTEXT/struct vbva_buf_context/g
     83s/} VBVABUFFERCONTEXT/} vbva_buf_context/g
     84s/\bVBVABUFFERCONTEXT\b/struct vbva_buf_context/g
     85s/\([^*] *\)\bPVBVABUFFERCONTEXT\b/\1struct vbva_buf_context */g
     86s/struct VBVACONF32/struct vbva_conf32/g
     87s/} VBVACONF32/} vbva_conf32/g
     88s/\bVBVACONF32\b/struct vbva_conf32/g
     89s/struct VBVACURSORPOSITION/struct vbva_cursor_position/g
     90s/} VBVACURSORPOSITION/} vbva_cursor_position/g
     91s/\bVBVACURSORPOSITION\b/struct vbva_cursor_position/g
     92s/struct VBVAENABLE_EX/struct vbva_enable_ex/g
     93s/} VBVAENABLE_EX/} vbva_enable_ex/g
     94s/\bVBVAENABLE_EX\b/struct vbva_enable_ex/g
     95s/struct VBVAMOUSEPOINTERSHAPE/struct vbva_mouse_pointer_shape/g
     96s/} VBVAMOUSEPOINTERSHAPE/} vbva_mouse_pointer_shape/g
     97s/\bVBVAMOUSEPOINTERSHAPE\b/struct vbva_mouse_pointer_shape/g
     98s/struct VBVAMODEHINT/struct vbva_modehint/g
     99s/} VBVAMODEHINT/} vbva_modehint/g
     100s/\bVBVAMODEHINT\b/struct vbva_modehint/g
     101s/struct VBVAQUERYMODEHINTS/struct vbva_query_mode_hints/g
     102s/} VBVAQUERYMODEHINTS/} vbva_query_mode_hints/g
     103s/\bVBVAQUERYMODEHINTS\b/struct vbva_query_mode_hints/g
     104s/struct VBVAREPORTINPUTMAPPING/struct vbva_report_input_mapping/g
     105s/} VBVAREPORTINPUTMAPPING/} vbva_report_input_mapping/g
     106s/\bVBVAREPORTINPUTMAPPING\b/struct vbva_report_input_mapping/g
     107
     108# Variable and parameter names:
     109s/\baRecords\b/records/g
     110s/\bau8Data\b/data/g
     111s/\bBase\b/base/g
     112s/\bbEnable\b/enable/g
     113s/\bbRc\b/ret/g
     114s/\bcb\b/len/g
     115s/\bcbBuffer\b/buffer_length/g
     116s/\bcbChunk\b/chunk/g
     117s/\bcbData\b/data_len/g
     118s/\bcbHintsStructureGuest\b/hints_structure_guest_size/g
     119s/\bcbHwBufferAvail\b/available/g
     120s/\bcbLength\b/len/g
     121s/\bcbPartialWriteThreshold\b/partial_write_tresh/g  ## @todo fix this?
     122s/\bcbPitch\b/pitch/g
     123s/\bcBPP\b/bpp/g
     124s/\bcbRecord\b/len_and_flags/g  ## @todo fix this?
     125s/\bcDisplay\b/display/g
     126s/\bcHeight\b/height/g
     127s/\bcHintsQueried\b/hints_queried_count/g
     128s/\bcHotX\b/hot_x/g
     129s/\bcHotY\b/hot_y/g
     130s/\bcOriginX\b/origin_x/g
     131s/\bcOriginY\b/origin_y/g
     132s/\bcScreen\b/screen/g
     133s/\bcScreens\b/screens/g
     134s/\bcWidth\b/width/g
     135s/\bfCaps\b/caps/g
     136s/\bfFlags\b/flags/g
     137s/\bfHwBufferOverflow\b/buffer_overflow/g
     138s/\bfReportPosition\b/report_position/g
     139s/\bfu32Flags\b/flags/g
     140s/\bhostFlags\b/host_flags/g
     141s/\bi32Diff\b/diff/g
     142s/\bi32OriginX\b/origin_x/g
     143s/\bi32OriginY\b/origin_y/g
     144s/\bi32Result\b/result/g
     145s/\bindexRecordFirst\b/first_record_index/g
     146s/\bindexRecordFree\b/free_record_index/g
     147s/\bindexRecordNext\b/next/g
     148s/\boff32Data\b/data_offset/g
     149s/\boff32Free\b/free_offset/g
     150s/\boffLocation\b/location/g
     151s/\boffStart\b/start_offset/g
     152s/\boffVRAMBuffer\b/buffer_offset/g
     153s/\bpaHints\b/hints/g
     154s/\bpCtx\b/ctx/g
     155s/\bpPixels\b/pixels/g
     156s/\bpRecord\b/record/g
     157s/\bpulValue\b/value_ret/g
     158s/\bpVBVA\b/vbva/g
     159s/\bpxHost\b/x_host/g
     160s/\bpyHost\b/y_host/g
     161s/\bu16BitsPerPixel\b/bits_per_pixel/g
     162s/\bu16Flags\b/flags/g
     163s/\bu32BytesTillBoundary\b/bytes_till_boundary/g
     164s/\bu32Flags\b/flags/g
     165s/\bu32Height\b/height/g
     166s/\bu32HostEvents\b/host_events/g
     167s/\bu32HotX\b/hot_x/g
     168s/\bu32HotY\b/hot_y/g
     169s/\bu32Index\b/index/g
     170s/\bu32LineSize\b/line_size/g
     171s/\bu32Offset\b/offset/g
     172s/\bu32Reserved\b/reserved/g
     173s/\bu32ScreenId\b/screen_id/g
     174s/\bu32StartOffset\b/start_offset/g
     175s/\bu32SupportedOrders\b/supported_orders/g
     176s/\bu32Value\b/value/g
     177s/\bu32ViewIndex\b/view_index/g
     178s/\bu32Width\b/width/g
     179s/\bulValue\b/value/g
     180
    33181# And move braces.  This must be the last expression as it jumps to the next
    34182# line.
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette