Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 260056
b: refs/heads/master
c: 7dfe43c
h: refs/heads/master
v: v3
  • Loading branch information
Alan Cox authored and Greg Kroah-Hartman committed Jul 15, 2011
1 parent 80b867c commit c6c4ea4
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bd7b9f91ddc2d08381a853bd33b3ce7d0012b1df
refs/heads/master: 7dfe43c52d2cd595964c38281499c5361a0a8e85
8 changes: 8 additions & 0 deletions trunk/drivers/staging/gma500/gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,3 +261,11 @@ int psb_gem_create_ioctl(struct drm_device *dev, void *data,
return psb_gem_create(file, dev, args->size, &args->handle);
}

int psb_gem_mmap_ioctl(struct drm_device *dev, void *data,
struct drm_file *file)
{
struct drm_psb_gem_mmap *args = data;
return dev->driver->dumb_map_offset(file, dev,
args->handle, &args->offset);
}

12 changes: 12 additions & 0 deletions trunk/drivers/staging/gma500/psb_drm.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ struct drm_psb_register_rw_arg {

#define DRM_PSB_GEM_CREATE 0x10
#define DRM_PSB_2D_OP 0x11
#define DRM_PSB_GEM_MMAP 0x12
#define DRM_PSB_DPST 0x1B
#define DRM_PSB_GAMMA 0x1C
#define DRM_PSB_DPST_BL 0x1D
Expand Down Expand Up @@ -203,4 +204,15 @@ struct drm_psb_2d_op {
__u32 cmd[PSB_2D_OP_BUFLEN];
};

struct drm_psb_gem_mmap {
__u32 handle;
__u32 pad;
/**
* Fake offset to use for subsequent mmap call
*
* This is a fixed-size type for 32/64 compatibility.
*/
__u64 offset;
};

#endif
8 changes: 7 additions & 1 deletion trunk/drivers/staging/gma500/psb_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ MODULE_DEVICE_TABLE(pci, pciidlist);
#define DRM_IOCTL_PSB_2D_OP \
DRM_IOW(DRM_PSB_2D_OP + DRM_COMMAND_BASE, \
struct drm_psb_2d_op)
#define DRM_IOCTL_PSB_GEM_MMAP \
DRM_IOWR(DRM_PSB_GEM_MMAP + DRM_COMMAND_BASE, \
struct drm_psb_gem_mmap)

static int psb_sizes_ioctl(struct drm_device *dev, void *data,
struct drm_file *file_priv);
Expand Down Expand Up @@ -167,7 +170,10 @@ static struct drm_ioctl_desc psb_ioctls[] = {
psb_intel_get_pipe_from_crtc_id, 0),
PSB_IOCTL_DEF(DRM_IOCTL_PSB_GEM_CREATE, psb_gem_create_ioctl,
DRM_UNLOCKED | DRM_AUTH),
PSB_IOCTL_DEF(DRM_IOCTL_PSB_2D_OP, psb_accel_ioctl, DRM_UNLOCKED),
PSB_IOCTL_DEF(DRM_IOCTL_PSB_2D_OP, psb_accel_ioctl,
DRM_UNLOCKED| DRM_AUTH),
PSB_IOCTL_DEF(DRM_IOCTL_PSB_GEM_MMAP, psb_gem_mmap_ioctl,
DRM_UNLOCKED | DRM_AUTH),
};

static void psb_lastclose(struct drm_device *dev)
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/staging/gma500/psb_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,8 @@ extern int psb_gem_dumb_map_gtt(struct drm_file *file, struct drm_device *dev,
extern int psb_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf);
extern int psb_gem_create_ioctl(struct drm_device *dev, void *data,
struct drm_file *file);
extern int psb_gem_mmap_ioctl(struct drm_device *dev, void *data,
struct drm_file *file);

/* psb_device.c */
extern const struct psb_ops psb_chip_ops;
Expand Down

0 comments on commit c6c4ea4

Please sign in to comment.