Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/external/bsd/drm2/dist fix merge conflicts
details: https://anonhg.NetBSD.org/src/rev/fa6c101b1eb5
branches: trunk
changeset: 797401:fa6c101b1eb5
user: riastradh <riastradh%NetBSD.org@localhost>
date: Wed Jul 16 20:03:56 2014 +0000
description:
fix merge conflicts
diffstat:
sys/external/bsd/drm2/dist/drm/drm_agpsupport.c | 54 +-
sys/external/bsd/drm2/dist/drm/drm_buffer.c | 2 +-
sys/external/bsd/drm2/dist/drm/drm_bufs.c | 269 +-
sys/external/bsd/drm2/dist/drm/drm_context.c | 32 +-
sys/external/bsd/drm2/dist/drm/drm_crtc.c | 2565 ++-
sys/external/bsd/drm2/dist/drm/drm_crtc_helper.c | 634 +-
sys/external/bsd/drm2/dist/drm/drm_debugfs.c | 6 +-
sys/external/bsd/drm2/dist/drm/drm_dp_helper.c | 427 +-
sys/external/bsd/drm2/dist/drm/drm_edid.c | 1749 ++-
sys/external/bsd/drm2/dist/drm/drm_edid_modes.h | 774 -
sys/external/bsd/drm2/dist/drm/drm_fb_helper.c | 460 +-
sys/external/bsd/drm2/dist/drm/drm_gem.c | 690 +-
sys/external/bsd/drm2/dist/drm/drm_ioctl.c | 122 +-
sys/external/bsd/drm2/dist/drm/drm_irq.c | 325 +-
sys/external/bsd/drm2/dist/drm/drm_mm.c | 690 +-
sys/external/bsd/drm2/dist/drm/drm_modes.c | 530 +-
sys/external/bsd/drm2/dist/drm/drm_pci.c | 205 +-
sys/external/bsd/drm2/dist/drm/drm_platform.c | 69 +-
sys/external/bsd/drm2/dist/drm/drm_proc.c | 220 -
sys/external/bsd/drm2/dist/drm/drm_stub.c | 769 +-
sys/external/bsd/drm2/dist/drm/i915/dvo_ch7xxx.c | 34 +-
sys/external/bsd/drm2/dist/drm/i915/i915_dma.c | 705 +-
sys/external/bsd/drm2/dist/drm/i915/i915_drv.c | 1280 +-
sys/external/bsd/drm2/dist/drm/i915/i915_drv.h | 2336 ++-
sys/external/bsd/drm2/dist/drm/i915/i915_gem.c | 3043 ++-
sys/external/bsd/drm2/dist/drm/i915/i915_gem_context.c | 627 +-
sys/external/bsd/drm2/dist/drm/i915/i915_gem_execbuffer.c | 1069 +-
sys/external/bsd/drm2/dist/drm/i915/i915_gem_tiling.c | 96 +-
sys/external/bsd/drm2/dist/drm/i915/i915_irq.c | 4279 +++-
sys/external/bsd/drm2/dist/drm/i915/intel_bios.c | 418 +-
sys/external/bsd/drm2/dist/drm/i915/intel_crt.c | 279 +-
sys/external/bsd/drm2/dist/drm/i915/intel_ddi.c | 1448 +-
sys/external/bsd/drm2/dist/drm/i915/intel_display.c | 9552 ++++++++----
sys/external/bsd/drm2/dist/drm/i915/intel_dp.c | 3182 ++-
sys/external/bsd/drm2/dist/drm/i915/intel_drv.h | 956 +-
sys/external/bsd/drm2/dist/drm/i915/intel_fb.c | 294 -
sys/external/bsd/drm2/dist/drm/i915/intel_hdmi.c | 836 +-
sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c | 168 +-
sys/external/bsd/drm2/dist/drm/i915/intel_lvds.c | 725 +-
sys/external/bsd/drm2/dist/drm/i915/intel_opregion.c | 612 +-
sys/external/bsd/drm2/dist/drm/i915/intel_overlay.c | 124 +-
sys/external/bsd/drm2/dist/drm/i915/intel_panel.c | 1247 +-
sys/external/bsd/drm2/dist/drm/i915/intel_pm.c | 4750 ++++--
sys/external/bsd/drm2/dist/drm/i915/intel_ringbuffer.c | 948 +-
sys/external/bsd/drm2/dist/drm/i915/intel_ringbuffer.h | 107 +-
sys/external/bsd/drm2/dist/drm/i915/intel_sdvo.c | 676 +-
sys/external/bsd/drm2/dist/drm/i915/intel_tv.c | 110 +-
sys/external/bsd/drm2/dist/drm/i915/intel_uncore.c | 21 +
sys/external/bsd/drm2/dist/drm/vmwgfx/vmwgfx_kms.c | 163 +-
sys/external/bsd/drm2/dist/include/drm/drmP.h | 779 +-
sys/external/bsd/drm2/dist/include/drm/drm_crtc.h | 438 +-
sys/external/bsd/drm2/dist/include/drm/drm_crtc_helper.h | 18 +-
sys/external/bsd/drm2/dist/include/drm/drm_fb_helper.h | 35 +-
sys/external/bsd/drm2/dist/include/drm/drm_mm.h | 356 +-
sys/external/bsd/drm2/dist/include/drm/drm_modes.h | 2 +-
sys/external/bsd/drm2/dist/uapi/drm/drm.h | 63 +-
sys/external/bsd/drm2/dist/uapi/drm/drm_mode.h | 82 +-
sys/external/bsd/drm2/dist/uapi/drm/mga_drm.h | 419 -
58 files changed, 33008 insertions(+), 19861 deletions(-)
diffs (truncated from 73992 to 300 lines):
diff -r cb4ff69eb8e7 -r fa6c101b1eb5 sys/external/bsd/drm2/dist/drm/drm_agpsupport.c
--- a/sys/external/bsd/drm2/dist/drm/drm_agpsupport.c Wed Jul 16 19:53:18 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/drm_agpsupport.c Wed Jul 16 20:03:56 2014 +0000
@@ -55,7 +55,7 @@
*/
int drm_agp_info(struct drm_device *dev, struct drm_agp_info *info)
{
- DRM_AGP_KERN *kern;
+ struct agp_kern_info *kern;
if (!dev->agp || !dev->agp->acquired)
return -EINVAL;
@@ -212,17 +212,15 @@
int drm_agp_alloc(struct drm_device *dev, struct drm_agp_buffer *request)
{
struct drm_agp_mem *entry;
- DRM_AGP_MEM *memory;
+ struct agp_memory *memory;
unsigned long pages;
u32 type;
if (!dev->agp || !dev->agp->acquired)
return -EINVAL;
- if (!(entry = kmalloc(sizeof(*entry), GFP_KERNEL)))
+ if (!(entry = kzalloc(sizeof(*entry), GFP_KERNEL)))
return -ENOMEM;
- memset(entry, 0, sizeof(*entry));
-
pages = (request->size + PAGE_SIZE - 1) / PAGE_SIZE;
type = (u32) request->type;
if (!(memory = agp_allocate_memory(dev->agp->bridge, pages, type))) {
@@ -437,14 +435,16 @@
* Gets the drm_agp_t structure which is made available by the agpgart module
* via the inter_module_* functions. Creates and initializes a drm_agp_head
* structure.
+ *
+ * Note that final cleanup of the kmalloced structure is directly done in
+ * drm_pci_agp_destroy.
*/
struct drm_agp_head *drm_agp_init(struct drm_device *dev)
{
struct drm_agp_head *head = NULL;
- if (!(head = kmalloc(sizeof(*head), GFP_KERNEL)))
+ if (!(head = kzalloc(sizeof(*head), GFP_KERNEL)))
return NULL;
- memset((void *)head, 0, sizeof(*head));
head->bridge = agp_find_bridge(dev->pdev);
if (!head->bridge) {
if (!(head->bridge = agp_backend_acquire(dev->pdev))) {
@@ -478,20 +478,56 @@
#ifndef __NetBSD__
/**
+ * drm_agp_clear - Clear AGP resource list
+ * @dev: DRM device
+ *
+ * Iterate over all AGP resources and remove them. But keep the AGP head
+ * intact so it can still be used. It is safe to call this if AGP is disabled or
+ * was already removed.
+ *
+ * If DRIVER_MODESET is active, nothing is done to protect the modesetting
+ * resources from getting destroyed. Drivers are responsible of cleaning them up
+ * during device shutdown.
+ */
+void drm_agp_clear(struct drm_device *dev)
+{
+ struct drm_agp_mem *entry, *tempe;
+
+ if (!dev->agp)
+ return;
+ if (drm_core_check_feature(dev, DRIVER_MODESET))
+ return;
+
+ list_for_each_entry_safe(entry, tempe, &dev->agp->memory, head) {
+ if (entry->bound)
+ drm_unbind_agp(entry->memory);
+ drm_free_agp(entry->memory, entry->pages);
+ kfree(entry);
+ }
+ INIT_LIST_HEAD(&dev->agp->memory);
+
+ if (dev->agp->acquired)
+ drm_agp_release(dev);
+
+ dev->agp->acquired = 0;
+ dev->agp->enabled = 0;
+}
+
+/**
* Binds a collection of pages into AGP memory at the given offset, returning
* the AGP memory structure containing them.
*
* No reference is held on the pages during this time -- it is up to the
* caller to handle that.
*/
-DRM_AGP_MEM *
+struct agp_memory *
drm_agp_bind_pages(struct drm_device *dev,
struct page **pages,
unsigned long num_pages,
uint32_t gtt_offset,
u32 type)
{
- DRM_AGP_MEM *mem;
+ struct agp_memory *mem;
int ret, i;
DRM_DEBUG("\n");
diff -r cb4ff69eb8e7 -r fa6c101b1eb5 sys/external/bsd/drm2/dist/drm/drm_buffer.c
--- a/sys/external/bsd/drm2/dist/drm/drm_buffer.c Wed Jul 16 19:53:18 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/drm_buffer.c Wed Jul 16 20:03:56 2014 +0000
@@ -114,7 +114,7 @@
for (idx = 0; idx < nr_pages; ++idx) {
- if (DRM_COPY_FROM_USER(buf->data[idx],
+ if (copy_from_user(buf->data[idx],
(const char *)user_data + idx * PAGE_SIZE,
min(PAGE_SIZE, size - idx * PAGE_SIZE))) {
DRM_ERROR("Failed to copy user data (%p) to drm buffer"
diff -r cb4ff69eb8e7 -r fa6c101b1eb5 sys/external/bsd/drm2/dist/drm/drm_bufs.c
--- a/sys/external/bsd/drm2/dist/drm/drm_bufs.c Wed Jul 16 19:53:18 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/drm_bufs.c Wed Jul 16 20:03:56 2014 +0000
@@ -205,18 +205,20 @@
return 0;
}
- if (drm_core_has_MTRR(dev)) {
- if (map->type == _DRM_FRAME_BUFFER ||
- (map->flags & _DRM_WRITE_COMBINING)) {
- map->mtrr = mtrr_add(map->offset, map->size,
- MTRR_TYPE_WRCOMB, 1);
- }
+ if (map->type == _DRM_FRAME_BUFFER ||
+ (map->flags & _DRM_WRITE_COMBINING)) {
+ map->mtrr =
+ arch_phys_wc_add(map->offset, map->size);
}
if (map->type == _DRM_REGISTERS) {
#ifdef __NetBSD__
map->handle = drm_ioremap(dev, map);
#else
- map->handle = ioremap(map->offset, map->size);
+ if (map->flags & _DRM_WRITE_COMBINING)
+ map->handle = ioremap_wc(map->offset,
+ map->size);
+ else
+ map->handle = ioremap(map->offset, map->size);
#endif
if (!map->handle) {
kfree(map);
@@ -241,7 +243,7 @@
}
map->handle = vmalloc_user(map->size);
DRM_DEBUG("%lu %d %p\n",
- map->size, drm_order(map->size), map->handle);
+ map->size, order_base_2(map->size), map->handle);
if (!map->handle) {
kfree(map);
return -ENOMEM;
@@ -264,7 +266,7 @@
struct drm_agp_mem *entry;
int valid = 0;
- if (!drm_core_has_AGP(dev)) {
+ if (!dev->agp) {
kfree(map);
return -EINVAL;
}
@@ -314,9 +316,6 @@
break;
}
- case _DRM_GEM:
- DRM_ERROR("tried to addmap GEM object\n");
- break;
case _DRM_SCATTER_GATHER:
if (!dev->sg) {
kfree(map);
@@ -444,6 +443,15 @@
/* avoid a warning on 64-bit, this casting isn't very nice, but the API is set so too late */
map->handle = (void *)(unsigned long)maplist->user_token;
+
+ /*
+ * It appears that there are no users of this value whatsoever --
+ * drmAddMap just discards it. Let's not encourage its use.
+ * (Keeping drm_addmap_core's returned mtrr value would be wrong --
+ * it's not a real mtrr index anymore.)
+ */
+ map->mtrr = -1;
+
return 0;
}
@@ -491,11 +499,7 @@
#endif
/* FALLTHROUGH */
case _DRM_FRAME_BUFFER:
- if (drm_core_has_MTRR(dev) && map->mtrr >= 0) {
- int retcode;
- retcode = mtrr_del(map->mtrr, map->offset, map->size);
- DRM_DEBUG("mtrr_del=%d\n", retcode);
- }
+ arch_phys_wc_del(map->mtrr);
break;
case _DRM_SHM:
if (master && (map->flags & _DRM_CONTAINS_LOCK)) {
@@ -542,9 +546,6 @@
__drm_pci_free(dev, &dmah);
#endif
break;
- case _DRM_GEM:
- DRM_ERROR("tried to rmmap GEM object\n");
- break;
}
kfree(map);
@@ -686,7 +687,7 @@
return -EINVAL;
count = request->count;
- order = drm_order(request->size);
+ order = order_base_2(request->size);
size = 1 << order;
alignment = (request->flags & _DRM_PAGE_ALIGN)
@@ -861,7 +862,7 @@
#endif
count = request->count;
- order = drm_order(request->size);
+ order = order_base_2(request->size);
size = 1 << order;
DRM_DEBUG("count=%d, size=%d (%d), order=%d\n",
@@ -1068,7 +1069,7 @@
#endif
count = request->count;
- order = drm_order(request->size);
+ order = order_base_2(request->size);
size = 1 << order;
alignment = (request->flags & _DRM_PAGE_ALIGN)
@@ -1196,166 +1197,6 @@
return 0;
}
-static int drm_addbufs_fb(struct drm_device * dev, struct drm_buf_desc * request)
-{
- struct drm_device_dma *dma = dev->dma;
- struct drm_buf_entry *entry;
- struct drm_buf *buf;
- unsigned long offset;
- unsigned long agp_offset;
- int count;
- int order;
- int size;
- int alignment;
- int page_order;
- int total;
- int byte_count;
- int i;
- struct drm_buf **temp_buflist;
-
- if (!drm_core_check_feature(dev, DRIVER_FB_DMA))
- return -EINVAL;
-
- if (!dma)
- return -EINVAL;
-
-#ifdef __NetBSD__
- if (!DRM_SUSER())
- return -EACCES; /* XXX */
-#else
- if (!capable(CAP_SYS_ADMIN))
- return -EPERM;
-#endif
-
- count = request->count;
- order = drm_order(request->size);
- size = 1 << order;
-
- alignment = (request->flags & _DRM_PAGE_ALIGN)
- ? PAGE_ALIGN(size) : size;
- page_order = order - PAGE_SHIFT > 0 ? order - PAGE_SHIFT : 0;
- total = PAGE_SIZE << page_order;
-
- byte_count = 0;
- agp_offset = request->agp_start;
-
- DRM_DEBUG("count: %d\n", count);
- DRM_DEBUG("order: %d\n", order);
- DRM_DEBUG("size: %d\n", size);
- DRM_DEBUG("agp_offset: %lu\n", agp_offset);
- DRM_DEBUG("alignment: %d\n", alignment);
- DRM_DEBUG("page_order: %d\n", page_order);
Home |
Main Index |
Thread Index |
Old Index