]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
drm/i915: create dev_priv->dri1 dragon dungeon^W^W sub-struct
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 2 May 2012 09:49:32 +0000 (11:49 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 3 May 2012 09:18:25 +0000 (11:18 +0200)
... and shove allow_batchbuffer in there. More dragons will
follow suit.

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

Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_dma.c
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_gem.c

index 5fde7ed86b1736dd7683bd7bddd5d3908fcf2993..3b068a3917a9a89e24417d22a537612d66dc409e 100644 (file)
@@ -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 -ENODEV;
 
-       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 ||
index 2de9947b7e6af76e0e11467e66346783e8d523fa..65af417b823a0a49bad91e56bea867cea88995f3 100644 (file)
@@ -399,7 +399,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 num_pipe;
        int num_pch_pll;
@@ -740,6 +739,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;
index 293f573803ab3335aa44e142e9fc7315302f3b7e..5e34775aa3a2fa02ae6f507e723aad90c2c44011 100644 (file)
@@ -3568,7 +3568,7 @@ int i915_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;
 }