summaryrefslogtreecommitdiff
path: root/linux-core
AgeCommit message (Expand)Author
2004-09-02oops called ctor instead of dtor.. found this on the kernel mergeDave Airlie
2004-09-02Fix ref count problem in stealth mode. pci_get_subsys() with last parameterJon Smirl
2004-08-30implement drm_core_check_feature and use it .. looks lots nicerDave Airlie
2004-08-30drm-memory patch, cleans up alloc/free and makes calloc look more libc likeDave Airlie
2004-08-29add context include so fn are definedDave Airlie
2004-08-29fix up some small things ffb (no idea if it works or not ..)Dave Airlie
2004-08-29remove hacky context thing that was gamma onlyDave Airlie
2004-08-29Drop GAMMA DRM from a great height ...Dave Airlie
2004-08-29fixup issue caused by fntbl-2 mergeDave Airlie
2004-08-28Initialize pdev to NULL correctly so that pci_get_subsys() will work.Jon Smirl
2004-08-27run i915 through lindentDave Airlie
2004-08-27__NO_VERSION__ hasn't been needed since 2.3 days ditch it...Dave Airlie
2004-08-27Make DRM detect vesafb and revert to stealth mode to avoid resourceJon Smirl
2004-08-24Merged drmfntbl-0-0-2Dave Airlie
2004-08-24addmap-base-2 patch from Jon Smirl:Dave Airlie
2004-08-24This patch adds three new ioctl's to the VIA Unichrome/Pro DRM driver:Erdi Chen
2004-08-17Merged drmfntbl-0-0-1Dave Airlie
2004-08-172.6.8.1 has changed the links in /lib/modulesDave Airlie
2004-08-15Fix warning about unused ddev variableJon Smirl
2004-08-15Add dev to DRIVER_CTX_DTOR( dev, pos->handle) so that sis driver willJon Smirl
2004-08-14Add a "dev" argument to DRIVER_CTX_[CD]TOR. This will be used in anEric Anholt
2004-08-11minor patch from Jon Smirl : sets up some things for later useDave Airlie
2004-08-10Patch from Jon Smirl to add attribute field to the pciids, and use this forDave Airlie
2004-08-042.4 compatDave Airlie
2004-08-042.4 hotplug compatDave Airlie
2004-08-03fix for drm in /proc - from Jon SmirlDave Airlie
2004-07-31Add a hotplug event to DRM. Parameters match the ones from the general PCIJon Smirl
2004-07-31athe patch below optimises the drm code to not do put_user() on memory theDave Airlie
2004-07-25sync up with current 2.6 kernel bk tree - mostly __user annotationsDave Airlie
2004-07-25whitespace merge with kernelDave Airlie
2004-07-25if the driver has already register don't do another intermodule registerDave Airlie
2004-07-25Patch from Tom Arbuckle for missing bus_addressDave Airlie
2004-07-22another logic error returns 0 or greater for successDave Airlie
2004-07-21ATI Rage 128 and Radeon DRM unconditionally depend on PCIDave Airlie
2004-07-21add some more debugging fix ++ and --Dave Airlie
2004-07-20first set of __user annotations from kernel (Al Viro)Dave Airlie
2004-07-20Kconfig update add i915 bring over some stuff from kernelDave Airlie
2004-07-20add x86_64 architecture defines from kernel (leave AMD64 defines in forDave Airlie
2004-07-20fix some more NULLs from kernelDave Airlie
2004-07-20attempt to clean up stub_register, register_chrdev isn't good enough toDave Airlie
2004-07-15sparse cleanups from kernel: Al ViroDave Airlie
2004-07-14Fix reference counting for stub for new Linux PCI probeDave Airlie
2004-07-14allow O= usage for Linux 2.6 kernel building in another directoryDave Airlie
2004-07-11split out backwards compat into a separate file makes it easier for mergingDave Airlie
2004-07-11fix issue in 2.4 kernels with returning NULL from this functionDave Airlie
2004-07-08Add two items to Makefile clean XFree86 bug: Reported by: Submitted by:Jon Smirl
2004-07-05fixes from kernel for 0 vs NULL - mikaDave Airlie
2004-06-21fix bug with pci_disable_device in the wrong place (Paul Mackerras) removeDave Airlie
2004-06-12dirty hack to make mach64 work, (don't worry I'll get around to fixing itDave Airlie
2004-06-10A few changes for recent redhat.Keith Whitwell
s="hl opt">; attr[i]; i += 2) { switch (attr[i]) { case KMS_WIDTH: case KMS_HEIGHT: case KMS_BO_TYPE: break; default: return -EINVAL; } } bo = calloc(1, sizeof(*bo)); if (!bo) return -ENOMEM; if (type == KMS_BO_TYPE_CURSOR_64X64_A8R8G8B8) { pitch = 64 * 4; size = 64 * 64 * 4; } else if (type == KMS_BO_TYPE_SCANOUT_X8R8G8B8) { pitch = width * 4; pitch = (pitch + 512 - 1) & ~(512 - 1); size = pitch * ((height + 4 - 1) & ~(4 - 1)); } else { free(bo); return -EINVAL; } memset(&arg, 0, sizeof(arg)); arg.size = size; ret = drmCommandWriteRead(kms->fd, DRM_I915_GEM_CREATE, &arg, sizeof(arg)); if (ret) goto err_free; bo->base.kms = kms; bo->base.handle = arg.handle; bo->base.size = size; bo->base.pitch = pitch; *out = &bo->base; if (type == KMS_BO_TYPE_SCANOUT_X8R8G8B8 && pitch > 512) { struct drm_i915_gem_set_tiling tile; memset(&tile, 0, sizeof(tile)); tile.handle = bo->base.handle; tile.tiling_mode = I915_TILING_X; tile.stride = bo->base.pitch; ret = drmCommandWriteRead(kms->fd, DRM_I915_GEM_SET_TILING, &tile, sizeof(tile)); #if 0 if (ret) { kms_bo_destroy(out); return ret; } #endif } return 0; err_free: free(bo); return ret; } static int intel_bo_get_prop(struct kms_bo *bo, unsigned key, unsigned *out) { switch (key) { default: return -EINVAL; } } static int intel_bo_map(struct kms_bo *_bo, void **out) { struct intel_bo *bo = (struct intel_bo *)_bo; struct drm_i915_gem_mmap_gtt arg; void *map = NULL; int ret; if (bo->base.ptr) { bo->map_count++; *out = bo->base.ptr; return 0; } memset(&arg, 0, sizeof(arg)); arg.handle = bo->base.handle; ret = drmCommandWriteRead(bo->base.kms->fd, DRM_I915_GEM_MMAP_GTT, &arg, sizeof(arg)); if (ret) return ret; map = mmap(0, bo->base.size, PROT_READ | PROT_WRITE, MAP_SHARED, bo->base.kms->fd, arg.offset); if (map == MAP_FAILED) return -errno; bo->base.ptr = map; bo->map_count++; *out = bo->base.ptr; return 0; } static int intel_bo_unmap(struct kms_bo *_bo) { struct intel_bo *bo = (struct intel_bo *)_bo; bo->map_count--; return 0; } static int intel_bo_destroy(struct kms_bo *_bo) { struct intel_bo *bo = (struct intel_bo *)_bo; struct drm_gem_close arg; int ret; if (bo->base.ptr) { /* XXX Sanity check map_count */ munmap(bo->base.ptr, bo->base.size); bo->base.ptr = NULL; } memset(&arg, 0, sizeof(arg)); arg.handle = bo->base.handle; ret = drmIoctl(bo->base.kms->fd, DRM_IOCTL_GEM_CLOSE, &arg); if (ret) return -errno; free(bo); return 0; } int intel_create(int fd, struct kms_driver **out) { struct kms_driver *kms; kms = calloc(1, sizeof(*kms)); if (!kms) return -ENOMEM; kms->fd = fd; kms->bo_create = intel_bo_create; kms->bo_map = intel_bo_map; kms->bo_unmap = intel_bo_unmap; kms->bo_get_prop = intel_bo_get_prop; kms->bo_destroy = intel_bo_destroy; kms->get_prop = intel_get_prop; kms->destroy = intel_destroy; *out = kms; return 0; }