linux/drivers/gpu/drm/i915
Kenneth Graunke 9441159344 drm/i915: Make sample_c messages go faster on Haswell.
Haswell significantly improved the performance of sampler_c messages,
but the optimization appears to be off by default.  Later platforms
remove this bit, and apparently always enable the optimization.

Improves performance in "Counter Strike: Global Offensive" by 18%
at default settings on Iris Pro.

This may break sampling of paletted formats (P8/A8P8/P8A8).  It's
unclear whether it affects sampling of paletted formats in general,
or just the sample_c message (which is never used).

While libva does have support for using paletted formats (primarily
for OSDs), that support appears to have been broken for at least a
year, so I couldn't observe a regression from this:

I tried to get libva-intel to use paletted formats, and observe a
regression...but the only thing I found that used it was mplayer's OSD
(on screen display).  Even without my patch, the colors were totally
wrong with that, and it's according to a few distro wikis, that's been
the case for over a year.

If libva's code for paletted formats /is/ broken, they could always
add code to disable this bit using the command validator when fixing
it.

Further investigation from Haihao shows that libva mplayer OSD seems
to work at least on his setup (still unclear what's wron with Ken's),
and that it's not affected by this patch. Quoting the discussion
between Haihao and Ken:

> > > If you use "-vo gl" or "-vo xv", the OSD is solid white text with a black
> > > border around it.  I presume that it's supposed to be white with vaapi as
> > > well, but I guess I'm not entirely sure.
> > >
> > > It's possible that the optimization doesn't affect the palette as long as
> > > you never use sample_c with the paletted textures.
> >
> > I verified the palette takes effect in the following way:
> >
> > 1. Only support P8A8 format in the driver
> >
> > 2. ran the above command and I saw white OSD text
> >
> > 3. Only support P4A4 format in the driver and don't use
> > 3DSTATE_SAMPLER_PALETTE_LOAD0 to load the value to the texture palette,
> > so the palette keeps unchanged.
> >
> > 4. ran the above command and I saw black OSD text.
> >
> > 5. Load the right value to the texture palette and ran the above command
> > again, I saw white OSD text.
> >
> > Hence I think sample_c with the paletted textures is used in the driver.
>
> That sounds like the palette is actually working, then.  Great :)
>
> I doubt that libva would use sample_c - sampling with a shadow comparison?
> It looks like it just uses sample and sample+killpix.

You are right, libva driver doesn't use sample_c message.

> I'm pretty sure the sample_c optimization just uses the palette memory as
> storage for some stuff, so it's quite possible it just works if you're
> only using sample and sample+killpix.

Thanks for the explanation, it makes sense to me.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
[danvet: Add wa name from Ville's review to the comment and copypaste
the explanation why we don't care about libva (already broken) from
Ken. Also add conclusion from libva devs that&why this is all fine.]
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: "Xiang, Haihao" <haihao.xiang@intel.com>
Cc: libva@lists.freedesktop.org
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-01-06 09:07:03 +01:00
..
dvo_ch7xxx.c
dvo_ch7017.c
dvo_ivch.c
dvo_ns2501.c drm/i915: Check pixel clock in ns2501 mode_valid hook 2014-09-03 11:05:21 +02:00
dvo_sil164.c
dvo_tfp410.c
dvo.h
i915_cmd_parser.c drm/i915: Add GPGPU_THREADS_DISPATCHED to the register whitelist 2014-12-16 10:39:10 +01:00
i915_debugfs.c drm/i915: Implement a framework for batch buffer pools 2014-12-16 10:39:08 +01:00
i915_dma.c drm/i915: Use batch pools with the command parser 2014-12-16 10:39:09 +01:00
i915_drv.c drm/i915: Skip gunit save/restore for cherryview 2014-12-16 10:39:11 +01:00
i915_drv.h drm/i915: Update DRIVER_DATE to 20141219 2014-12-19 16:21:42 +01:00
i915_gem_batch_pool.c drm/i915: Mark shadow batch buffers as purgeable 2014-12-16 10:39:09 +01:00
i915_gem_context.c drm/i915: Infrastructure for supporting different GGTT views per object 2014-12-15 11:25:04 +01:00
i915_gem_debug.c
i915_gem_dmabuf.c
i915_gem_evict.c drm/i915: fix another use-after-free in i915_gem_evict_everything 2014-09-19 14:41:16 +02:00
i915_gem_execbuffer.c drm/i915: Tidy up execbuffer command parsing code 2014-12-16 10:39:10 +01:00
i915_gem_gtt.c drm/i915: Organize bind_vma funcs 2014-12-17 18:23:12 +01:00
i915_gem_gtt.h drm/i915: Infrastructure for supporting different GGTT views per object 2014-12-15 11:25:04 +01:00
i915_gem_render_state.c drm/i915: Remove obsolete seqno parameter from 'i915_add_request' 2014-12-03 09:35:19 +01:00
i915_gem_render_state.h drm/i915/bdw: Render state init for Execlists 2014-09-03 11:04:52 +02:00
i915_gem_stolen.c drm/i915: Move flags describing VMA mappings into the VMA 2014-11-04 14:04:51 +01:00
i915_gem_tiling.c drm/i915: Replace last_[rwf]_seqno with last_[rwf]_req 2014-12-03 09:35:14 +01:00
i915_gem_userptr.c drm/i915: Do not leak pages when freeing userptr objects 2014-09-29 15:31:01 +02:00
i915_gem.c drm/i915: Organize Fence registers for future enablement. 2014-12-17 18:17:54 +01:00
i915_gpu_error.c drm/i915: Organize INSTDONE report for future. 2014-12-17 18:18:43 +01:00
i915_ioc32.c drm/i915: remove redundant #ifdef CONFIG_COMPAT 2014-10-24 16:34:07 +02:00
i915_irq.c drm/i915: Name the lrc irq handler correctly 2014-12-15 09:54:05 +01:00
i915_params.c drm/i915: tame the chattermouth (v2) 2014-12-16 10:39:13 +01:00
i915_reg.h drm/i915: Make sample_c messages go faster on Haswell. 2015-01-06 09:07:03 +01:00
i915_suspend.c drm/i915: Move FBC stuff to intel_fbc.c 2014-12-10 17:47:20 +01:00
i915_sysfs.c drm/i915: Do not export RC6p and RC6pp if they don't exist 2014-10-24 16:34:00 +02:00
i915_trace_points.c
i915_trace.h drm/i915: Additional request structure tracing 2014-12-06 01:46:27 +01:00
i915_ums.c drm/i915: don't save/restore backlight hist ctl registers 2014-11-14 10:29:28 +01:00
intel_acpi.c
intel_audio.c drm/i915/audio: fix monitor presence indication after disable 2014-11-18 11:17:37 +01:00
intel_bios.c drm/i915: Parsing LFP brightness control from VBT 2014-12-15 11:25:29 +01:00
intel_bios.h drm/i915: Parsing LFP brightness control from VBT 2014-12-15 11:25:29 +01:00
intel_crt.c drm/i915: Don't claim that we're resetting PCH ADPA register 2014-10-24 16:34:10 +02:00
intel_ddi.c drm/i915: Consolidate DDI clock reading out in a single function 2014-12-15 15:43:02 +01:00
intel_display.c drm/i915: Hold runtime PM during plane commit 2014-12-17 21:32:59 +01:00
intel_dp_mst.c drm: Miscellaneous fixes for v3.19-rc1 2014-11-15 09:37:20 +10:00
intel_dp.c drm/i915: tame the chattermouth (v2) 2014-12-16 10:39:13 +01:00
intel_drv.h drm/i915: Move FBC stuff to intel_fbc.c 2014-12-10 17:47:20 +01:00
intel_dsi_cmd.c drm/i915: Dual link needs Shutdown and Turn on packet for both ports 2014-12-05 15:28:26 +01:00
intel_dsi_cmd.h drm/i915: Added port as parameter to the functions which does read/write of DSI Controller 2014-12-04 12:21:58 +01:00
intel_dsi_panel_vbt.c drm/i915: Changes related to the sequence port no for 2014-12-15 09:54:22 +01:00
intel_dsi_pll.c drm/i915: Use DSI Pll1 for enabling MIPI DSI on Port C 2014-12-10 17:47:21 +01:00
intel_dsi.c drm/i915: Software workaround for getting the HW status of DSI Port C on BYT 2014-12-10 17:47:22 +01:00
intel_dsi.h drm/i915: Pixel Clock changes for DSI dual link 2014-12-05 15:28:20 +01:00
intel_dvo.c drm/i915: Don't call DVO mode_set hook on DPMS changes 2014-09-03 11:05:14 +02:00
intel_fbc.c drm/i915: Introduce FBC DocBook. 2014-12-10 17:47:23 +01:00
intel_fbdev.c drm/i915: Make intel_pin_and_fence_fb_obj take plane and framebuffer 2014-11-07 18:41:51 +01:00
intel_fifo_underrun.c drm/i915: kerneldoc for intel_fifo_underrun.c 2014-10-24 16:33:55 +02:00
intel_frontbuffer.c drm/i915: Introduce intel_psr.c 2014-11-17 19:12:28 +01:00
intel_hdmi.c drm/i915/chv: Enable AVI, SPD and HDMI infoframes for CHV. 2014-12-03 09:29:34 +01:00
intel_i2c.c
intel_lrc.c drm/i915: Warn about missing context state workarounds only once 2014-12-16 10:39:12 +01:00
intel_lrc.h drm/i915: Name the lrc irq handler correctly 2014-12-15 09:54:05 +01:00
intel_lvds.c drm/i915: Pass the current pipe from eDP init to backlight setup 2014-11-14 10:29:20 +01:00
intel_modes.c
intel_opregion.c ACPI / i915: Update the condition to ignore firmware backlight change request 2014-09-30 01:11:18 +02:00
intel_overlay.c drm/i915: Deal with video overlay on GPU reset 2014-12-03 09:35:24 +01:00
intel_panel.c Linux 3.18-rc7 2014-12-02 10:58:33 +10:00
intel_pm.c drm/i915: Make sample_c messages go faster on Haswell. 2015-01-06 09:07:03 +01:00
intel_psr.c drm/i915: VLV/CHV PSR Software timer mode 2014-12-03 09:35:08 +01:00
intel_renderstate_gen6.c drm/i915: Add headers to the various render state 2014-12-10 17:47:23 +01:00
intel_renderstate_gen7.c drm/i915: Add headers to the various render state 2014-12-10 17:47:23 +01:00
intel_renderstate_gen8.c drm/i915: Add headers to the various render state 2014-12-10 17:47:23 +01:00
intel_renderstate_gen9.c drm/i915: Add headers to the various render state 2014-12-10 17:47:23 +01:00
intel_renderstate.h drm/i915 Add golden context support for Gen9 2014-11-04 14:04:55 +01:00
intel_ringbuffer.c drm/i915: Warn about missing context state workarounds only once 2014-12-16 10:39:12 +01:00
intel_ringbuffer.h drm/i915: s/init()/init_hw()/ in intel_engine_cs 2014-12-03 09:35:27 +01:00
intel_runtime_pm.c drm/i915: tame the chattermouth (v2) 2014-12-16 10:39:13 +01:00
intel_sdvo_regs.h
intel_sdvo.c drm/i915: Don't destroy DRM properties in the driver 2014-10-31 18:38:17 +01:00
intel_sideband.c
intel_sprite.c drm/i915: Move FBC stuff to intel_fbc.c 2014-12-10 17:47:20 +01:00
intel_tv.c drm/i915: Clarify irq_lock locking, intel_tv_detect 2014-09-19 14:43:19 +02:00
intel_uncore.c drm/i915: Forcewake Register Range changes for CHV 2014-12-15 09:54:23 +01:00
Kconfig drm/i915: Ditch UMS config option 2014-07-24 10:59:53 +02:00
Makefile drm/i915: Implement a framework for batch buffer pools 2014-12-16 10:39:08 +01:00