mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-17 15:27:36 +00:00
Make drm(4) build, if not work reliably, on PowerPC.
This commit is contained in:
parent
8299c44bdd
commit
17a6d97402
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=215367
@ -80,7 +80,9 @@ struct drm_file;
|
||||
#include <machine/pmap.h>
|
||||
#include <machine/bus.h>
|
||||
#include <machine/resource.h>
|
||||
#if defined(__i386__) || defined(__amd64__)
|
||||
#include <machine/specialreg.h>
|
||||
#endif
|
||||
#include <machine/sysarch.h>
|
||||
#include <sys/endian.h>
|
||||
#include <sys/mman.h>
|
||||
@ -246,20 +248,20 @@ typedef u_int8_t u8;
|
||||
*(volatile u_int8_t *)(((vm_offset_t)(map)->virtual) + \
|
||||
(vm_offset_t)(offset))
|
||||
#define DRM_READ16(map, offset) \
|
||||
*(volatile u_int16_t *)(((vm_offset_t)(map)->virtual) + \
|
||||
(vm_offset_t)(offset))
|
||||
le16toh(*(volatile u_int16_t *)(((vm_offset_t)(map)->virtual) + \
|
||||
(vm_offset_t)(offset)))
|
||||
#define DRM_READ32(map, offset) \
|
||||
*(volatile u_int32_t *)(((vm_offset_t)(map)->virtual) + \
|
||||
(vm_offset_t)(offset))
|
||||
le32toh(*(volatile u_int32_t *)(((vm_offset_t)(map)->virtual) + \
|
||||
(vm_offset_t)(offset)))
|
||||
#define DRM_WRITE8(map, offset, val) \
|
||||
*(volatile u_int8_t *)(((vm_offset_t)(map)->virtual) + \
|
||||
(vm_offset_t)(offset)) = val
|
||||
#define DRM_WRITE16(map, offset, val) \
|
||||
*(volatile u_int16_t *)(((vm_offset_t)(map)->virtual) + \
|
||||
(vm_offset_t)(offset)) = val
|
||||
(vm_offset_t)(offset)) = htole16(val)
|
||||
#define DRM_WRITE32(map, offset, val) \
|
||||
*(volatile u_int32_t *)(((vm_offset_t)(map)->virtual) + \
|
||||
(vm_offset_t)(offset)) = val
|
||||
(vm_offset_t)(offset)) = htole32(val)
|
||||
|
||||
#define DRM_VERIFYAREA_READ( uaddr, size ) \
|
||||
(!useracc(__DECONST(caddr_t, uaddr), size, VM_PROT_READ))
|
||||
|
@ -318,7 +318,7 @@ int drm_agp_bind(struct drm_device *dev, struct drm_agp_binding *request)
|
||||
if (!dev->agp || !dev->agp->acquired)
|
||||
return EINVAL;
|
||||
|
||||
DRM_DEBUG("agp_bind, page_size=%x\n", PAGE_SIZE);
|
||||
DRM_DEBUG("agp_bind, page_size=%x\n", (int)PAGE_SIZE);
|
||||
|
||||
entry = drm_agp_lookup_entry(dev, (void *)request->handle);
|
||||
if (entry == NULL || entry->bound)
|
||||
|
@ -478,7 +478,7 @@ static int drm_load(struct drm_device *dev)
|
||||
retcode = ENOMEM;
|
||||
goto error;
|
||||
}
|
||||
if (dev->agp != NULL) {
|
||||
if (dev->agp != NULL && dev->agp->info.ai_aperture_base != 0) {
|
||||
if (drm_mtrr_add(dev->agp->info.ai_aperture_base,
|
||||
dev->agp->info.ai_aperture_size, DRM_MTRR_WC) == 0)
|
||||
dev->agp->mtrr = 1;
|
||||
|
@ -73,7 +73,7 @@ void drm_mem_uninit(void)
|
||||
|
||||
void *drm_ioremap_wc(struct drm_device *dev, drm_local_map_t *map)
|
||||
{
|
||||
return pmap_mapdev_attr(map->offset, map->size, PAT_WRITE_COMBINING);
|
||||
return pmap_mapdev_attr(map->offset, map->size, VM_MEMATTR_WRITE_COMBINING);
|
||||
}
|
||||
|
||||
void *drm_ioremap(struct drm_device *dev, drm_local_map_t *map)
|
||||
|
@ -259,7 +259,7 @@ static int drm_bufs_info DRM_SYSCTL_HANDLER_ARGS
|
||||
*(1 << dma->bufs[i].page_order),
|
||||
(dma->bufs[i].seg_count
|
||||
* (1 << dma->bufs[i].page_order))
|
||||
* PAGE_SIZE / 1024);
|
||||
* (int)PAGE_SIZE / 1024);
|
||||
}
|
||||
DRM_SYSCTL_PRINT("\n");
|
||||
for (i = 0; i < dma->buf_count; i++) {
|
||||
|
@ -765,7 +765,7 @@ static int r600_cs_parse(struct drm_radeon_cs_parser *parser)
|
||||
memcpy(parser->ib, ib_chunk->kdata, ib_chunk->length_dw * sizeof(uint32_t));
|
||||
|
||||
/* read back last byte to flush WC buffers */
|
||||
rb = readl(((vm_offset_t)parser->ib + (ib_chunk->length_dw-1) * sizeof(uint32_t)));
|
||||
rb = *(volatile u_int32_t *) (((vm_offset_t)parser->ib + (ib_chunk->length_dw-1) * sizeof(uint32_t)));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user