~ubuntu-branches/ubuntu/saucy/linux-armadaxp/saucy

« back to all changes in this revision

Viewing changes to drivers/gpu/drm/i915/intel_display.c

  • Committer: Package Import Robot
  • Author(s): Jani Monoses, Jani Monoses, Ubuntu: 3.2.0-27.43, Ubuntu: 3.2.0-27.42
  • Date: 2012-07-08 00:06:22 UTC
  • Revision ID: package-import@ubuntu.com-20120708000622-8kaiz3awn5ya9du7
Tags: 3.2.0-1605.8
* Release Tracking Bug
 -LP: #1020888

[ Jani Monoses ]

* Fix warnings.
* Adapt to new sched_clock API

[ Ubuntu: 3.2.0-27.43 ]

* No change upload to fix .ddeb generation in the PPA.
* Release Tracking Bug
  - LP: #1020016

[ Ubuntu: 3.2.0-27.42 ]

* Release Tracking Bug
  - LP: #1020016
* PACKAGING: add .gnu_debuglink sections to .ko files
  - LP: #669641
* [Config] Updateconfigs
  - LP: #1008345
* SAUCE: (upstreamed) [media] ene_ir: Fix driver initialisation
  - LP: #1014800
* SAUCE: ocfs2: Fix NULL pointer dereferrence in
  __ocfs2_change_file_space
  - LP: #1006012
* SAUCE: net: calxedaxgmac: enable rx cut-thru mode
  - LP: #1008345
* SAUCE: EDAC: Add support for the highbank platform memory
  - LP: #1008345
* SAUCE: EDAC: add support for highbank platform L2 cache ecc
  - LP: #1008345
* (pre-stable): bcma: add ext PA workaround for BCM4331 and BCM43431
  - LP: #925577
* SAUCE: ALSA: hda - Fix power-map regression for HP dv6 & co
  - LP: #1013183
* [Config] Enable CONFIG_CGROUPS for highbank
  - LP: #1014692
* Revert "net: maintain namespace isolation between vlan and real device"
  - LP: #1013723
* x86/amd: Re-enable CPU topology extensions in case BIOS has disabled it
  - LP: #1009087
* hwmon: (k10temp) Add support for AMD Trinity CPUs
  - LP: #1009086
* hwmon: (fam15h_power) Increase output resolution
  - LP: #1009086
* Input: wacom - use BTN_TOOL_FINGER to indicate touch device type
  - LP: #1009435
* Input: wacom - use switch statement for wacom_tpc_irq()
  - LP: #1009435
* Input: wacom - isolate input registration
  - LP: #1009435
* Input: wacom - wireless monitor framework
  - LP: #1009435
* Input: wacom - create inputs when wireless connect
  - LP: #1009435
* Input: wacom - wireless battery status
  - LP: #1009435
* Input: wacom - check for allocation failure in probe()
  - LP: #1009435
* Input: wacom - add basic Intuos5 support
  - LP: #1009435
* Input: wacom - add Intuos5 Touch Ring/ExpressKey support
  - LP: #1009435
* Input: wacom - add Intuos5 Touch Ring LED support
  - LP: #1009435
* Input: wacom - add Intuos5 multitouch sensor support
  - LP: #1009435
* iommu/amd: Add workaround for event log erratum
  - LP: #1013723
* MIPS: BCM63XX: Add missing include for bcm63xx_gpio.h
  - LP: #1013723
* cifs: Include backup intent search flags during searches {try #2)
  - LP: #1013723
* sunrpc: fix loss of task->tk_status after rpc_delay call in
  xprt_alloc_slot
  - LP: #1013723
* exofs: Fix CRASH on very early IO errors.
  - LP: #1013723
* cifs: fix oops while traversing open file list (try #4)
  - LP: #1013723
* Fix dm-multipath starvation when scsi host is busy
  - LP: #1013723
* ixp4xx: fix compilation by adding gpiolib support
  - LP: #1013723
* drm/i915: properly handle interlaced bit for sdvo dtd conversion
  - LP: #1013723
* drm/i915: enable vdd when switching off the eDP panel
  - LP: #1013723
* drm/i915: Ignore LVDS on hp t5745 and hp st5747 thin client
  - LP: #1013723
* drm/i915: no lvds quirk for HP t5740e Thin Client
  - LP: #1013723
* drm/i915: wait for a vblank to pass after tv detect
  - LP: #1013723
* drm/i915: Update GEN6_RP_CONTROL definitions
  - LP: #1013723
* drm/i915: always use RPNSWREQ for turbo change requests
  - LP: #1013723
* solos-pci: Fix DMA support
  - LP: #1013723
* microblaze: Do not select GENERIC_GPIO by default
  - LP: #1013723
* fix boot failure on 32-bit systems caused by branch stubs placed before
  .text
  - LP: #1013723
* fix TLB fault path on PA2.0 narrow systems
  - LP: #1013723
* iwlwifi: update BT traffic load states correctly
  - LP: #1013723
* iwlwifi: do not use shadow registers by default
  - LP: #1013723
* wl1251: fix oops on early interrupt
  - LP: #1013723
* NFSv4: Map NFS4ERR_SHARE_DENIED into an EACCES error instead of EIO
  - LP: #1013723
* drm/radeon: fix XFX quirk
  - LP: #1013723
* ath9k: fix a use-after-free-bug when ath_tx_setup_buffer() fails
  - LP: #1013723
* mac80211: fix ADDBA declined after suspend with wowlan
  - LP: #1013723
* mm/fork: fix overflow in vma length when copying mmap on clone
  - LP: #1013723
* mm: consider all swapped back pages in used-once logic
  - LP: #1013723
* hugetlb: fix resv_map leak in error path
  - LP: #1013723
* mm/vmalloc.c: change void* into explict vm_struct*
  - LP: #1013723
* mm: fix faulty initialization in vmalloc_init()
  - LP: #1013723
* fix scsi_wait_scan
  - LP: #1013723
* mm: fix vma_resv_map() NULL pointer
  - LP: #1013723
* x86, amd, xen: Avoid NULL pointer paravirt references
  - LP: #1013723
* slub: fix a memory leak in get_partial_node()
  - LP: #1013723
* ext4: force ro mount if ext4_setup_super() fails
  - LP: #1013723
* ext4: disallow hard-linked directory in ext4_lookup
  - LP: #1013723
* mtd: nand: fix scan_read_raw_oob
  - LP: #1013723
* vfs: increment iversion when a file is truncated
  - LP: #1013723
* vfs: umount_tree() might be called on subtree that had never made it
  - LP: #1013723
* ext4: add missing save_error_info() to ext4_error()
  - LP: #1013723
* ALSA: usb-audio: fix rate_list memory leak
  - LP: #1013723
* ext4: add ext4_mb_unload_buddy in the error path
  - LP: #1013723
* ext4: remove mb_groups before tearing down the buddy_cache
  - LP: #1013723
* drm/radeon: fix bank information in tiling config
  - LP: #1013723
* drm/radeon: properly program gart on rv740, juniper, cypress, barts,
  hemlock
  - LP: #1013723
* drm/radeon: fix HD6790, HD6570 backend programming
  - LP: #1013723
* drm/ttm: Fix spinlock imbalance
  - LP: #1013723
* drm/vmwgfx: Fix nasty write past alloced memory area
  - LP: #1013723
* mtd: of_parts: fix breakage in Kconfig
  - LP: #1013723
* fec_mpc52xx: fix timestamp filtering
  - LP: #1013723
* Bluetooth: btusb: Add USB device ID "0a5c 21e8"
  - LP: #1013723
* Bluetooth: btusb: typo in Broadcom SoftSailing id
  - LP: #1013723
* Bluetooth: Add support for Atheros [13d3:3362]
  - LP: #1013723
* Bluetooth: Add support for AR3012 [0cf3:e004]
  - LP: #1013723, #922715
* Add Foxconn / Hon Hai IDs for btusb module
  - LP: #1013723
* Bluetooth: Add support for Foxconn/Hon Hai AR5BBU22 0489:E03C
  - LP: #1013723
* ipv4: Do not use dead fib_info entries.
  - LP: #1013723
* ipv4: fix the rcu race between free_fib_info and ip_route_output_slow
  - LP: #1013723
* set fake_rtable's dst to NULL to avoid kernel Oops
  - LP: #1013723
* ipv6: fix incorrect ipsec fragment
  - LP: #1013723
* l2tp: fix oops in L2TP IP sockets for connect() AF_UNSPEC case
  - LP: #1013723
* r8169: missing barriers.
  - LP: #1013723
* r8169: fix early queue wake-up.
  - LP: #1013723
* r8169: fix unsigned int wraparound with TSO
  - LP: #1013723
* sctp: check cached dst before using it
  - LP: #1013723
* skb: avoid unnecessary reallocations in __skb_cow
  - LP: #1013723
* xfrm: take net hdr len into account for esp payload size calculation
  - LP: #1013723
* ACPI battery: only refresh the sysfs files when pertinent information
  changes
  - LP: #1013723
* target/file: Use O_DSYNC by default for FILEIO backends
  - LP: #1013723
* iommu/amd: Cache pdev pointer to root-bridge
  - LP: #1013723
* drm/radeon/kms: add new Palm, Sumo PCI ids
  - LP: #1013723
* drm/radeon/kms: add new BTC PCI ids
  - LP: #1013723
* btree: fix tree corruption in btree_get_prev()
  - LP: #1013723
* kbuild: install kernel-page-flags.h
  - LP: #1013723
* asix: allow full size 8021Q frames to be received
  - LP: #1013723
* ext4: don't trash state flags in EXT4_IOC_SETFLAGS
  - LP: #1013723
* ext4: don't set i_flags in EXT4_IOC_SETFLAGS
  - LP: #1013723
* Linux 3.2.20
  - LP: #1013723
* drm/i915: Finish any pending operations on the framebuffer before
  disabling
  - LP: #982415
* drm/i915: Remove use of the autoreported ringbuffer HEAD position
  - LP: #1015120
* drm/i915: Do the fallback non-IRQ wait in ring throttle, too.
  - LP: #999910
* drm/i915: Mark the ringbuffers as being in the GTT domain
  - LP: #1015573
* drm/i915: hold forcewake around ring hw init
  - LP: #1015573
* drm/i915: Unpin the flip target if we fail to queue the flip
  - LP: #1015573
* drm/i915: fix up ivb plane 3 pageflips
  - LP: #1015573
* char/agp: add another Ironlake host bridge
  - LP: #1015573
* x86/uv: Fix UV2 BAU legacy mode
  - LP: #1015573
* powerpc: Fix kernel panic during kernel module load
  - LP: #1015573
* drm/nouveau: determine a value for display_info.bpc if edid doesn't
  - LP: #1015573
* drm/nouveau: default to 8bpc for non-LVDS panels if EDID isn't useful
  - LP: #1015573
* drm/nouveau/disp: fix dithering not being enabled on some eDP macbooks
  - LP: #1015573
* fuse: fix stat call on 32 bit platforms
  - LP: #1015573
* x86, MCE, AMD: Make APIC LVT thresholding interrupt optional
  - LP: #1015573
* x86/amd: Re-enable CPU topology extensions in case BIOS has disabled it
  - LP: #1015573
* sched: Fix the relax_domain_level boot parameter
  - LP: #1015573
* iwlwifi: don't mess up the SCD when removing a key
  - LP: #1015573
* hwrng: atmel-rng - fix race condition leading to repeated bits
  - LP: #1015573
* crypto: aesni-intel - fix unaligned cbc decrypt for x86-32
  - LP: #1015573
* xen/setup: filter APERFMPERF cpuid feature out
  - LP: #1015573
* NFSv4.1: Fix a request leak on the back channel
  - LP: #1015573
* can: c_can: fix "BUG! echo_skb is occupied!" during transmit
  - LP: #1015573
* can: c_can: fix an interrupt thrash issue with c_can driver
  - LP: #1015573
* can: c_can: fix race condition in c_can_open()
  - LP: #1015573
* ARM i.MX53: Fix PLL4 base address
  - LP: #1015573
* usb: musb_gadget: fix crash caused by dangling pointer
  - LP: #1015573
* mac80211: clean up remain-on-channel on interface stop
  - LP: #1015573
* rt2x00: use atomic variable for seqno
  - LP: #1015573
* iwlwifi: disable WoWLAN if !CONFIG_PM_SLEEP
  - LP: #1015573
* ASoC: wm8994: Ensure all AIFnCLK events are run from the _late variants
  - LP: #1015573
* ASoC: wm8994: Apply volume updates with clocks enabled
  - LP: #1015573
* iwlwifi: unregister LEDs if mac80211 registration fails
  - LP: #1015573
* cfg80211: fix interface combinations check
  - LP: #1015573
* mpt2sas: Fix unsafe using smp_processor_id() in preemptible
  - LP: #1015573
* net: sierra_net: device IDs for Aircard 320U++
  - LP: #1015573
* ARM: imx6: exit coherency when shutting down a cpu
  - LP: #1015573
* ARM i.MX imx21ads: Fix overlapping static i/o mappings
  - LP: #1015573
* NFSv4: Fix unnecessary delegation returns in nfs4_do_open
  - LP: #1015573
* iwlwifi: use correct supported firmware for 6035 and 6000g2
  - LP: #1015573
* iwlwifi: disable the buggy chain extension feature in HW
  - LP: #1015573
* ALSA: hda - Add codec->no_jack_detect flag
  - LP: #1015573
* ALSA: hda - add support for Uniwill ECS M31EI notebook
  - LP: #1015573
* ALSA: hda - Suppress auto-mute feature on some machines with ALC861
  - LP: #1015573
* ALSA: hda - Add another jack-detection suppression for ASUS ALC892
  - LP: #1015573
* ALSA: HDA: Pin fixup for Zotac Z68 motherboard
  - LP: #1015573, #993162
* usb: cdc-wdm: Add device-id for Huawei 3G/LTE modems
  - LP: #1015573
* USB: qcserial: Add Sierra Wireless device IDs
  - LP: #1015573
* USB: ftdi-sio: Add support for RT Systems USB-RTS01 serial adapter
  - LP: #1015573
* USB: serial: cp210x: add Optris MS Pro usb id
  - LP: #1015573
* USB: serial: sierra: Add support for Sierra Wireless AirCard 320U modem
  - LP: #1015573
* USB: option: Updated Huawei K4605 has better id
  - LP: #1015573
* USB: mct_u232: Fix incorrect TIOCMSET return
  - LP: #1015573
* USB: option: fix port-data abuse
  - LP: #1015573
* USB: option: fix memory leak
  - LP: #1015573
* USB: option: add more YUGA device ids
  - LP: #1015573
* target: Return error to initiator if SET TARGET PORT GROUPS emulation
  fails
  - LP: #1015573
* USB: add NO_D3_DURING_SLEEP flag and revert 151b61284776be2
  - LP: #1015573
* USB: serial: Enforce USB driver and USB serial driver match
  - LP: #1015573
* xhci: Fix invalid loop check in xhci_free_tt_info()
  - LP: #1015573
* xhci: Don't free endpoints in xhci_mem_cleanup()
  - LP: #1015573
* xHCI: Increase the timeout for controller save/restore state operation
  - LP: #1015573
* usb: PS3 EHCI QH read work-around
  - LP: #1015573
* USB: fix PS3 EHCI systems
  - LP: #1015573
* usb: cdc-acm: fix devices not unthrottled on open
  - LP: #1015573
* USB: fix gathering of interface associations
  - LP: #1015573
* swap: fix shmem swapping when more than 8 areas
  - LP: #1015573
* drm/radeon: add some additional 6xx/7xx/EG register init
  - LP: #1015573
* Linux 3.2.21
  - LP: #1015573
* samsung-laptop: make the dmi check less strict
  - LP: #1012284
* ARM: 7205/2: sched_clock: allow sched_clock to be selected at runtime
  - LP: #1008345
* ARM: timer-sp: add sched_clock support
  - LP: #1008345
* ARM: highbank: enable sp804 based sched_clock
  - LP: #1008345
* ARM: 7201/1: add EDAC atomic_scrub function
  - LP: #1008345
* ARM: 7347/1: SCU: use cpu_logical_map for per-CPU low power mode
  - LP: #1008345

Show diffs side-by-side

added added

removed removed

Lines of Context:
2187
2187
}
2188
2188
 
2189
2189
static int
 
2190
intel_finish_fb(struct drm_framebuffer *old_fb)
 
2191
{
 
2192
        struct drm_i915_gem_object *obj = to_intel_framebuffer(old_fb)->obj;
 
2193
        struct drm_i915_private *dev_priv = obj->base.dev->dev_private;
 
2194
        bool was_interruptible = dev_priv->mm.interruptible;
 
2195
        int ret;
 
2196
 
 
2197
        wait_event(dev_priv->pending_flip_queue,
 
2198
                   atomic_read(&dev_priv->mm.wedged) ||
 
2199
                   atomic_read(&obj->pending_flip) == 0);
 
2200
 
 
2201
        /* Big Hammer, we also need to ensure that any pending
 
2202
         * MI_WAIT_FOR_EVENT inside a user batch buffer on the
 
2203
         * current scanout is retired before unpinning the old
 
2204
         * framebuffer.
 
2205
         *
 
2206
         * This should only fail upon a hung GPU, in which case we
 
2207
         * can safely continue.
 
2208
         */
 
2209
        dev_priv->mm.interruptible = false;
 
2210
        ret = i915_gem_object_finish_gpu(obj);
 
2211
        dev_priv->mm.interruptible = was_interruptible;
 
2212
 
 
2213
        return ret;
 
2214
}
 
2215
 
 
2216
static int
2190
2217
intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,
2191
2218
                    struct drm_framebuffer *old_fb)
2192
2219
{
2224
2251
                return ret;
2225
2252
        }
2226
2253
 
2227
 
        if (old_fb) {
2228
 
                struct drm_i915_private *dev_priv = dev->dev_private;
2229
 
                struct drm_i915_gem_object *obj = to_intel_framebuffer(old_fb)->obj;
2230
 
 
2231
 
                wait_event(dev_priv->pending_flip_queue,
2232
 
                           atomic_read(&dev_priv->mm.wedged) ||
2233
 
                           atomic_read(&obj->pending_flip) == 0);
2234
 
 
2235
 
                /* Big Hammer, we also need to ensure that any pending
2236
 
                 * MI_WAIT_FOR_EVENT inside a user batch buffer on the
2237
 
                 * current scanout is retired before unpinning the old
2238
 
                 * framebuffer.
2239
 
                 *
2240
 
                 * This should only fail upon a hung GPU, in which case we
2241
 
                 * can safely continue.
2242
 
                 */
2243
 
                ret = i915_gem_object_finish_gpu(obj);
2244
 
                (void) ret;
2245
 
        }
 
2254
        if (old_fb)
 
2255
                intel_finish_fb(old_fb);
2246
2256
 
2247
2257
        ret = intel_pipe_set_base_atomic(crtc, crtc->fb, x, y,
2248
2258
                                         LEAVE_ATOMIC_MODE_SET);
3312
3322
        struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private;
3313
3323
        struct drm_device *dev = crtc->dev;
3314
3324
 
 
3325
        /* Flush any pending WAITs before we disable the pipe. Note that
 
3326
         * we need to drop the struct_mutex in order to acquire it again
 
3327
         * during the lowlevel dpms routines around a couple of the
 
3328
         * operations. It does not look trivial nor desirable to move
 
3329
         * that locking higher. So instead we leave a window for the
 
3330
         * submission of further commands on the fb before we can actually
 
3331
         * disable it. This race with userspace exists anyway, and we can
 
3332
         * only rely on the pipe being disabled by userspace after it
 
3333
         * receives the hotplug notification and has flushed any pending
 
3334
         * batches.
 
3335
         */
 
3336
        if (crtc->fb) {
 
3337
                mutex_lock(&dev->struct_mutex);
 
3338
                intel_finish_fb(crtc->fb);
 
3339
                mutex_unlock(&dev->struct_mutex);
 
3340
        }
 
3341
 
3315
3342
        crtc_funcs->dpms(crtc, DRM_MODE_DPMS_OFF);
3316
3343
 
3317
3344
        if (crtc->fb) {
7009
7036
 
7010
7037
        ret = intel_pin_and_fence_fb_obj(dev, obj, LP_RING(dev_priv));
7011
7038
        if (ret)
7012
 
                goto out;
 
7039
                goto err;
7013
7040
 
7014
7041
        /* Offset into the new buffer for cases of shared fbs between CRTCs */
7015
7042
        offset = crtc->y * fb->pitch + crtc->x * fb->bits_per_pixel/8;
7016
7043
 
7017
7044
        ret = BEGIN_LP_RING(6);
7018
7045
        if (ret)
7019
 
                goto out;
 
7046
                goto err_unpin;
7020
7047
 
7021
7048
        /* Can't queue multiple flips, so wait for the previous
7022
7049
         * one to finish before executing the next.
7033
7060
        OUT_RING(obj->gtt_offset + offset);
7034
7061
        OUT_RING(MI_NOOP);
7035
7062
        ADVANCE_LP_RING();
7036
 
out:
 
7063
        return 0;
 
7064
 
 
7065
err_unpin:
 
7066
        i915_gem_object_unpin(obj);
 
7067
err:
7037
7068
        return ret;
7038
7069
}
7039
7070
 
7050
7081
 
7051
7082
        ret = intel_pin_and_fence_fb_obj(dev, obj, LP_RING(dev_priv));
7052
7083
        if (ret)
7053
 
                goto out;
 
7084
                goto err;
7054
7085
 
7055
7086
        /* Offset into the new buffer for cases of shared fbs between CRTCs */
7056
7087
        offset = crtc->y * fb->pitch + crtc->x * fb->bits_per_pixel/8;
7057
7088
 
7058
7089
        ret = BEGIN_LP_RING(6);
7059
7090
        if (ret)
7060
 
                goto out;
 
7091
                goto err_unpin;
7061
7092
 
7062
7093
        if (intel_crtc->plane)
7063
7094
                flip_mask = MI_WAIT_FOR_PLANE_B_FLIP;
7072
7103
        OUT_RING(MI_NOOP);
7073
7104
 
7074
7105
        ADVANCE_LP_RING();
7075
 
out:
 
7106
        return 0;
 
7107
 
 
7108
err_unpin:
 
7109
        i915_gem_object_unpin(obj);
 
7110
err:
7076
7111
        return ret;
7077
7112
}
7078
7113
 
7088
7123
 
7089
7124
        ret = intel_pin_and_fence_fb_obj(dev, obj, LP_RING(dev_priv));
7090
7125
        if (ret)
7091
 
                goto out;
 
7126
                goto err;
7092
7127
 
7093
7128
        ret = BEGIN_LP_RING(4);
7094
7129
        if (ret)
7095
 
                goto out;
 
7130
                goto err_unpin;
7096
7131
 
7097
7132
        /* i965+ uses the linear or tiled offsets from the
7098
7133
         * Display Registers (which do not change across a page-flip)
7111
7146
        pipesrc = I915_READ(PIPESRC(intel_crtc->pipe)) & 0x0fff0fff;
7112
7147
        OUT_RING(pf | pipesrc);
7113
7148
        ADVANCE_LP_RING();
7114
 
out:
 
7149
        return 0;
 
7150
 
 
7151
err_unpin:
 
7152
        i915_gem_object_unpin(obj);
 
7153
err:
7115
7154
        return ret;
7116
7155
}
7117
7156
 
7127
7166
 
7128
7167
        ret = intel_pin_and_fence_fb_obj(dev, obj, LP_RING(dev_priv));
7129
7168
        if (ret)
7130
 
                goto out;
 
7169
                goto err;
7131
7170
 
7132
7171
        ret = BEGIN_LP_RING(4);
7133
7172
        if (ret)
7134
 
                goto out;
 
7173
                goto err_unpin;
7135
7174
 
7136
7175
        OUT_RING(MI_DISPLAY_FLIP |
7137
7176
                 MI_DISPLAY_FLIP_PLANE(intel_crtc->plane));
7142
7181
        pipesrc = I915_READ(PIPESRC(intel_crtc->pipe)) & 0x0fff0fff;
7143
7182
        OUT_RING(pf | pipesrc);
7144
7183
        ADVANCE_LP_RING();
7145
 
out:
 
7184
        return 0;
 
7185
 
 
7186
err_unpin:
 
7187
        i915_gem_object_unpin(obj);
 
7188
err:
7146
7189
        return ret;
7147
7190
}
7148
7191
 
7160
7203
        struct drm_i915_private *dev_priv = dev->dev_private;
7161
7204
        struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
7162
7205
        struct intel_ring_buffer *ring = &dev_priv->ring[BCS];
 
7206
        uint32_t plane_bit = 0;
7163
7207
        int ret;
7164
7208
 
7165
7209
        ret = intel_pin_and_fence_fb_obj(dev, obj, ring);
7166
7210
        if (ret)
7167
 
                goto out;
 
7211
                goto err;
 
7212
 
 
7213
        switch(intel_crtc->plane) {
 
7214
        case PLANE_A:
 
7215
                plane_bit = MI_DISPLAY_FLIP_IVB_PLANE_A;
 
7216
                break;
 
7217
        case PLANE_B:
 
7218
                plane_bit = MI_DISPLAY_FLIP_IVB_PLANE_B;
 
7219
                break;
 
7220
        case PLANE_C:
 
7221
                plane_bit = MI_DISPLAY_FLIP_IVB_PLANE_C;
 
7222
                break;
 
7223
        default:
 
7224
                WARN_ONCE(1, "unknown plane in flip command\n");
 
7225
                ret = -ENODEV;
 
7226
                goto err;
 
7227
        }
7168
7228
 
7169
7229
        ret = intel_ring_begin(ring, 4);
7170
7230
        if (ret)
7171
 
                goto out;
 
7231
                goto err_unpin;
7172
7232
 
7173
 
        intel_ring_emit(ring, MI_DISPLAY_FLIP_I915 | (intel_crtc->plane << 19));
 
7233
        intel_ring_emit(ring, MI_DISPLAY_FLIP_I915 | plane_bit);
7174
7234
        intel_ring_emit(ring, (fb->pitch | obj->tiling_mode));
7175
7235
        intel_ring_emit(ring, (obj->gtt_offset));
7176
7236
        intel_ring_emit(ring, (MI_NOOP));
7177
7237
        intel_ring_advance(ring);
7178
 
out:
 
7238
        return 0;
 
7239
 
 
7240
err_unpin:
 
7241
        i915_gem_object_unpin(obj);
 
7242
err:
7179
7243
        return ret;
7180
7244
}
7181
7245
 
7998
8062
        I915_WRITE(GEN6_RP_IDLE_HYSTERSIS, 10);
7999
8063
        I915_WRITE(GEN6_RP_CONTROL,
8000
8064
                   GEN6_RP_MEDIA_TURBO |
8001
 
                   GEN6_RP_USE_NORMAL_FREQ |
 
8065
                   GEN6_RP_MEDIA_HW_NORMAL_MODE |
8002
8066
                   GEN6_RP_MEDIA_IS_GFX |
8003
8067
                   GEN6_RP_ENABLE |
8004
8068
                   GEN6_RP_UP_BUSY_AVG |