~ubuntu-branches/ubuntu/wily/linux-ti-omap4/wily

« back to all changes in this revision

Viewing changes to ubuntu/i915/i915_gem_stolen.c

  • Committer: Package Import Robot
  • Author(s): Paolo Pisati, Paolo Pisati
  • Date: 2013-07-11 18:35:20 UTC
  • Revision ID: package-import@ubuntu.com-20130711183520-htnf1x4y5r11hndr
Tags: 3.5.0-229.42
* Release Tracking Bug
  - LP: #1199276

[ Paolo Pisati ]

* [Config] CONFIG_ATH9K_LEGACY_RATE_CONTROL is not set

Show diffs side-by-side

added added

removed removed

Lines of Context:
97
97
static void i915_setup_compression(struct drm_device *dev, int size)
98
98
{
99
99
        struct drm_i915_private *dev_priv = dev->dev_private;
100
 
        struct drm_mm_hsw_node *compressed_fb, *uninitialized_var(compressed_llb);
 
100
        struct drm_mm_node_hsw *compressed_fb, *uninitialized_var(compressed_llb);
101
101
        unsigned long cfb_base;
102
102
        unsigned long ll_base = 0;
103
103
 
104
104
        /* Just in case the BIOS is doing something questionable. */
105
105
        intel_disable_fbc(dev);
106
106
 
107
 
        compressed_fb = drm_mm_hsw_search_free(&dev_priv->mm.stolen, size, 4096, 0);
 
107
        compressed_fb = drm_mm_search_free_hsw(&dev_priv->mm.stolen, size, 4096, 0);
108
108
        if (compressed_fb)
109
 
                compressed_fb = drm_mm_hsw_get_block(compressed_fb, size, 4096);
 
109
                compressed_fb = drm_mm_get_block_hsw(compressed_fb, size, 4096);
110
110
        if (!compressed_fb)
111
111
                goto err;
112
112
 
115
115
                goto err_fb;
116
116
 
117
117
        if (!(IS_GM45(dev) || HAS_PCH_SPLIT(dev))) {
118
 
                compressed_llb = drm_mm_hsw_search_free(&dev_priv->mm.stolen,
 
118
                compressed_llb = drm_mm_search_free_hsw(&dev_priv->mm.stolen,
119
119
                                                    4096, 4096, 0);
120
120
                if (compressed_llb)
121
 
                        compressed_llb = drm_mm_hsw_get_block(compressed_llb,
 
121
                        compressed_llb = drm_mm_get_block_hsw(compressed_llb,
122
122
                                                          4096, 4096);
123
123
                if (!compressed_llb)
124
124
                        goto err_fb;
146
146
        return;
147
147
 
148
148
err_llb:
149
 
        drm_mm_hsw_put_block(compressed_llb);
 
149
        drm_mm_put_block_hsw(compressed_llb);
150
150
err_fb:
151
 
        drm_mm_hsw_put_block(compressed_fb);
 
151
        drm_mm_put_block_hsw(compressed_fb);
152
152
err:
153
153
        dev_priv->no_fbc_reason = FBC_STOLEN_TOO_SMALL;
154
154
        i915_warn_stolen(dev);
158
158
{
159
159
        struct drm_i915_private *dev_priv = dev->dev_private;
160
160
 
161
 
        drm_mm_hsw_put_block(dev_priv->compressed_fb);
 
161
        drm_mm_put_block_hsw(dev_priv->compressed_fb);
162
162
        if (dev_priv->compressed_llb)
163
 
                drm_mm_hsw_put_block(dev_priv->compressed_llb);
 
163
                drm_mm_put_block_hsw(dev_priv->compressed_llb);
164
164
}
165
165
 
166
166
void i915_gem_cleanup_stolen(struct drm_device *dev)
182
182
                      dev_priv->mm.gtt->stolen_size, dev_priv->mm.stolen_base);
183
183
 
184
184
        /* Basic memrange allocator for stolen space */
185
 
        drm_mm_hsw_init(&dev_priv->mm.stolen, 0, prealloc_size);
 
185
        drm_mm_init_hsw(&dev_priv->mm.stolen, 0, prealloc_size);
186
186
 
187
187
        /* Try to set up FBC with a reasonable compressed buffer size */
188
188
        if (I915_HAS_FBC(dev) && i915_powersave) {