Pull up following revision(s) (requested by riastradh in ticket #18):

sys/external/bsd/drm2/ttm/ttm_agp_backend.c: revision 1.2
	sys/external/bsd/drm2/ttm/ttm_agp_backend.c: revision 1.3
	sys/external/bsd/drm2/include/linux/pci.h: revision 1.8
Fix shifts & masks in Linux pci_read_config_{word,byte}.
Use ttm_dma_tt_init in ttm_agp_tt_create so we can use ttm_bus_dma.
Zero ttm_agp objects on creation.
This commit is contained in:
martin 2014-08-15 11:11:59 +00:00
parent 644b15e18a
commit 56e9c90ece
2 changed files with 7 additions and 7 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: pci.h,v 1.7 2014/08/06 13:52:06 riastradh Exp $ */
/* $NetBSD: pci.h,v 1.7.2.1 2014/08/15 11:11:59 martin Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@ -200,7 +200,7 @@ pci_read_config_word(struct pci_dev *pdev, int reg, uint16_t *valuep)
{
KASSERT(!ISSET(reg, 1));
*valuep = pci_conf_read(pdev->pd_pa.pa_pc, pdev->pd_pa.pa_tag,
(reg &~ 3)) >> (8 * (reg & 3));
(reg &~ 2)) >> (8 * (reg & 2));
return 0;
}
@ -208,7 +208,7 @@ static inline int
pci_read_config_byte(struct pci_dev *pdev, int reg, uint8_t *valuep)
{
*valuep = pci_conf_read(pdev->pd_pa.pa_pc, pdev->pd_pa.pa_tag,
(reg &~ 1)) >> (8 * (reg & 1));
(reg &~ 3)) >> (8 * (reg & 3));
return 0;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: ttm_agp_backend.c,v 1.1 2014/07/16 20:59:58 riastradh Exp $ */
/* $NetBSD: ttm_agp_backend.c,v 1.1.4.1 2014/08/15 11:11:59 martin Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ttm_agp_backend.c,v 1.1 2014/07/16 20:59:58 riastradh Exp $");
__KERNEL_RCSID(0, "$NetBSD: ttm_agp_backend.c,v 1.1.4.1 2014/08/15 11:11:59 martin Exp $");
#include <sys/types.h>
#include <sys/kmem.h>
@ -57,11 +57,11 @@ ttm_agp_tt_create(struct ttm_bo_device *bdev, struct agp_bridge_data *bridge,
{
struct ttm_agp *ttm_agp;
ttm_agp = kmem_alloc(sizeof(*ttm_agp), KM_SLEEP);
ttm_agp = kmem_zalloc(sizeof(*ttm_agp), KM_SLEEP);
ttm_agp->agp = &bridge->abd_sc;
ttm_agp->ttm_dma.ttm.func = &ttm_agp_backend_func;
if (ttm_tt_init(&ttm_agp->ttm_dma.ttm, bdev, size, page_flags,
if (ttm_dma_tt_init(&ttm_agp->ttm_dma, bdev, size, page_flags,
dummy_read_page) != 0)
goto fail;