VirtualBox

Changeset 47417 in vbox


Ignore:
Timestamp:
Jul 26, 2013 8:36:22 AM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
87567
Message:

Additions/linux/drm: next mode-setting code drop.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/linux/drm/Makefile.kmk

    r41477 r47417  
    4040#
    4141# Note! Syntax checking only.  Don't bother if drmP.h is missing (introduced
    42 #       in 2.6.27).
     42#       in 2.6.27).  For the mode-setting driver make sure this is supported.
    4343# Note! The DEBUG_HASH* stuff is for CONFIG_DYNAMIC_DEBUG-enabled kernels.
    4444#
    45 if defined(VBOX_WITH_ADDITION_DRIVERS) \
    46   && "$(strip $(foreach inc,$(VBOX_LINUX_INCS),$(wildcard $(inc)/drm/drmP.h)))" != ""
    47  SYSMODS += vboxvideo_drm
    48  vboxvideo_drm_TEMPLATE        = VBOXGUESTR0
    49  vboxvideo_drm_CFLAGS          = -fshort-wchar
    50  vboxvideo_drm_DEFS            = \
    51         MODULE IN_RT_R0 VBOXGUEST VBOX_WITH_HGCM \
    52         KBUILD_MODNAME=KBUILD_STR\(vboxvideo\) \
     45if defined(VBOX_WITH_ADDITION_DRIVERS)
     46 if !defined(VBOX_WITH_GUEST_KMS_DRIVER)
     47  if "$(strip $(foreach inc,$(VBOX_LINUX_INCS),$(wildcard $(inc)/drm/drmP.h)))" != ""
     48   SYSMODS += vboxvideo_drm
     49  endif
     50 else
     51  if "$(shell grep -s 'DRIVER_MODESET' $(foreach inc,$(VBOX_LINUX_INCS),$(inc)/drm/drmP.h))" != ""
     52   SYSMODS += vboxvideo_drm
     53  endif
     54 endif
     55endif
     56
     57vboxvideo_drm_TEMPLATE        = VBOXGUESTR0
     58vboxvideo_drm_CFLAGS          = -fshort-wchar
     59vboxvideo_drm_DEFS            = \
     60        MODULE IN_RT_R0 VBOXGUEST VBOX_WITH_HGCM \
     61        KBUILD_MODNAME=KBUILD_STR\(vboxvideo\) \
    5362        KBUILD_BASENAME=KBUILD_STR\(vboxvideo\) \
    54         DEBUG_HASH=2 DEBUG_HASH2=3
    55  # detect fc6 2.6.18
    56  vboxvideo_drm_DEFS           += \
    57         $(foreach inc,$(VBOX_LINUX_INCS),\
    58                 $(if $(wildcard $(inc)/linux/utsrelease.h),\
    59                  $(if $(shell if grep -q '"2.6.18.*fc6.*"' $(inc)/linux/utsrelease.h;\
    60                                then echo yes; fi),KERNEL_FC6,),))
    61  # detect rhel5 2.6.18
    62  vboxvideo_drm_DEFS           += \
    63         $(foreach inc,$(VBOX_LINUX_INCS),\
    64                 $(if $(wildcard $(inc)/linux/utsrelease.h),\
    65                  $(if $(shell if grep -q '"2.6.18.*el5.*"' $(inc)/linux/utsrelease.h;\
    66                                then echo yes; fi),KERNEL_FC6,),))
    67  if !defined(VBOX_WITH_GUEST_KMS_DRIVER)
    68   vboxvideo_drm_SOURCES         = vboxvideo_drm.c
    69  else
    70   vboxvideo_drm_INCS           += ../../../Runtime/r0drv/linux
    71   vboxvideo_drm_SOURCES         = \
    72     ../../common/VBoxVideo/Modesetting.cpp \
    73         vboxvideo_crtc.c \
    74         vboxvideo_dac.c \
    75         vboxvideo_device.c \
    76         vboxvideo_display.c \
    77         vboxvideo_drv.c \
    78         vboxvideo_kms.c \
    79         vboxvideo_vga.c
    80  endif
    81 
     63        DEBUG_HASH=2 DEBUG_HASH2=3
     64# detect fc6 2.6.18
     65vboxvideo_drm_DEFS           += \
     66        $(foreach inc,$(VBOX_LINUX_INCS),\
     67                $(if $(wildcard $(inc)/linux/utsrelease.h),\
     68                 $(if $(shell if grep -q '"2.6.18.*fc6.*"' $(inc)/linux/utsrelease.h;\
     69                               then echo yes; fi),KERNEL_FC6,),))
     70# detect rhel5 2.6.18
     71vboxvideo_drm_DEFS           += \
     72        $(foreach inc,$(VBOX_LINUX_INCS),\
     73                $(if $(wildcard $(inc)/linux/utsrelease.h),\
     74                 $(if $(shell if grep -q '"2.6.18.*el5.*"' $(inc)/linux/utsrelease.h;\
     75                               then echo yes; fi),KERNEL_FC6,),))
     76if !defined(VBOX_WITH_GUEST_KMS_DRIVER)
     77 vboxvideo_drm_SOURCES         = vboxvideo_drm.c
     78else
     79 vboxvideo_drm_INCS           += ../../../Runtime/r0drv/linux
     80 vboxvideo_drm_SOURCES         = \
     81   ../../common/VBoxVideo/Modesetting.cpp \
     82        vboxvideo_crtc.c \
     83        vboxvideo_dac.c \
     84        vboxvideo_device.c \
     85        vboxvideo_display.c \
     86        vboxvideo_drv.c \
     87        vboxvideo_fbdev.c \
     88        vboxvideo_framebuffer.c \
     89        vboxvideo_kms.c \
     90        vboxvideo_vga.c
    8291endif
    8392
  • trunk/src/VBox/Additions/linux/drm/Makefile.module.kms

    r43113 r47417  
    2222
    2323MOD_OBJS   = Modesetting.o vboxvideo_crtc.o vboxvideo_dac.o vboxvideo_device.o \
    24              vboxvideo_display.o vboxvideo_drv.o vboxvideo_kms.o vboxvideo_vga.o
     24             vboxvideo_display.o vboxvideo_drv.o vboxvideo_fbdev.o \
     25             vboxvideo_framebuffer.o vboxvideo_kms.o vboxvideo_vga.o
    2526
    2627ifneq ($(wildcard $(KBUILD_EXTMOD)/vboxvideo),)
  • trunk/src/VBox/Additions/linux/drm/vboxvideo.h

    r47388 r47417  
    5151struct vboxvideo_mc
    5252{
    53     resource_size_t    aper_size;
    54     resource_size_t    aper_base;
    55     char __iomem      *vram;
    56     u32                vram_size;
     53    resource_size_t    vram_size;
     54    resource_size_t    vram_base;
    5755};
    5856
     
    6664    bool                fAnyX;
    6765
     66    drm_local_map_t    *framebuffer;
     67
    6868    struct vboxvideo_mc mc;
    6969    struct vboxvideo_mode_info  mode_info;
  • trunk/src/VBox/Additions/linux/drm/vboxvideo_crtc.c

    r47341 r47417  
    4444
    4545#include <linux/version.h>
    46 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 33)
    4746
    4847#include <VBox/VBoxVideoGuest.h>
     
    194193}
    195194
    196 #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) */
     195/** Sets the color ramps on behalf of fbcon */
     196void vboxvideo_crtc_fb_gamma_set(struct drm_crtc *crtc, u16 red, u16 green,
     197                                 u16 blue, int regno)
     198{
     199
     200}
     201
     202/** Gets the color ramps on behalf of fbcon */
     203void vboxvideo_crtc_fb_gamma_get(struct drm_crtc *crtc, u16 *red, u16 *green,
     204                                 u16 *blue, int regno)
     205{
     206
     207}
  • trunk/src/VBox/Additions/linux/drm/vboxvideo_dac.c

    r47341 r47417  
    4444
    4545#include <linux/version.h>
    46 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 33)
    4746
    4847#include "vboxvideo_drv.h"
     
    138137    return encoder;
    139138}
    140 
    141 #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) */
  • trunk/src/VBox/Additions/linux/drm/vboxvideo_device.c

    r47388 r47417  
    4545#include <linux/version.h>
    4646
    47 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
    48 
    4947#include "the-linux-kernel.h"
    5048
     
    5553static int vboxvideo_vram_init(struct vboxvideo_device *gdev)
    5654{
    57     /* work out accessible VRAM */
    58     gdev->mc.aper_base = pci_resource_start(gdev->ddev->pdev, 1);
    59     gdev->mc.aper_size = pci_resource_len(gdev->ddev->pdev, 1);
     55    unsigned size;
     56    int ret;
    6057
    61     gdev->mc.vram = ioremap(gdev->mc.aper_base, gdev->mc.aper_size);
    62     if (!gdev->mc.vram) {
    63         VBOXVIDEO_ERROR("Unable to ioremap %lu MB of VRAM. Bailing out.\n", (unsigned long)gdev->mc.aper_size / MB);
    64         return -1;
    65     }
     58    /* set accessible VRAM */
     59    gdev->mc.vram_base = pci_resource_start(gdev->ddev->pdev, 1);
     60    gdev->mc.vram_size = pci_resource_len(gdev->ddev->pdev, 1);
     61
    6662    gdev->fAnyX        = VBoxVideoAnyWidthAllowed();
    6763    gdev->mc.vram_size = VBoxVideoGetVRAMSize();
    6864
     65    if (!request_region(gdev->mc.vram_base, gdev->mc.vram_size, "vboxvideofb_vram")) {
     66        VBOXVIDEO_ERROR("can't region_reserve VRAM\n");
     67        return -ENXIO;
     68    }
     69
     70    ret = drm_addmap(gdev->ddev, gdev->mc.vram_base, gdev->mc.vram_size,
     71        _DRM_FRAME_BUFFER, _DRM_WRITE_COMBINING,
     72        &gdev->framebuffer);
    6973    return 0;
    7074}
     
    7276static void vboxvideo_vram_fini(struct vboxvideo_device *gdev)
    7377{
    74     iounmap(gdev->mc.vram);
    75     gdev->mc.vram = NULL;
     78    if (gdev->framebuffer)
     79        drm_rmmap(gdev->ddev, gdev->framebuffer);
     80    if (gdev->mc.vram_base)
     81        release_region(gdev->mc.vram_base, gdev->mc.vram_size);
    7682}
    7783
     
    103109    vboxvideo_vram_fini(gdev);
    104110}
    105 #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) */
  • trunk/src/VBox/Additions/linux/drm/vboxvideo_display.c

    r47341 r47417  
    4545#include <linux/version.h>
    4646
    47 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
    48 
    4947#include "vboxvideo_drv.h"
    5048
     
    5351    struct drm_encoder *encoder;
    5452    struct drm_connector *connector;
     53    int ret;
    5554    int i;
    5655
     
    6160    gdev->ddev->mode_config.max_height = VBOXVIDEO_MAX_FB_HEIGHT;
    6261
    63     gdev->ddev->mode_config.fb_base = gdev->mc.aper_base;
     62    gdev->ddev->mode_config.fb_base = gdev->mc.vram_base;
    6463
    6564    /* allocate crtcs */
     
    8382    drm_mode_connector_attach_encoder(connector, encoder);
    8483
     84    ret = vboxvideo_fbdev_init(gdev);
     85    if (ret) {
     86        VBOXVIDEO_ERROR("vboxvideo_fbdev_init failed\n");
     87        return ret;
     88    }
     89
    8590    return 0;
    8691}
     
    8893void vboxvideo_modeset_fini(struct vboxvideo_device *gdev)
    8994{
     95    vboxvideo_fbdev_fini(gdev);
     96
    9097    if (gdev->mode_info.mode_config_initialized)
    9198    {
     
    94101    }
    95102}
    96 #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) */
  • trunk/src/VBox/Additions/linux/drm/vboxvideo_drv.h

    r47388 r47417  
    6868#define MB (1024 * 1024)
    6969
    70 /** @todo does this make sense?  What exactly is this connector? */
    7170#define VBOXVIDEOFB_CONN_LIMIT VBOX_VIDEO_MAX_SCREENS
    7271
    7372/* vboxvideo_crtc.c */
     73void vboxvideo_crtc_fb_gamma_set(struct drm_crtc *crtc, u16 red, u16 green,
     74                                 u16 blue, int regno);
     75void vboxvideo_crtc_fb_gamma_get(struct drm_crtc *crtc, u16 *red, u16 *green,
     76                                 u16 *blue, int regno);
    7477void vboxvideo_crtc_init(struct drm_device *dev, int index);
    7578
    7679/* vboxvideo_dac.c */
    7780struct drm_encoder *vboxvideo_dac_init(struct drm_device *dev);
     81
     82/* vboxvideo_fbdev.c */
     83int vboxvideo_fbdev_init(struct vboxvideo_device *gdev);
     84void vboxvideo_fbdev_fini(struct vboxvideo_device *gdev);
     85
     86/* vboxvideo_framebuffer.c */
     87int vboxvideo_framebuffer_init(struct drm_device *dev,
     88                               struct vboxvideo_framebuffer *gfb,
     89                               struct DRM_MODE_FB_CMD *mode_cmd);
    7890
    7991/* vboxvideo_device.c */
  • trunk/src/VBox/Additions/linux/drm/vboxvideo_kms.c

    r44529 r47417  
    4444
    4545#include <linux/version.h>
    46 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 33)
    4746
    4847#include "vboxvideo_drv.h"
     
    9796};
    9897int vboxvideo_max_ioctl = DRM_ARRAY_SIZE(vboxvideo_ioctls);
    99 
    100 #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) */
  • trunk/src/VBox/Additions/linux/drm/vboxvideo_mode.h

    r39335 r47417  
    4848#include <VBox/Hardware/VBoxVideoVBE.h>
    4949#include "drm/drmP.h"
     50#include <linux/version.h>
    5051
    5152#define VBOXVIDEO_MAX_FB_HEIGHT VBE_DISPI_MAX_YRES
     
    5455#define to_vboxvideo_crtc(x)    container_of(x, struct vboxvideo_crtc, base)
    5556#define to_vboxvideo_encoder(x) container_of(x, struct vboxvideo_encoder, base)
     57#define to_vboxvideo_framebuffer(x) container_of(x, struct vboxvideo_framebuffer, base)
    5658
    5759#define VBOXVIDEO_DPMS_CLEARED (-1)
     60
     61#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 3, 0)
     62# define DRM_MODE_FB_CMD drm_mode_fb_cmd
     63#else
     64# define DRM_MODE_FB_CMD drm_mode_fb_cmd2
     65#endif
    5866
    5967struct vboxvideo_crtc
     
    6876{
    6977    bool                    mode_config_initialized;
    70     struct vboxvideo_crtc  *crtcs[VBOX_VIDEO_MAX_SCREENS];
     78    struct vboxvideo_crtc  *crtcs[1]; /* FIXME: how many CRTCs? */
     79    /* pointer to fbdev info structure */
     80    struct vboxvideo_fbdev *gfbdev;
    7181};
    7282
     
    8191};
    8292
     93struct vboxvideo_framebuffer {
     94    struct drm_framebuffer    base;
     95};
     96
    8397#endif                /* __DRM_VBOXVIDEO_H__ */
  • trunk/src/VBox/Additions/linux/drm/vboxvideo_vga.c

    r47341 r47417  
    4444
    4545#include <linux/version.h>
    46 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 33)
    4746
    4847#include "vboxvideo_drv.h"
     
    131130    return connector;
    132131}
    133 
    134 #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) */
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