xfree86: os-support: simplify pci init
All supported platforms, except Linux, have have to call xf86InitVidMem() from xf86scanpci(), so we can make the code much simpler. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1548>
This commit is contained in:
parent
1b49f6ddb8
commit
fd6fe36622
|
@ -125,6 +125,7 @@
|
|||
#endif
|
||||
|
||||
#include "Pci.h"
|
||||
#include "../xf86_os_support.h"
|
||||
|
||||
Bool
|
||||
xf86scanpci(void)
|
||||
|
@ -134,7 +135,9 @@ xf86scanpci(void)
|
|||
success = (pci_system_init() == 0);
|
||||
|
||||
/* choose correct platform/OS specific PCI init routine */
|
||||
osPciInit();
|
||||
#if !defined(__linux__)
|
||||
xf86InitVidMem();
|
||||
#endif
|
||||
|
||||
return success;
|
||||
}
|
||||
|
|
|
@ -135,14 +135,4 @@
|
|||
#define PCI_BUS_NO_DOMAIN(bus) ((bus) & 0xffu)
|
||||
#define PCI_TAG_NO_DOMAIN(tag) ((tag) & 0x00ffff00u)
|
||||
|
||||
#if defined(__linux__)
|
||||
#define osPciInit(x) do {} while (0)
|
||||
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \
|
||||
defined(__OpenBSD__) || defined(__NetBSD__) || \
|
||||
defined(__DragonFly__) || defined(__sun) || defined(__GNU__)
|
||||
extern void osPciInit(void);
|
||||
#else
|
||||
#error No PCI support available for this architecture/OS combination
|
||||
#endif
|
||||
|
||||
#endif /* _PCI_H */
|
||||
|
|
|
@ -1,57 +0,0 @@
|
|||
/*
|
||||
* Copyright © 2007 Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
* IN THE SOFTWARE.
|
||||
*
|
||||
* Authors:
|
||||
* Eric Anholt <eric@anholt.net>
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file bsd_pci.c
|
||||
*
|
||||
* This is a trivial implementation of the remaining PCI support hooks in the
|
||||
* X Server that is unaware of domains.
|
||||
*
|
||||
* Most of even this should go away once drivers are converted and the
|
||||
* old interfaces are confirmed to all be obsolete.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_XORG_CONFIG_H
|
||||
#include <xorg-config.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "compiler.h"
|
||||
#include "xf86.h"
|
||||
#include "xf86Priv.h"
|
||||
#include "xf86_os_support.h"
|
||||
#include "xf86_OSlib.h"
|
||||
#include "Pci.h"
|
||||
|
||||
#include "pciaccess.h"
|
||||
|
||||
void
|
||||
osPciInit(void)
|
||||
{
|
||||
xf86InitVidMem();
|
||||
}
|
|
@ -16,9 +16,6 @@ os_c_args = []
|
|||
|
||||
if get_option('pciaccess')
|
||||
srcs_xorg_os_support += 'bus/Pci.c'
|
||||
if host_machine.system() != 'linux'
|
||||
srcs_xorg_os_support += 'bus/bsd_pci.c'
|
||||
endif
|
||||
if host_machine.cpu() == 'sparc' or host_machine.cpu() == 'sparc64'
|
||||
srcs_xorg_os_support += 'bus/Sbus.c'
|
||||
install_data('bus/xf86Sbus.h', install_dir: xorgsdkdir)
|
||||
|
|
Loading…
Reference in New Issue