Changeset 85705 in vbox for trunk/src/VBox/Additions/linux/drm/vbox_mode.c
- Timestamp:
- Aug 11, 2020 7:17:09 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/drm/vbox_mode.c
r85704 r85705 40 40 #include <linux/export.h> 41 41 #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) 43 43 #include <drm/drm_plane_helper.h> 44 44 #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) 46 46 #include <drm/drm_probe_helper.h> 47 47 #endif … … 70 70 width = mode->hdisplay ? mode->hdisplay : 640; 71 71 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) 73 73 bpp = crtc->enabled ? CRTC_FB(crtc)->format->cpp[0] * 8 : 32; 74 74 pitch = crtc->enabled ? CRTC_FB(crtc)->pitches[0] : width * bpp / 8; … … 94 94 VBoxVideoSetModeRegisters( 95 95 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) 97 97 CRTC_FB(crtc)->format->cpp[0] * 8, 98 98 #else … … 285 285 static int vbox_crtc_page_flip(struct drm_crtc *crtc, 286 286 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) 288 288 struct drm_pending_vblank_event *event, 289 289 uint32_t page_flip_flags, 290 290 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) 292 292 struct drm_pending_vblank_event *event, 293 293 uint32_t page_flip_flags) … … 311 311 312 312 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) 314 314 drm_crtc_send_vblank_event(crtc, event); 315 315 #else … … 386 386 } 387 387 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) 389 389 static struct drm_encoder *drm_encoder_find(struct drm_device *dev, u32 id) 390 390 { … … 410 410 /* pick the encoder ids */ 411 411 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)) 416 415 return drm_encoder_find(connector->dev, NULL, enc_id); 417 416 # else … … 469 468 470 469 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) 472 471 DRM_MODE_ENCODER_DAC, NULL); 473 472 #else … … 549 548 edid[EDID_SIZE - 1] = (0x100 - (sum & 0xFF)) & 0xFF; 550 549 #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) 552 551 drm_connector_update_edid_property(connector, (struct edid *)edid); 553 552 #else … … 607 606 vbox_set_edid(connector, preferred_width, preferred_height); 608 607 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) 610 609 if (vbox_connector->vbox_crtc->x_hint != -1) 611 610 drm_object_property_set_value(&connector->base, … … 628 627 } 629 628 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) 631 630 static int vbox_mode_valid(struct drm_connector *connector, 632 631 #else … … 640 639 static void vbox_connector_destroy(struct drm_connector *connector) 641 640 { 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) 643 642 drm_sysfs_connector_remove(connector); 644 643 #else … … 711 710 connector->doublescan_allowed = 0; 712 711 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) 714 713 drm_mode_create_suggested_offset_properties(dev); 715 714 drm_object_attach_property(&connector->base, … … 718 717 dev->mode_config.suggested_y_property, 0); 719 718 #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) 721 720 drm_sysfs_connector_add(connector); 722 721 #else … … 725 724 726 725 #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) 728 727 drm_connector_attach_encoder(connector, encoder); 729 728 #else … … 833 832 } 834 833 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) 836 835 obj = drm_gem_object_lookup(file_priv, handle); 837 836 #else
Note:
See TracChangeset
for help on using the changeset viewer.