diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-15 14:19:54 +0900 | 
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-15 14:19:54 +0900 | 
| commit | 049ffa8ab33a63b3bff672d1a0ee6a35ad253fe8 (patch) | |
| tree | 70f4c684818b1c9871fa800088427e40d260592e /drivers/gpu/host1x/dev.c | |
| parent | c681427e5ca22925fcc1be76a2e260a11e0a8498 (diff) | |
| parent | 0846c728e20a0cd1e43fb75a3015f3b176a26466 (diff) | |
Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux
Pull drm updates from Dave Airlie:
 "This is a combo of -next and some -fixes that came in in the
  intervening time.
  Highlights:
  New drivers:
    ARM Armada driver for Marvell Armada 510 SOCs
  Intel:
    Broadwell initial support under a default off switch,
    Stereo/3D HDMI mode support
    Valleyview improvements
    Displayport improvements
    Haswell fixes
    initial mipi dsi panel support
    CRC support for debugging
    build with CONFIG_FB=n
  Radeon:
    enable DPM on a number of GPUs by default
    secondary GPU powerdown support
    enable HDMI audio by default
    Hawaii support
  Nouveau:
    dynamic pm code infrastructure reworked, does nothing major yet
    GK208 modesetting support
    MSI fixes, on by default again
    PMPEG improvements
    pageflipping fixes
  GMA500:
    minnowboard SDVO support
  VMware:
    misc fixes
  MSM:
    prime, plane and rendernodes support
  Tegra:
    rearchitected to put the drm driver into the drm subsystem.
    HDMI and gr2d support for tegra 114 SoC
  QXL:
    oops fix, and multi-head fixes
  DRM core:
    sysfs lifetime fixes
    client capability ioctl
    further cleanups to device midlayer
    more vblank timestamp fixes"
* 'drm-next' of git://people.freedesktop.org/~airlied/linux: (789 commits)
  drm/nouveau: do not map evicted vram buffers in nouveau_bo_vma_add
  drm/nvc0-/gr: shift wrapping bug in nvc0_grctx_generate_r406800
  drm/nouveau/pwr: fix missing mutex unlock in a failure path
  drm/nv40/therm: fix slowing down fan when pstate undefined
  drm/nv11-: synchronise flips to vblank, unless async flip requested
  drm/nvc0-: remove nasty fifo swmthd hack for flip completion method
  drm/nv10-: we no longer need to create nvsw object on user channels
  drm/nouveau: always queue flips relative to kernel channel activity
  drm/nouveau: there is no need to reserve/fence the new fb when flipping
  drm/nouveau: when bailing out of a pushbuf ioctl, do not remove previous fence
  drm/nouveau: allow nouveau_fence_ref() to be a noop
  drm/nvc8/mc: msi rearm is via the nvc0 method
  drm/ttm: Fix vma page_prot bit manipulation
  drm/vmwgfx: Fix a couple of compile / sparse warnings and errors
  drm/vmwgfx: Resource evict fixes
  drm/edid: compare actual vrefresh for all modes for quirks
  drm: shmob_drm: Convert to clk_prepare/unprepare
  drm/nouveau: fix 32-bit build
  drm/i915/opregion: fix build error on CONFIG_ACPI=n
  Revert "drm/radeon/audio: don't set speaker allocation on DCE4+"
  ...
Diffstat (limited to 'drivers/gpu/host1x/dev.c')
| -rw-r--r-- | drivers/gpu/host1x/dev.c | 82 | 
1 files changed, 34 insertions, 48 deletions
diff --git a/drivers/gpu/host1x/dev.c b/drivers/gpu/host1x/dev.c index 471630299878..80da003d63de 100644 --- a/drivers/gpu/host1x/dev.c +++ b/drivers/gpu/host1x/dev.c @@ -27,24 +27,13 @@  #define CREATE_TRACE_POINTS  #include <trace/events/host1x.h> +#include "bus.h"  #include "dev.h"  #include "intr.h"  #include "channel.h"  #include "debug.h"  #include "hw/host1x01.h" -#include "host1x_client.h" - -void host1x_set_drm_data(struct device *dev, void *data) -{ -	struct host1x *host1x = dev_get_drvdata(dev); -	host1x->drm_data = data; -} - -void *host1x_get_drm_data(struct device *dev) -{ -	struct host1x *host1x = dev_get_drvdata(dev); -	return host1x ? host1x->drm_data : NULL; -} +#include "hw/host1x02.h"  void host1x_sync_writel(struct host1x *host1x, u32 v, u32 r)  { @@ -79,7 +68,17 @@ static const struct host1x_info host1x01_info = {  	.sync_offset	= 0x3000,  }; +static const struct host1x_info host1x02_info = { +	.nb_channels = 9, +	.nb_pts = 32, +	.nb_mlocks = 16, +	.nb_bases = 12, +	.init = host1x02_init, +	.sync_offset = 0x3000, +}; +  static struct of_device_id host1x_of_match[] = { +	{ .compatible = "nvidia,tegra114-host1x", .data = &host1x02_info, },  	{ .compatible = "nvidia,tegra30-host1x", .data = &host1x01_info, },  	{ .compatible = "nvidia,tegra20-host1x", .data = &host1x01_info, },  	{ }, @@ -114,6 +113,9 @@ static int host1x_probe(struct platform_device *pdev)  	if (!host)  		return -ENOMEM; +	mutex_init(&host->devices_lock); +	INIT_LIST_HEAD(&host->devices); +	INIT_LIST_HEAD(&host->list);  	host->dev = &pdev->dev;  	host->info = id->data; @@ -152,7 +154,7 @@ static int host1x_probe(struct platform_device *pdev)  	err = host1x_syncpt_init(host);  	if (err) {  		dev_err(&pdev->dev, "failed to initialize syncpts\n"); -		return err; +		goto fail_unprepare_disable;  	}  	err = host1x_intr_init(host, syncpt_irq); @@ -163,19 +165,26 @@ static int host1x_probe(struct platform_device *pdev)  	host1x_debug_init(host); -	host1x_drm_alloc(pdev); +	err = host1x_register(host); +	if (err < 0) +		goto fail_deinit_intr;  	return 0; +fail_deinit_intr: +	host1x_intr_deinit(host);  fail_deinit_syncpt:  	host1x_syncpt_deinit(host); +fail_unprepare_disable: +	clk_disable_unprepare(host->clk);  	return err;  } -static int __exit host1x_remove(struct platform_device *pdev) +static int host1x_remove(struct platform_device *pdev)  {  	struct host1x *host = platform_get_drvdata(pdev); +	host1x_unregister(host);  	host1x_intr_deinit(host);  	host1x_syncpt_deinit(host);  	clk_disable_unprepare(host->clk); @@ -184,59 +193,36 @@ static int __exit host1x_remove(struct platform_device *pdev)  }  static struct platform_driver tegra_host1x_driver = { -	.probe = host1x_probe, -	.remove = __exit_p(host1x_remove),  	.driver = { -		.owner = THIS_MODULE,  		.name = "tegra-host1x",  		.of_match_table = host1x_of_match,  	}, +	.probe = host1x_probe, +	.remove = host1x_remove,  };  static int __init tegra_host1x_init(void)  {  	int err; -	err = platform_driver_register(&tegra_host1x_driver); +	err = host1x_bus_init();  	if (err < 0)  		return err; -#ifdef CONFIG_DRM_TEGRA -	err = platform_driver_register(&tegra_dc_driver); -	if (err < 0) -		goto unregister_host1x; - -	err = platform_driver_register(&tegra_hdmi_driver); -	if (err < 0) -		goto unregister_dc; - -	err = platform_driver_register(&tegra_gr2d_driver); -	if (err < 0) -		goto unregister_hdmi; -#endif +	err = platform_driver_register(&tegra_host1x_driver); +	if (err < 0) { +		host1x_bus_exit(); +		return err; +	}  	return 0; - -#ifdef CONFIG_DRM_TEGRA -unregister_hdmi: -	platform_driver_unregister(&tegra_hdmi_driver); -unregister_dc: -	platform_driver_unregister(&tegra_dc_driver); -unregister_host1x: -	platform_driver_unregister(&tegra_host1x_driver); -	return err; -#endif  }  module_init(tegra_host1x_init);  static void __exit tegra_host1x_exit(void)  { -#ifdef CONFIG_DRM_TEGRA -	platform_driver_unregister(&tegra_gr2d_driver); -	platform_driver_unregister(&tegra_hdmi_driver); -	platform_driver_unregister(&tegra_dc_driver); -#endif  	platform_driver_unregister(&tegra_host1x_driver); +	host1x_bus_exit();  }  module_exit(tegra_host1x_exit);  | 
