Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a13af4b4 authored by Dave Airlie's avatar Dave Airlie Committed by Dave Airlie
Browse files

agp: add chipset flushing support to AGP interface



This bumps the AGP interface to 0.103.

Certain Intel chipsets contains a global write buffer, and this can require
flushing from the drm or X.org to make sure all data has hit RAM before
initiating a GPU transfer, due to a lack of coherency with the integrated
graphics device and this buffer.

This just adds generic support to the AGP interfaces, a follow-on patch
will add support to the Intel driver to use this interface.

Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 9ef9dc69
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -118,6 +118,7 @@ struct agp_bridge_driver {
	void *(*agp_alloc_page)(struct agp_bridge_data *);
	void (*agp_destroy_page)(void *, int flags);
	int (*agp_type_to_mask_type) (struct agp_bridge_data *, int);
	void (*chipset_flush)(struct agp_bridge_data *);
};

struct agp_bridge_data {
+1 −1
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@
 * fix some real stupidity. It's only by chance we can bump
 * past 0.99 at all due to some boolean logic error. */
#define AGPGART_VERSION_MAJOR 0
#define AGPGART_VERSION_MINOR 102
#define AGPGART_VERSION_MINOR 103
static const struct agp_version agp_current_version =
{
	.major = AGPGART_VERSION_MAJOR,
+4 −0
Original line number Diff line number Diff line
@@ -273,6 +273,10 @@ long compat_agp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
	case AGPIOC_UNBIND32:
		ret_val = compat_agpioc_unbind_wrap(curr_priv, (void __user *) arg);
		break;

	case AGPIOC_CHIPSET_FLUSH32:
		ret_val = agpioc_chipset_flush_wrap(curr_priv);
		break;
	}

ioctl_out:
+2 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@
#define AGPIOC_DEALLOCATE32 _IOW (AGPIOC_BASE, 7, compat_int_t)
#define AGPIOC_BIND32       _IOW (AGPIOC_BASE, 8, compat_uptr_t)
#define AGPIOC_UNBIND32     _IOW (AGPIOC_BASE, 9, compat_uptr_t)
#define AGPIOC_CHIPSET_FLUSH32 _IO (AGPIOC_BASE, 10)

struct agp_info32 {
	struct agp_version version;	/* version of the driver        */
@@ -101,5 +102,6 @@ void agp_free_memory_wrap(struct agp_memory *memory);
struct agp_memory *agp_allocate_memory_wrap(size_t pg_count, u32 type);
struct agp_memory *agp_find_mem_by_key(int key);
struct agp_client *agp_find_client_by_pid(pid_t id);
int agpioc_chipset_flush_wrap(struct agp_file_private *priv);

#endif /* _AGP_COMPAT_H */
+11 −0
Original line number Diff line number Diff line
@@ -960,6 +960,13 @@ static int agpioc_unbind_wrap(struct agp_file_private *priv, void __user *arg)
	return agp_unbind_memory(memory);
}

int agpioc_chipset_flush_wrap(struct agp_file_private *priv)
{
	DBG("");
	agp_flush_chipset(agp_bridge);
	return 0;
}

static int agp_ioctl(struct inode *inode, struct file *file,
		     unsigned int cmd, unsigned long arg)
{
@@ -1033,6 +1040,10 @@ static int agp_ioctl(struct inode *inode, struct file *file,
	case AGPIOC_UNBIND:
		ret_val = agpioc_unbind_wrap(curr_priv, (void __user *) arg);
		break;
	       
	case AGPIOC_CHIPSET_FLUSH:
		ret_val = agpioc_chipset_flush_wrap(curr_priv);
		break;
	}

ioctl_out:
Loading