Skip to contentSkip to conversation

gma500: begin pruning dead bits of API

PATCH New Alan Cox 1 participant 4 messages Nov 16, 2011

Subsystems (3)
lore
Share & tools
lore

Alan Cox

author
#0 lore raw

PATCH 1/4 gma500: begin pruning dead bits of API

From: Alan Cox <[email protected]>

At this point we won't add an external set of definitions. We want to get everything out before we admit to a public API beyond the standardised ones.

---

 drivers/gpu/drm/gma500/psb_drm.h |  159 ++----------
 drivers/gpu/drm/gma500/psb_drv.c |  507 --------------------------------------
 drivers/gpu/drm/gma500/psb_drv.h |    2 
 3 files changed, 24 insertions(+), 644 deletions(-)
drivers/gpu/drm/gma500/psb_drm.h +23 -136
index dca7b20..72eeb7a 100644
@@ -24,168 +24,41 @@
 
 #define PSB_NUM_PIPE 3
 
-#define PSB_GPU_ACCESS_READ         (1ULL << 32)
-#define PSB_GPU_ACCESS_WRITE        (1ULL << 33)
-#define PSB_GPU_ACCESS_MASK         (PSB_GPU_ACCESS_READ | PSB_GPU_ACCESS_WRITE)
-
-#define PSB_BO_FLAG_COMMAND         (1ULL << 52)
 
 /*
- * Feedback components:
+ *	Manage the LUT for an output
  */
-
-struct drm_psb_sizes_arg {
-	u32 ta_mem_size;
-	u32 mmu_size;
-	u32 pds_size;
-	u32 rastgeom_size;
-	u32 tt_size;
-	u32 vram_size;
-};
-
 struct drm_psb_dpst_lut_arg {
 	uint8_t lut[256];
 	int output_id;
 };
 
-#define PSB_DC_CRTC_SAVE 0x01
-#define PSB_DC_CRTC_RESTORE 0x02
-#define PSB_DC_OUTPUT_SAVE 0x04
-#define PSB_DC_OUTPUT_RESTORE 0x08
-#define PSB_DC_CRTC_MASK 0x03
-#define PSB_DC_OUTPUT_MASK 0x0C
-
-struct drm_psb_dc_state_arg {
-	u32 flags;
-	u32 obj_id;
-};
-
+/*
+ *	Validate modes
+ */
 struct drm_psb_mode_operation_arg {
 	u32 obj_id;
 	u16 operation;
 	struct drm_mode_modeinfo mode;
-	void *data;
+	u64 data;
 };
 
+/*
+ *	Query the stolen memory for smarter management of
+ *	memory by the server
+ */
 struct drm_psb_stolen_memory_arg {
 	u32 base;
 	u32 size;
 };
 
-/*Display Register Bits*/
-#define REGRWBITS_PFIT_CONTROLS			(1 << 0)
-#define REGRWBITS_PFIT_AUTOSCALE_RATIOS		(1 << 1)
-#define REGRWBITS_PFIT_PROGRAMMED_SCALE_RATIOS	(1 << 2)
-#define REGRWBITS_PIPEASRC			(1 << 3)
-#define REGRWBITS_PIPEBSRC			(1 << 4)
-#define REGRWBITS_VTOTAL_A			(1 << 5)
-#define REGRWBITS_VTOTAL_B			(1 << 6)
-#define REGRWBITS_DSPACNTR	(1 << 8)
-#define REGRWBITS_DSPBCNTR	(1 << 9)
-#define REGRWBITS_DSPCCNTR	(1 << 10)
-
-/*Overlay Register Bits*/
-#define OV_REGRWBITS_OVADD			(1 << 0)
-#define OV_REGRWBITS_OGAM_ALL			(1 << 1)
-
-#define OVC_REGRWBITS_OVADD                  (1 << 2)
-#define OVC_REGRWBITS_OGAM_ALL			(1 << 3)
-
-struct drm_psb_register_rw_arg {
-	u32 b_force_hw_on;
-
-	u32 display_read_mask;
-	u32 display_write_mask;
-
-	struct {
-		u32 pfit_controls;
-		u32 pfit_autoscale_ratios;
-		u32 pfit_programmed_scale_ratios;
-		u32 pipeasrc;
-		u32 pipebsrc;
-		u32 vtotal_a;
-		u32 vtotal_b;
-	} display;
-
-	u32 overlay_read_mask;
-	u32 overlay_write_mask;
-
-	struct {
-		u32 OVADD;
-		u32 OGAMC0;
-		u32 OGAMC1;
-		u32 OGAMC2;
-		u32 OGAMC3;
-		u32 OGAMC4;
-		u32 OGAMC5;
-		u32 IEP_ENABLED;
-		u32 IEP_BLE_MINMAX;
-		u32 IEP_BSSCC_CONTROL;
-		u32 b_wait_vblank;
-	} overlay;
-
-	u32 sprite_enable_mask;
-	u32 sprite_disable_mask;
-
-	struct {
-		u32 dspa_control;
-		u32 dspa_key_value;
-		u32 dspa_key_mask;
-		u32 dspc_control;
-		u32 dspc_stride;
-		u32 dspc_position;
-		u32 dspc_linear_offset;
-		u32 dspc_size;
-		u32 dspc_surface;
-	} sprite;
-
-	u32 subpicture_enable_mask;
-	u32 subpicture_disable_mask;
-};
-
-/* Controlling the kernel modesetting buffers */
-
-#define DRM_PSB_SIZES           0x07
-#define DRM_PSB_FUSE_REG	0x08
-#define DRM_PSB_DC_STATE	0x0A
-#define DRM_PSB_ADB		0x0B
-#define DRM_PSB_MODE_OPERATION	0x0C
-#define DRM_PSB_STOLEN_MEMORY	0x0D
-#define DRM_PSB_REGISTER_RW	0x0E
-
-/*
- * NOTE: Add new commands here, but increment
- * the values below and increment their
- * corresponding defines where they're
- * defined elsewhere.
- */
-
-#define DRM_PSB_GEM_CREATE	0x10
-#define DRM_PSB_2D_OP		0x11		/* Will be merged later */
-#define DRM_PSB_GEM_MMAP	0x12
-#define DRM_PSB_DPST		0x1B
-#define DRM_PSB_GAMMA		0x1C
-#define DRM_PSB_DPST_BL		0x1D
-#define DRM_PSB_GET_PIPE_FROM_CRTC_ID 0x1F
-
-#define PSB_MODE_OPERATION_MODE_VALID	0x01
-#define PSB_MODE_OPERATION_SET_DC_BASE  0x02
-
 struct drm_psb_get_pipe_from_crtc_id_arg {
 	/** ID of CRTC being requested **/
 	u32 crtc_id;
-
 	/** pipe of requested CRTC **/
 	u32 pipe;
 };
 
-/* FIXME: move this into a medfield header once we are sure it isn't needed for an
-   ioctl  */
-struct psb_drm_dpu_rect {  
-	int x, y;             
-	int width, height;    
-};  
-
 struct drm_psb_gem_create {
 	__u64 size;
 	__u32 handle;
@@ -204,4 +77,18 @@ struct drm_psb_gem_mmap {
 	__u64 offset;
 };
 
+/* Controlling the kernel modesetting buffers */
+
+#define DRM_PSB_GEM_CREATE	0x00		/* Create a GEM object */
+#define DRM_PSB_GEM_MMAP	0x01		/* Map GEM memory */
+#define DRM_PSB_STOLEN_MEMORY	0x02		/* Report stolen memory */
+#define DRM_PSB_2D_OP		0x03		/* Will be merged later */
+#define DRM_PSB_GAMMA		0x04		/* Set gamma table */
+#define DRM_PSB_ADB		0x05		/* Get backlight */
+#define DRM_PSB_DPST_BL		0x06		/* Set backlight */
+#define DRM_PSB_GET_PIPE_FROM_CRTC_ID 0x1	/* CRTC to physical pipe# */
+#define DRM_PSB_MODE_OPERATION	0x07		/* Mode validation/DC set */
+#define 	PSB_MODE_OPERATION_MODE_VALID	0x01
+
+
 #endif
drivers/gpu/drm/gma500/psb_drv.c +1 -506

581 lines not on this page · raw message

drivers/gpu/drm/gma500/psb_drv.h +0 -2
index a5ae9b1..9567748 100644
@@ -324,8 +324,6 @@ struct drm_psb_private {
 	 * Sizes info
 	 */
 
-	struct drm_psb_sizes_arg sizes;
-
 	u32 fuse_reg_value;
 	u32 video_device_fuse;
author
#1 lore raw

PATCH 2/4 gma500: Rename the ioctls to avoid clashing with the legacy drivers

From: Alan Cox <[email protected]>

---

 drivers/gpu/drm/gma500/gem.c     |    4 ++--
 drivers/gpu/drm/gma500/psb_drm.h |   20 ++++++++++----------
 drivers/gpu/drm/gma500/psb_drv.c |   16 ++++++++--------
 3 files changed, 20 insertions(+), 20 deletions(-)
drivers/gpu/drm/gma500/gem.c +2 -2
index 65fdd6b..d743679 100644
@@ -274,13 +274,13 @@ int psb_gem_create_ioctl(struct drm_device *dev, void *data,
 {
 	struct drm_psb_gem_create *args = data;
 	int ret;
-	if (args->flags & PSB_GEM_CREATE_STOLEN) {
+	if (args->flags & GMA_GEM_CREATE_STOLEN) {
 		ret = psb_gem_create_stolen(file, dev, args->size,
 							&args->handle);
 		if (ret == 0)
 			return 0;
 		/* Fall throguh */
-		args->flags &= ~PSB_GEM_CREATE_STOLEN;
+		args->flags &= ~GMA_GEM_CREATE_STOLEN;
 	}
 	return psb_gem_create(file, dev, args->size, &args->handle);
 }
drivers/gpu/drm/gma500/psb_drm.h +10 -10
index 72eeb7a..6ded343 100644
@@ -63,7 +63,7 @@ struct drm_psb_gem_create {
 	__u64 size;
 	__u32 handle;
 	__u32 flags;
-#define PSB_GEM_CREATE_STOLEN		1	/* Stolen memory can be used */
+#define GMA_GEM_CREATE_STOLEN		1	/* Stolen memory can be used */
 };
 
 struct drm_psb_gem_mmap {
@@ -79,15 +79,15 @@ struct drm_psb_gem_mmap {
 
 /* Controlling the kernel modesetting buffers */
 
-#define DRM_PSB_GEM_CREATE	0x00		/* Create a GEM object */
-#define DRM_PSB_GEM_MMAP	0x01		/* Map GEM memory */
-#define DRM_PSB_STOLEN_MEMORY	0x02		/* Report stolen memory */
-#define DRM_PSB_2D_OP		0x03		/* Will be merged later */
-#define DRM_PSB_GAMMA		0x04		/* Set gamma table */
-#define DRM_PSB_ADB		0x05		/* Get backlight */
-#define DRM_PSB_DPST_BL		0x06		/* Set backlight */
-#define DRM_PSB_GET_PIPE_FROM_CRTC_ID 0x1	/* CRTC to physical pipe# */
-#define DRM_PSB_MODE_OPERATION	0x07		/* Mode validation/DC set */
+#define DRM_GMA_GEM_CREATE	0x00		/* Create a GEM object */
+#define DRM_GMA_GEM_MMAP	0x01		/* Map GEM memory */
+#define DRM_GMA_STOLEN_MEMORY	0x02		/* Report stolen memory */
+#define DRM_GMA_2D_OP		0x03		/* Will be merged later */
+#define DRM_GMA_GAMMA		0x04		/* Set gamma table */
+#define DRM_GMA_ADB		0x05		/* Get backlight */
+#define DRM_GMA_DPST_BL		0x06		/* Set backlight */
+#define DRM_GMA_GET_PIPE_FROM_CRTC_ID 0x1	/* CRTC to physical pipe# */
+#define DRM_GMA_MODE_OPERATION	0x07		/* Mode validation/DC set */
 #define 	PSB_MODE_OPERATION_MODE_VALID	0x01
 
 
drivers/gpu/drm/gma500/psb_drv.c +8 -8
index 2d5050e..9294e71 100644
@@ -81,27 +81,27 @@ MODULE_DEVICE_TABLE(pci, pciidlist);
  */
 
 #define DRM_IOCTL_PSB_ADB	\
-		DRM_IOWR(DRM_PSB_ADB + DRM_COMMAND_BASE, uint32_t)
+		DRM_IOWR(DRM_GMA_ADB + DRM_COMMAND_BASE, uint32_t)
 #define DRM_IOCTL_PSB_MODE_OPERATION	\
-		DRM_IOWR(DRM_PSB_MODE_OPERATION + DRM_COMMAND_BASE, \
+		DRM_IOWR(DRM_GMA_MODE_OPERATION + DRM_COMMAND_BASE, \
 			 struct drm_psb_mode_operation_arg)
 #define DRM_IOCTL_PSB_STOLEN_MEMORY	\
-		DRM_IOWR(DRM_PSB_STOLEN_MEMORY + DRM_COMMAND_BASE, \
+		DRM_IOWR(DRM_GMA_STOLEN_MEMORY + DRM_COMMAND_BASE, \
 			 struct drm_psb_stolen_memory_arg)
 #define DRM_IOCTL_PSB_GAMMA	\
-		DRM_IOWR(DRM_PSB_GAMMA + DRM_COMMAND_BASE, \
+		DRM_IOWR(DRM_GMA_GAMMA + DRM_COMMAND_BASE, \
 			 struct drm_psb_dpst_lut_arg)
 #define DRM_IOCTL_PSB_DPST_BL	\
-		DRM_IOWR(DRM_PSB_DPST_BL + DRM_COMMAND_BASE, \
+		DRM_IOWR(DRM_GMA_DPST_BL + DRM_COMMAND_BASE, \
 			 uint32_t)
 #define DRM_IOCTL_PSB_GET_PIPE_FROM_CRTC_ID	\
-		DRM_IOWR(DRM_PSB_GET_PIPE_FROM_CRTC_ID + DRM_COMMAND_BASE, \
+		DRM_IOWR(DRM_GMA_GET_PIPE_FROM_CRTC_ID + DRM_COMMAND_BASE, \
 			 struct drm_psb_get_pipe_from_crtc_id_arg)
 #define DRM_IOCTL_PSB_GEM_CREATE	\
-		DRM_IOWR(DRM_PSB_GEM_CREATE + DRM_COMMAND_BASE, \
+		DRM_IOWR(DRM_GMA_GEM_CREATE + DRM_COMMAND_BASE, \
 			 struct drm_psb_gem_create)
 #define DRM_IOCTL_PSB_GEM_MMAP	\
-		DRM_IOWR(DRM_PSB_GEM_MMAP + DRM_COMMAND_BASE, \
+		DRM_IOWR(DRM_GMA_GEM_MMAP + DRM_COMMAND_BASE, \
 			 struct drm_psb_gem_mmap)
 
 static int psb_adb_ioctl(struct drm_device *dev, void *data,
author
#2 lore raw

PATCH 3/4 gma500: kill off NUM_PIPE define

In reply to Alan Cox

From: Alan Cox <[email protected]>

We don't want this external in case someone adds more to the hardware. We want it out of the ABI.

---

 drivers/gpu/drm/gma500/psb_drm.h |    3 ---
 drivers/gpu/drm/gma500/psb_drv.h |    2 ++
 2 files changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/gma500/psb_drm.h +0 -3
index 6ded343..1136867 100644
@@ -22,9 +22,6 @@
 #ifndef _PSB_DRM_H_
 #define _PSB_DRM_H_
 
-#define PSB_NUM_PIPE 3
-
-
 /*
  *	Manage the LUT for an output
  */
drivers/gpu/drm/gma500/psb_drv.h +2 -0
index 9567748..ffb05f2 100644
@@ -258,6 +258,8 @@ struct psb_intel_opregion {
 
 struct psb_ops;
 
+#define PSB_NUM_PIPE		3
+
 struct drm_psb_private {
 	struct drm_device *dev;
 	const struct psb_ops *ops;
author
#3 lore raw

PATCH 4/4 gma500: Move the API

In reply to Alan Cox

From: Alan Cox <[email protected]>

Finally move the API where it can be seen

---

 drivers/gpu/drm/gma500/cdv_device.c      |    2 -
 drivers/gpu/drm/gma500/gem.c             |    2 -
 drivers/gpu/drm/gma500/intel_bios.c      |    2 -
 drivers/gpu/drm/gma500/mid_bios.c        |    2 -
 drivers/gpu/drm/gma500/oaktrail_device.c |    2 -
 drivers/gpu/drm/gma500/psb_device.c      |    2 -
 drivers/gpu/drm/gma500/psb_drm.h         |   91 ------------------------------
 drivers/gpu/drm/gma500/psb_drv.c         |    2 -
 drivers/gpu/drm/gma500/psb_drv.h         |    2 -
 include/drm/gma_drm.h                    |   91 ++++++++++++++++++++++++++++++
 10 files changed, 99 insertions(+), 99 deletions(-)
 delete mode 100644 drivers/gpu/drm/gma500/psb_drm.h
 create mode 100644 include/drm/gma_drm.h
drivers/gpu/drm/gma500/cdv_device.c +1 -1
index 87614e0..c0583df 100644
@@ -20,7 +20,7 @@
 #include <linux/backlight.h>
 #include <drm/drmP.h>
 #include <drm/drm.h>
-#include "psb_drm.h"
+#include "gma_drm.h"
 #include "psb_drv.h"
 #include "psb_reg.h"
 #include "psb_intel_reg.h"
drivers/gpu/drm/gma500/gem.c +1 -1
index d743679..fdc8b5d 100644
@@ -25,7 +25,7 @@
 
 #include <drm/drmP.h>
 #include <drm/drm.h>
-#include "psb_drm.h"
+#include "gma_drm.h"
 #include "psb_drv.h"
 
 int psb_gem_init_object(struct drm_gem_object *obj)
drivers/gpu/drm/gma500/intel_bios.c +1 -1
index 096757f..d4d0c5b 100644
@@ -20,7 +20,7 @@
  */
 #include <drm/drmP.h>
 #include <drm/drm.h>
-#include "psb_drm.h"
+#include "gma_drm.h"
 #include "psb_drv.h"
 #include "psb_intel_drv.h"
 #include "psb_intel_reg.h"
drivers/gpu/drm/gma500/mid_bios.c +1 -1
index 7115d1a..018ab46 100644
@@ -25,7 +25,7 @@
 
 #include <drm/drmP.h>
 #include <drm/drm.h>
-#include "psb_drm.h"
+#include "gma_drm.h"
 #include "psb_drv.h"
 #include "mid_bios.h"
 
drivers/gpu/drm/gma500/oaktrail_device.c +1 -1
index 41c418f..57ad3ea6 100644
@@ -22,7 +22,7 @@
 #include <linux/dmi.h>
 #include <drm/drmP.h>
 #include <drm/drm.h>
-#include "psb_drm.h"
+#include "gma_drm.h"
 #include "psb_drv.h"
 #include "psb_reg.h"
 #include "psb_intel_reg.h"
drivers/gpu/drm/gma500/psb_device.c +1 -1
index 4659132..9d6959a 100644
@@ -20,7 +20,7 @@
 #include <linux/backlight.h>
 #include <drm/drmP.h>
 #include <drm/drm.h>
-#include "psb_drm.h"
+#include "gma_drm.h"
 #include "psb_drv.h"
 #include "psb_reg.h"
 #include "psb_intel_reg.h"
drivers/gpu/drm/gma500/psb_drm.h deleted +0 -91

91 lines not on this page · raw message

drivers/gpu/drm/gma500/psb_drv.c +1 -1
index 9294e71..5c7a2a9 100644
@@ -22,7 +22,7 @@
 #include <drm/drmP.h>
 #include <drm/drm.h>
 #include <linux/module.h>
-#include "psb_drm.h"
+#include "gma_drm.h"
 #include "psb_drv.h"
 #include "framebuffer.h"
 #include "psb_reg.h"
drivers/gpu/drm/gma500/psb_drv.h +1 -1
index ffb05f2..5e6171a 100644
@@ -25,7 +25,7 @@
 #include <drm/drmP.h>
 #include "drm_global.h"
 #include "gem_glue.h"
-#include "psb_drm.h"
+#include "gma_drm.h"
 #include "psb_reg.h"
 #include "psb_intel_drv.h"
 #include "gtt.h"
include/drm/gma_drm.h new file +91 -0

91 lines not on this page · raw message