VirtualBox

Ignore:
Timestamp:
Aug 11, 2020 7:17:09 PM (4 years ago)
Author:
vboxsync
Message:

Add/linux/vboxvideo: Use RTLNX_RHEL_* macros, eliminating the RHEL_XY ones.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/linux/drm/vbox_mode.c

    r85704 r85705  
    4040#include <linux/export.h>
    4141#include <drm/drm_crtc_helper.h>
    42 #if RTLNX_VER_MIN(3,18,0) || defined(RHEL_72)
     42#if RTLNX_VER_MIN(3,18,0) || RTLNX_RHEL_MAJ_PREREQ(7,2)
    4343#include <drm/drm_plane_helper.h>
    4444#endif
    45 #if RTLNX_VER_MIN(5,1,0) || defined(RHEL_81)
     45#if RTLNX_VER_MIN(5,1,0) || RTLNX_RHEL_MAJ_PREREQ(8,1)
    4646#include <drm/drm_probe_helper.h>
    4747#endif
     
    7070        width = mode->hdisplay ? mode->hdisplay : 640;
    7171        height = mode->vdisplay ? mode->vdisplay : 480;
    72 #if RTLNX_VER_MIN(4,11,0) || defined(RHEL_75)
     72#if RTLNX_VER_MIN(4,11,0) || RTLNX_RHEL_MAJ_PREREQ(7,5)
    7373        bpp = crtc->enabled ? CRTC_FB(crtc)->format->cpp[0] * 8 : 32;
    7474        pitch = crtc->enabled ? CRTC_FB(crtc)->pitches[0] : width * bpp / 8;
     
    9494                VBoxVideoSetModeRegisters(
    9595                        width, height, pitch * 8 / bpp,
    96 #if RTLNX_VER_MIN(4,11,0) || defined(RHEL_75)
     96#if RTLNX_VER_MIN(4,11,0) || RTLNX_RHEL_MAJ_PREREQ(7,5)
    9797                        CRTC_FB(crtc)->format->cpp[0] * 8,
    9898#else
     
    285285static int vbox_crtc_page_flip(struct drm_crtc *crtc,
    286286                               struct drm_framebuffer *fb,
    287 #if RTLNX_VER_MIN(4,12,0) || defined(RHEL_75)
     287#if RTLNX_VER_MIN(4,12,0) || RTLNX_RHEL_MAJ_PREREQ(7,5)
    288288                               struct drm_pending_vblank_event *event,
    289289                               uint32_t page_flip_flags,
    290290                               struct drm_modeset_acquire_ctx *ctx)
    291 #elif RTLNX_VER_MIN(3,12,0) || defined(RHEL_70)
     291#elif RTLNX_VER_MIN(3,12,0) || RTLNX_RHEL_MAJ_PREREQ(7,0)
    292292                               struct drm_pending_vblank_event *event,
    293293                               uint32_t page_flip_flags)
     
    311311
    312312        if (event)
    313 #if RTLNX_VER_MIN(3,19,0) || defined(RHEL_72)
     313#if RTLNX_VER_MIN(3,19,0) || RTLNX_RHEL_MAJ_PREREQ(7,2)
    314314                drm_crtc_send_vblank_event(crtc, event);
    315315#else
     
    386386}
    387387
    388 #if RTLNX_VER_MAX(3,13,0) && !defined(RHEL_71)
     388#if RTLNX_VER_MAX(3,13,0) && !RTLNX_RHEL_MAJ_PREREQ(7,1)
    389389static struct drm_encoder *drm_encoder_find(struct drm_device *dev, u32 id)
    390390{
     
    410410        /* pick the encoder ids */
    411411        if (enc_id)
    412 # if RTLNX_VER_MIN(4,15,0) || \
    413      (defined(CONFIG_SUSE_VERSION) && \
    414          RTLNX_VER_MIN(4,12,0)) || \
    415      defined(RHEL_76)
     412# if RTLNX_VER_MIN(4,15,0) \
     413  || RTLNX_RHEL_MAJ_PREREQ(7,6) \
     414  || (defined(CONFIG_SUSE_VERSION) && RTLNX_VER_MIN(4,12,0))
    416415                return drm_encoder_find(connector->dev, NULL, enc_id);
    417416# else
     
    469468
    470469        drm_encoder_init(dev, &vbox_encoder->base, &vbox_enc_funcs,
    471 #if RTLNX_VER_MIN(4,5,0) || defined(RHEL_73)
     470#if RTLNX_VER_MIN(4,5,0) || RTLNX_RHEL_MAJ_PREREQ(7,3)
    472471                         DRM_MODE_ENCODER_DAC, NULL);
    473472#else
     
    549548        edid[EDID_SIZE - 1] = (0x100 - (sum & 0xFF)) & 0xFF;
    550549#if RTLNX_VER_MIN(4,19,0) || defined(OPENSUSE_151) || defined(OPENSUSE_125) \
    551   || defined(RHEL_77) || defined(RHEL_81)
     550  || RTLNX_RHEL_MAJ_PREREQ(7,7) || RTLNX_RHEL_MAJ_PREREQ(8,1)
    552551        drm_connector_update_edid_property(connector, (struct edid *)edid);
    553552#else
     
    607606        vbox_set_edid(connector, preferred_width, preferred_height);
    608607
    609 #if RTLNX_VER_MIN(3,19,0) || defined(RHEL_72)
     608#if RTLNX_VER_MIN(3,19,0) || RTLNX_RHEL_MAJ_PREREQ(7,2)
    610609        if (vbox_connector->vbox_crtc->x_hint != -1)
    611610                drm_object_property_set_value(&connector->base,
     
    628627}
    629628
    630 #if RTLNX_VER_MAX(3,14,0) && !defined(RHEL_71)
     629#if RTLNX_VER_MAX(3,14,0) && !RTLNX_RHEL_MAJ_PREREQ(7,1)
    631630static int vbox_mode_valid(struct drm_connector *connector,
    632631#else
     
    640639static void vbox_connector_destroy(struct drm_connector *connector)
    641640{
    642 #if RTLNX_VER_MAX(3,17,0) && !defined(RHEL_72)
     641#if RTLNX_VER_MAX(3,17,0) && !RTLNX_RHEL_MAJ_PREREQ(7,2)
    643642        drm_sysfs_connector_remove(connector);
    644643#else
     
    711710        connector->doublescan_allowed = 0;
    712711
    713 #if RTLNX_VER_MIN(3,19,0) || defined(RHEL_72)
     712#if RTLNX_VER_MIN(3,19,0) || RTLNX_RHEL_MAJ_PREREQ(7,2)
    714713        drm_mode_create_suggested_offset_properties(dev);
    715714        drm_object_attach_property(&connector->base,
     
    718717                                   dev->mode_config.suggested_y_property, 0);
    719718#endif
    720 #if RTLNX_VER_MAX(3,17,0) && !defined(RHEL_72)
     719#if RTLNX_VER_MAX(3,17,0) && !RTLNX_RHEL_MAJ_PREREQ(7,2)
    721720        drm_sysfs_connector_add(connector);
    722721#else
     
    725724
    726725#if RTLNX_VER_MIN(4,19,0) || defined(OPENSUSE_151) || defined(OPENSUSE_125) \
    727   || defined(RHEL_77) || defined(RHEL_81)
     726  || RTLNX_RHEL_MAJ_PREREQ(7,7) || RTLNX_RHEL_MAJ_PREREQ(8,1)
    728727        drm_connector_attach_encoder(connector, encoder);
    729728#else
     
    833832        }
    834833
    835 #if RTLNX_VER_MIN(4,7,0) || defined(RHEL_74)
     834#if RTLNX_VER_MIN(4,7,0) || RTLNX_RHEL_MAJ_PREREQ(7,4)
    836835        obj = drm_gem_object_lookup(file_priv, handle);
    837836#else
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