All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel.vetter@ffwll.ch>
To: Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Subject: [PATCH 07/22] drm/i915: create dev_priv->dri1 dragon dungeon^W^W sub-struct
Date: Mon, 23 Apr 2012 16:50:54 +0200	[thread overview]
Message-ID: <1335192669-10805-8-git-send-email-daniel.vetter@ffwll.ch> (raw)
In-Reply-To: <1335192669-10805-1-git-send-email-daniel.vetter@ffwll.ch>

... and shove allow_batchbuffer in there. More dragons will
follow suit.

There's the curious case that we allow this for KMS ...

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i915/i915_dma.c |   10 +++++-----
 drivers/gpu/drm/i915/i915_drv.h |   11 ++++++++++-
 2 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index a2dda0f..1fa122e 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -198,7 +198,7 @@ static int i915_initialize(struct drm_device * dev, drm_i915_init_t * init)
 
 	/* Allow hardware batchbuffers unless told otherwise.
 	 */
-	dev_priv->allow_batchbuffer = 1;
+	dev_priv->dri1.allow_batchbuffer = 1;
 
 	return 0;
 }
@@ -610,7 +610,7 @@ static int i915_batchbuffer(struct drm_device *dev, void *data,
 	if (drm_core_check_feature(dev, DRIVER_MODESET))
 		return -EINVAL;
 
-	if (!dev_priv->allow_batchbuffer) {
+	if (!dev_priv->dri1.allow_batchbuffer) {
 		DRM_ERROR("Batchbuffer ioctl disabled\n");
 		return -EINVAL;
 	}
@@ -799,7 +799,7 @@ static int i915_getparam(struct drm_device *dev, void *data,
 		value = dev->pdev->irq ? 1 : 0;
 		break;
 	case I915_PARAM_ALLOW_BATCHBUFFER:
-		value = dev_priv->allow_batchbuffer ? 1 : 0;
+		value = dev_priv->dri1.allow_batchbuffer ? 1 : 0;
 		break;
 	case I915_PARAM_LAST_DISPATCH:
 		value = READ_BREADCRUMB(dev_priv);
@@ -882,7 +882,7 @@ static int i915_setparam(struct drm_device *dev, void *data,
 		dev_priv->tex_lru_log_granularity = param->value;
 		break;
 	case I915_SETPARAM_ALLOW_BATCHBUFFER:
-		dev_priv->allow_batchbuffer = param->value;
+		dev_priv->dri1.allow_batchbuffer = param->value ? 1 : 0;
 		break;
 	case I915_SETPARAM_NUM_USED_FENCES:
 		if (param->value > dev_priv->num_fence_regs ||
@@ -1327,7 +1327,7 @@ static int i915_load_gem_init(struct drm_device *dev)
 	}
 
 	/* Allow hardware batchbuffers unless told otherwise. */
-	dev_priv->allow_batchbuffer = 1;
+	dev_priv->dri1.allow_batchbuffer = 1;
 	return 0;
 }
 
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 35321ea..96387bc 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -386,7 +386,6 @@ typedef struct drm_i915_private {
 	struct work_struct hotplug_work;
 
 	int tex_lru_log_granularity;
-	int allow_batchbuffer;
 	unsigned int sr01, adpa, ppcr, dvob, dvoc, lvds;
 	int vblank_pipe;
 	int num_pipe;
@@ -618,6 +617,7 @@ typedef struct drm_i915_private {
 	u32 saveMCHBAR_RENDER_STANDBY;
 	u32 savePCH_PORT_HOTPLUG;
 
+
 	struct {
 		/** Bridge to intel-gtt-ko */
 		const struct intel_gtt *gtt;
@@ -741,6 +741,15 @@ typedef struct drm_i915_private {
 		size_t object_memory;
 		u32 object_count;
 	} mm;
+
+	/* Old dri1 support infrastructure, beware the dragons ya fools entering
+	 * here! */
+	struct {
+		unsigned allow_batchbuffer : 1;
+	} dri1;
+
+	/* Kernel Modesetting */
+
 	struct sdvo_device_mapping sdvo_mappings[2];
 	/* indicate whether the LVDS_BORDER should be enabled or not */
 	unsigned int lvds_border_bits;
-- 
1.7.7.6

  parent reply	other threads:[~2012-04-23 15:55 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-23 14:50 [PATCH 00/22] dri1 dragon slaughtering Daniel Vetter
2012-04-23 14:50 ` [PATCH 01/22] drm/i915: properly check for MODESET for kms driver ioctls Daniel Vetter
2012-04-23 22:23   ` Chris Wilson
2012-04-24  6:19     ` [PATCH] " Daniel Vetter
2012-04-24  8:21       ` Chris Wilson
2012-04-24  7:55         ` Daniel Vetter
2012-04-24  9:25           ` Chris Wilson
2012-04-24  9:41           ` Chris Wilson
2012-04-24  7:19     ` [PATCH 01/22] " Daniel Vetter
2012-04-23 14:50 ` [PATCH 02/22] drm/i915: disallow gem ums init ioctl for kms Daniel Vetter
2012-04-23 22:25   ` Chris Wilson
2012-04-24  6:22     ` [PATCH] " Daniel Vetter
2012-04-23 14:50 ` [PATCH 03/22] drm/i915: rip out GEM drm feature checks Daniel Vetter
2012-04-23 22:28   ` Chris Wilson
2012-04-23 14:50 ` [PATCH 04/22] drm/i915: rip out dev_priv->has_gem Daniel Vetter
2012-04-23 22:29   ` Chris Wilson
2012-04-23 14:50 ` [PATCH 05/22] drm/i915: check for kms in dri1 ioctls Daniel Vetter
2012-04-23 22:31   ` Chris Wilson
2012-04-24  6:29     ` [PATCH] " Daniel Vetter
2012-04-25  9:56       ` Daniel Vetter
2012-04-23 14:50 ` [PATCH 06/22] drm/i915: move dri1 vblank stubs to i915_dma.c Daniel Vetter
2012-04-24  6:35   ` [PATCH] " Daniel Vetter
2012-04-23 14:50 ` Daniel Vetter [this message]
2012-04-23 14:50 ` [PATCH 08/22] drm/i915 disallow physical batchbuffers for KMS Daniel Vetter
2012-04-23 14:50 ` [PATCH 09/22] drm/i915: rip out dev_priv->tex_lru_log_granularity Daniel Vetter
2012-04-23 14:50 ` [PATCH 10/22] drm/i915: remove LP_RING&friends from modeset code Daniel Vetter
2012-04-23 22:36   ` Chris Wilson
2012-04-23 14:50 ` [PATCH 11/22] drm/i915: kill intel_clear_scanline_wait Daniel Vetter
2012-04-23 22:39   ` Chris Wilson
2012-04-23 14:50 ` [PATCH 12/22] drm/i915: rip out dri1 breadcrumb updates from gen5+ irq handlers Daniel Vetter
2012-04-23 22:40   ` Chris Wilson
2012-04-23 14:51 ` [PATCH 13/22] drm/i915: move dri1 irq ioctl code to i915_dma.c Daniel Vetter
2012-04-23 22:41   ` Chris Wilson
2012-04-24  6:37     ` [PATCH] " Daniel Vetter
2012-04-23 14:51 ` [PATCH 14/22] drm/i915: extract dri1 breadcrumb update from irq handler Daniel Vetter
2012-04-23 22:41   ` Chris Wilson
2012-04-23 14:51 ` [PATCH 15/22] drm/i915: move LP_RING&friends to i915_dma.c Daniel Vetter
2012-04-23 22:44   ` Chris Wilson
2012-04-23 14:51 ` [PATCH 16/22] drm/i915: disallow clip rects on gen5+ Daniel Vetter
2012-04-23 14:51 ` [PATCH 17/22] drm/i915: move the ips code to intel_pm.c Daniel Vetter
2012-04-23 14:51 ` [PATCH 18/22] drm/i915: move rps/emon function declarations Daniel Vetter
2012-04-23 14:51 ` [PATCH 19/22] drm/i915: kill pointless clearing of dev_priv->hws_map Daniel Vetter
2012-04-23 22:46   ` Chris Wilson
2012-04-23 14:51 ` [PATCH 20/22] drm/i915: rework legacy GFX HWS handling Daniel Vetter
2012-04-23 14:51 ` [PATCH 21/22] drm/i915: fixup __iomem mixups in ringbuffer.c Daniel Vetter
2012-04-23 14:51 ` [PATCH 22/22] drm/i915: move pnv|ilk_gem_mem_freq to intel_pm.c Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1335192669-10805-8-git-send-email-daniel.vetter@ffwll.ch \
    --to=daniel.vetter@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.