OpenCloudOS-Kernel/drivers/gpu/drm/i915
Ben Widawsky c8d4c0d668 drm/i915: Use drm_mm for PPGTT PDEs
When PPGTT support was originally enabled, it was only designed to
support 1 PPGTT. It therefore made sense to simply hide the GGTT space
required to enable this from the drm_mm allocator.

Since we intend to support full PPGTT, which means more than 1, and they
can be created and destroyed ad hoc it will be required to use the
proper allocation techniques we already have.

The first step here is to make the existing single PPGTT use the
allocator.

The astute observer will notice that we are reserving space in the GGTT
for the PDEs for the lifetime of the address space, and would be right
to question whether or not this is a good idea. It does not make a
difference with this current patch only the aliasing PPGTT (indeed the
PDEs should still be hidden from the shrinker). For the future, we are
allocating from top to bottom to avoid using the precious "gtt
space" The GGTT space at that point should only be used for scanout, HW
contexts, ringbuffers, HWSP, PDEs, and a couple of other small buffers
(potentially) used by the kernel. Everything else should be mapped into
a PPGTT. To put the consumption in more tangible terms, it takes
approximately 4 sets of PDEs to equal one 19x10 framebuffer (with no
fancy stride or alignment constraints). 3/4 of the total [average] GGTT
can be used for PDEs, and hopefully never touch the 1/4 that the
framebuffer needs.

The astute, and persistent observer might ask about the page tables
which are also pinned for the address space. This waste is unfortunate.
We use 2MB of memory per address space. We leave wrapping the PDEs as a
real GEM object as a TODO.

v2: Align PDEs to 64b in GTT
Allocate the node dynamically so we can use drm_mm_put_block
Now tested on IGT
Allocate node at the top to avoid fragmentation (Chris)

v3: Use Chris' top down allocator

v4: Embed drm_mm_node into ppgtt struct (Jesse)
Remove hunks which didn't belong (Jesse)

v5: Don't subtract guard page since we now killed the guard page prior
to this patch. (Ben)

v6: Rebased and removed guard page stuff.
Added a chunk to the commit message
Allow adding a context to mappable region

v7: Undo v3, so we can make the drm patch last in the series

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> (v4)
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>

squash: drm/i915: allow PPGTT to use mappable
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-12-18 15:27:57 +01:00
..
Kconfig i915, fbdev: Fix Kconfig typo 2013-11-21 21:59:02 +01:00
Makefile drm/i915: rename intel_fb.c to intel_fbdev.c 2013-10-11 23:37:33 +02:00
dvo.h drm/i915: Remove unused mode_fixup() vfunc of struct intel_dvo_dev_ops 2013-09-05 21:39:59 +02:00
dvo_ch7xxx.c drm/i915: dvo_ch7xxx: fix vsync polarity setting 2013-07-25 16:10:22 +02:00
dvo_ch7017.c drm/i915/dvo: implement get_hw_state 2012-09-06 07:58:52 +02:00
dvo_ivch.c drm/i915/dvo: implement get_hw_state 2012-09-06 07:58:52 +02:00
dvo_ns2501.c drm/i915/ns2501: Rip out the reenable hack 2013-11-04 16:32:31 +01:00
dvo_sil164.c drm/i915/dvo: implement get_hw_state 2012-09-06 07:58:52 +02:00
dvo_tfp410.c drm/i915/dvo: implement get_hw_state 2012-09-06 07:58:52 +02:00
i915_debugfs.c drm/i915: Make pin count per VMA 2013-12-18 15:27:49 +01:00
i915_dma.c drm/i915: Do hw quiescing first during unload 2013-12-05 12:49:18 +01:00
i915_drv.c drm/i915: Disallow dynamic ppgtt param modification 2013-11-26 10:10:14 +01:00
i915_drv.h drm/i915: Use drm_mm for PPGTT PDEs 2013-12-18 15:27:57 +01:00
i915_gem.c drm/i915: PPGTT vfuncs should take a ppgtt argument 2013-12-18 15:27:56 +01:00
i915_gem_context.c drm/i915: Generalize default context setup 2013-12-18 15:27:56 +01:00
i915_gem_debug.c drm/i915: Fix #endif comment 2013-08-09 10:45:52 +02:00
i915_gem_dmabuf.c drm/i915: Pin pages whilst mapping the dma-buf 2013-09-03 19:17:58 +02:00
i915_gem_evict.c drm/i915: Make pin count per VMA 2013-12-18 15:27:49 +01:00
i915_gem_execbuffer.c drm/i915: Permit contexts on all rings 2013-12-18 15:27:53 +01:00
i915_gem_gtt.c drm/i915: Use drm_mm for PPGTT PDEs 2013-12-18 15:27:57 +01:00
i915_gem_stolen.c Linux 3.12-rc2 2013-09-24 09:32:53 +02:00
i915_gem_tiling.c drm/i915: Make pin count per VMA 2013-12-18 15:27:49 +01:00
i915_gpu_error.c drm/i915: Make pin count per VMA 2013-12-18 15:27:49 +01:00
i915_ioc32.c UAPI: (Scripted) Convert #include "..." to #include <path/...> in drivers/gpu/ 2012-10-02 18:01:07 +01:00
i915_irq.c drm/i915: Swap primary planes on gen2 for FBC 2013-12-04 12:09:36 +01:00
i915_reg.h drm/i915: Fix bogus FBC1 defines 2013-12-04 12:09:34 +01:00
i915_suspend.c drm/i915: do not save/restore backlight registers in KMS 2013-11-14 12:22:32 +01:00
i915_sysfs.c Merge branch 'backlight-rework' into drm-intel-next-queued 2013-11-15 10:02:39 +01:00
i915_trace.h drm/i915: Add a tracepoint for using a semaphore 2013-10-01 07:45:24 +02:00
i915_trace_points.c drm/i915: [sparse] trivial sparse fixes 2012-04-18 10:34:49 +02:00
i915_ums.c drm/i915: do not save/restore backlight registers in KMS 2013-11-14 12:22:32 +01:00
intel_acpi.c ACPI: Eliminate the DEVICE_ACPI_HANDLE() macro 2013-11-14 23:17:21 +01:00
intel_bios.c i915: Use 120MHz LVDS SSC clock for gen5/gen6/gen7 2013-11-15 00:38:44 +01:00
intel_bios.h drm/i915: use __packed instead of __attribute__((packed)) 2013-12-03 18:19:49 +01:00
intel_crt.c drm/i915: Return a drm_mode_status enum in the mode_valid vfuncs 2013-11-28 16:49:33 +01:00
intel_ddi.c Linux 3.13-rc3 2013-12-09 09:19:14 +01:00
intel_display.c Linux 3.13-rc3 2013-12-09 09:19:14 +01:00
intel_dp.c Linux 3.13-rc3 2013-12-09 09:19:14 +01:00
intel_drv.h drm/i915: add intel_display_power_enabled_sw() for use in atomic ctx 2013-11-28 15:05:06 +01:00
intel_dsi.c drm/i915: Return a drm_mode_status enum in the mode_valid vfuncs 2013-11-28 16:49:33 +01:00
intel_dsi.h drm/i915: add VLV DSI PLL Calculations 2013-09-04 17:34:48 +02:00
intel_dsi_cmd.c drm/i915/dsi: s/size_t/int/ 2013-09-04 17:34:51 +02:00
intel_dsi_cmd.h drm/i915/dsi: s/size_t/int/ 2013-09-04 17:34:51 +02:00
intel_dsi_pll.c drm/i915: Use adjusted_mode in DSI PLL calculations 2013-09-16 23:36:38 +02:00
intel_dvo.c drm/i915: Return a drm_mode_status enum in the mode_valid vfuncs 2013-11-28 16:49:33 +01:00
intel_fbdev.c drm/i915: Make pin count per VMA 2013-12-18 15:27:49 +01:00
intel_hdmi.c drm/i915: Return a drm_mode_status enum in the mode_valid vfuncs 2013-11-28 16:49:33 +01:00
intel_i2c.c drm/i915/vlv: split CCK and DDR freq usage 2013-11-05 19:28:47 +01:00
intel_lvds.c drm/i915/lvds: don't restore hw state in the lid notifier for pch platforms 2013-12-02 15:08:41 +01:00
intel_modes.c drm/i915: Add "Automatic" mode for the "Broadcast RGB" property 2013-01-20 13:09:44 +01:00
intel_opregion.c Linux 3.13-rc3 2013-12-09 09:19:14 +01:00
intel_overlay.c drm/i915: Make pin count per VMA 2013-12-18 15:27:49 +01:00
intel_panel.c Merge branch 'bdw-fixes' into backlight-rework 2013-11-15 09:44:29 +01:00
intel_pm.c drm/i915: Make pin count per VMA 2013-12-18 15:27:49 +01:00
intel_ringbuffer.c drm/i915: Make pin count per VMA 2013-12-18 15:27:49 +01:00
intel_ringbuffer.h drm/i915: Write RING_TAIL once per-request 2013-09-10 15:35:58 +02:00
intel_sdvo.c drm/i915: Return a drm_mode_status enum in the mode_valid vfuncs 2013-11-28 16:49:33 +01:00
intel_sdvo_regs.h drm/i915: use __packed instead of __attribute__((packed)) 2013-12-03 18:19:49 +01:00
intel_sideband.c drm/i915/vlv: Make the vlv_dpio_read/vlv_dpio_write more PHY centric 2013-11-11 10:57:45 +01:00
intel_sprite.c drm/i915: Enable pipe gamma for sprites 2013-11-21 09:09:37 +01:00
intel_tv.c drm/i915/tv: add ->get_config callback 2013-11-18 22:24:33 +01:00
intel_uncore.c Linux 3.13-rc3 2013-12-09 09:19:14 +01:00