Skip to content

Commit

Permalink
Merge tag 'drm/for-3.13-rc1' of git://anongit.freedesktop.org/tegra/l…
Browse files Browse the repository at this point in the history
…inux into drm-next

drm/tegra: Changes for v3.13-rc1

The biggest part of the changes is the decoupling of the host1x and DRM
drivers followed by the move of Tegra DRM back to drivers/gpu/drm/tegra
from whence it came. There is a lot of cleanup as well, and the drivers
can now be properly unloaded and reloaded.

HDMI support for the Tegra114 SoC was contributed by Mikko Perttunen.

gr2d support was extended to Tegra114 and the gr3d driver that has been
in the works for quite some time finally made it in. All pieces to run
an OpenGL driver on top of an upstream kernel are now available.

Support for syncpoint bases was added by Arto Merilainen. This is useful
for synchronizing between command streams from different engines such as
gr2d and gr3d.

Erik Faye-Lund and Wei Yongjun contributed various small fixes. Thanks!

* tag 'drm/for-3.13-rc1' of git://anongit.freedesktop.org/tegra/linux: (45 commits)
  drm/tegra: Reserve syncpoint base for gr3d
  drm/tegra: Reserve base for gr2d
  drm/tegra: Deliver syncpoint base to user space
  gpu: host1x: Add syncpoint base support
  gpu: host1x: Add 'flags' field to syncpt request
  drm/tegra: Disable clock on probe failure
  gpu: host1x: Disable clock on probe failure
  drm/tegra: Support bottom-up buffer objects
  drm/tegra: Add support for tiled buffer objects
  drm/tegra: Add 3D support
  drm/tegra: Introduce tegra_drm_submit()
  drm/tegra: Use symbolic names for gr2d registers
  drm/tegra: Start connectors with correct DPMS mode
  drm/tegra: hdmi: Enable VDD earlier for hotplug/DDC
  drm/tegra: hdmi: Fix build warnings
  drm/tegra: hdmi: Detect DVI-only displays
  drm/tegra: Add Tegra114 HDMI support
  drm/tegra: hdmi: Parameterize based on compatible property
  drm/tegra: hdmi: Rename tegra{2,3} to tegra{20,30}
  gpu: host1x: Add support for Tegra114
  ...
  • Loading branch information
airlied committed Nov 5, 2013
2 parents cc87509 + 977386a commit 90c3706
Show file tree
Hide file tree
Showing 55 changed files with 3,362 additions and 1,259 deletions.
2 changes: 2 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -2816,7 +2816,9 @@ L: [email protected]
L: [email protected]
T: git git://anongit.freedesktop.org/tegra/linux.git
S: Maintained
F: drivers/gpu/drm/tegra/
F: drivers/gpu/host1x/
F: include/linux/host1x.h
F: include/uapi/drm/tegra_drm.h
F: Documentation/devicetree/bindings/gpu/nvidia,tegra20-host1x.txt

Expand Down
2 changes: 2 additions & 0 deletions drivers/gpu/drm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -189,3 +189,5 @@ source "drivers/gpu/drm/tilcdc/Kconfig"
source "drivers/gpu/drm/qxl/Kconfig"

source "drivers/gpu/drm/msm/Kconfig"

source "drivers/gpu/drm/tegra/Kconfig"
1 change: 1 addition & 0 deletions drivers/gpu/drm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,5 @@ obj-$(CONFIG_DRM_OMAP) += omapdrm/
obj-$(CONFIG_DRM_TILCDC) += tilcdc/
obj-$(CONFIG_DRM_QXL) += qxl/
obj-$(CONFIG_DRM_MSM) += msm/
obj-$(CONFIG_DRM_TEGRA) += tegra/
obj-y += i2c/
8 changes: 8 additions & 0 deletions drivers/gpu/drm/drm_crtc_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,14 @@ drm_crtc_helper_disable(struct drm_crtc *crtc)
continue;

connector->encoder = NULL;

/*
* drm_helper_disable_unused_functions() ought to be
* doing this, but since we've decoupled the encoder
* from the connector above, the required connection
* between them is henceforth no longer available.
*/
connector->dpms = DRM_MODE_DPMS_OFF;
}
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/drm_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ long drm_ioctl(struct file *filp,

err_i1:
if (!ioctl)
DRM_DEBUG("invalid iotcl: pid=%d, dev=0x%lx, auth=%d, cmd=0x%02x, nr=0x%02x\n",
DRM_DEBUG("invalid ioctl: pid=%d, dev=0x%lx, auth=%d, cmd=0x%02x, nr=0x%02x\n",
task_pid_nr(current),
(long)old_encode_dev(file_priv->minor->device),
file_priv->authenticated, cmd, nr);
Expand Down
12 changes: 7 additions & 5 deletions drivers/gpu/host1x/drm/Kconfig → drivers/gpu/drm/tegra/Kconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
config DRM_TEGRA
bool "NVIDIA Tegra DRM"
depends on ARCH_TEGRA || ARCH_MULTIPLATFORM
depends on DRM
select TEGRA_HOST1X
select DRM_KMS_HELPER
select DRM_KMS_FB_HELPER
select FB_SYS_FILLRECT
Expand All @@ -14,6 +16,11 @@ config DRM_TEGRA

if DRM_TEGRA

config DRM_TEGRA_DEBUG
bool "NVIDIA Tegra DRM debug support"
help
Say yes here to enable debugging support.

config DRM_TEGRA_STAGING
bool "Enable HOST1X interface"
depends on STAGING
Expand All @@ -22,9 +29,4 @@ config DRM_TEGRA_STAGING

If unsure, choose N.

config DRM_TEGRA_DEBUG
bool "NVIDIA Tegra DRM debug support"
help
Say yes here to enable debugging support.

endif
15 changes: 15 additions & 0 deletions drivers/gpu/drm/tegra/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
ccflags-$(CONFIG_DRM_TEGRA_DEBUG) += -DDEBUG

tegra-drm-y := \
bus.o \
drm.o \
gem.o \
fb.o \
dc.o \
output.o \
rgb.o \
hdmi.o \
gr2d.o \
gr3d.o

obj-$(CONFIG_DRM_TEGRA) += tegra-drm.o
76 changes: 76 additions & 0 deletions drivers/gpu/drm/tegra/bus.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/*
* Copyright (C) 2013 NVIDIA Corporation
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/

#include "drm.h"

static int drm_host1x_set_busid(struct drm_device *dev,
struct drm_master *master)
{
const char *device = dev_name(dev->dev);
const char *driver = dev->driver->name;
const char *bus = dev->dev->bus->name;
int length;

master->unique_len = strlen(bus) + 1 + strlen(device);
master->unique_size = master->unique_len;

master->unique = kmalloc(master->unique_len + 1, GFP_KERNEL);
if (!master->unique)
return -ENOMEM;

snprintf(master->unique, master->unique_len + 1, "%s:%s", bus, device);

length = strlen(driver) + 1 + master->unique_len;

dev->devname = kmalloc(length + 1, GFP_KERNEL);
if (!dev->devname)
return -ENOMEM;

snprintf(dev->devname, length + 1, "%s@%s", driver, master->unique);

return 0;
}

static struct drm_bus drm_host1x_bus = {
.bus_type = DRIVER_BUS_HOST1X,
.set_busid = drm_host1x_set_busid,
};

int drm_host1x_init(struct drm_driver *driver, struct host1x_device *device)
{
struct drm_device *drm;
int ret;

INIT_LIST_HEAD(&driver->device_list);
driver->bus = &drm_host1x_bus;

drm = drm_dev_alloc(driver, &device->dev);
if (!drm)
return -ENOMEM;

ret = drm_dev_register(drm, 0);
if (ret)
goto err_free;

DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n", driver->name,
driver->major, driver->minor, driver->patchlevel,
driver->date, drm->primary->index);

return 0;

err_free:
drm_dev_free(drm);
return ret;
}

void drm_host1x_exit(struct drm_driver *driver, struct host1x_device *device)
{
struct tegra_drm *tegra = dev_get_drvdata(&device->dev);

drm_put_dev(tegra->drm);
}
Loading

0 comments on commit 90c3706

Please sign in to comment.