Rahul Sharma [Thu, 4 Oct 2012 15:18:51 +0000 (20:48 +0530)]
drm: exynos: hdmi: add support for platform variants for mixer
This patch adds the support for multiple mixer versions avaialble in
various platform variants. Version is passed as a driver data field
instead of paltform data.
Signed-off-by: Rahul Sharma <rahul.sharma@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Rahul Sharma [Thu, 4 Oct 2012 15:18:50 +0000 (20:48 +0530)]
drm: exynos: hdmi: add support for exynos5 hdmiphy
This patch adds support for exynos5 hdmi phy with device tree enabled.
Signed-off-by: Rahul Sharma <rahul.sharma@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Rahul Sharma [Thu, 4 Oct 2012 15:18:49 +0000 (20:48 +0530)]
drm: exynos: hdmi: add support for exynos5 ddc
This patch adds support for exynos5 ddc with device tree enabled.
Signed-off-by: Rahul Sharma <rahul.sharma@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Rahul Sharma [Thu, 4 Oct 2012 15:18:48 +0000 (20:48 +0530)]
drm: exynos: remove drm hdmi platform data struct
This patch removes the drm hdmi platform data structure which is no
longer in use by drm hdmi driver after this patch set get merged. s5p
hdmi platform data structure is used instead.
Signed-off-by: Rahul Sharma <rahul.sharma@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Tomasz Stanislawski [Thu, 4 Oct 2012 15:18:47 +0000 (20:48 +0530)]
drm: exynos: hdmi: turn off HPD interrupt in HDMI chip
The plug/unplug interrupt are handled by a separate interrupt.
So there is no need to replicate this mechanism in HDMI core.
Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Tomasz Stanislawski [Thu, 4 Oct 2012 15:18:46 +0000 (20:48 +0530)]
drm: exynos: hdmi: use s5p-hdmi platform data
The 'exynos-drm-hdmi' driver makes use of s5p-tv platform devices. Therefore
the driver should use the same platform data to prevent crashes caused by
dereferencing incorrect types. This patch corrects the exynos-drm-hdmi driver
to the platform data from s5p-hdmi.
Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Tomasz Stanislawski [Thu, 4 Oct 2012 15:18:45 +0000 (20:48 +0530)]
drm: exynos: hdmi: fix interrupt handling
This patch fixes 'unsigned < 0' check in probe. Moreover it
releases an interrupt at remove.
Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Tomasz Stanislawski [Thu, 4 Oct 2012 15:18:44 +0000 (20:48 +0530)]
drm: exynos: hdmi: support for platform variants
This patch implements check if HDMI is version 1.3 by using a driver variant
instead of platform data.
Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Tomasz Stanislawski [Thu, 4 Oct 2012 15:18:43 +0000 (20:48 +0530)]
media: s5p-hdmi: add HPD GPIO to platform data
This patch extends s5p-hdmi platform data by a GPIO identifier for
Hot-Plug-Detection pin.
Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
Acked-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Joonyoung Shim [Thu, 27 Sep 2012 10:26:03 +0000 (19:26 +0900)]
drm/exynos: fix kcalloc size of g2d cmdlist node
The size argument means just one element size when we call kcalloc, so
G2D_CMDLIST_NUM * sizeof(*node) is wrong.
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Joonyoung Shim [Thu, 27 Sep 2012 10:25:21 +0000 (19:25 +0900)]
drm/exynos: fix to calculate CRTC shown via screen
This patch is to exactly calculate CRTC shown via screen for all cases.
Refer exynos_plane_get_size() function for this. Also source position of
fb is fixed when start position of CRTC is negative number.
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Inki Dae [Mon, 24 Sep 2012 11:04:24 +0000 (20:04 +0900)]
drm/exynos: fix display power call issue.
Changelog v3:
make exynos_drm_display_power function use exynos_drm_best_encoder
function instead of connector->encoder to get a valid encoder.
connector->encoder could be NULL because with DRM_IOCTL_MODE_RMFB
request, connector->encoder is NULL so fix this issue.
Changelog v2:
remove static prefix so that exynos_drm_best_encoder function
could be called by other modules.
Changelog v1:
this patch fixes the issue that display power callback isn't called.
with DRM_IOCTL_MODE_RMFB request, encoder->connector becomes NULL
so display_ops->power_on() wouldn't be called so this patch makes
exynos_drm_best_encoder function to be used to get a valid encoder
of each connector.
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Leela Krishna Amudala [Fri, 21 Sep 2012 11:22:15 +0000 (16:52 +0530)]
drm/exynos: add platform_device_id table and driver data for drm fimd
Two device ids are created for exynos4-fb and exynos5-fb.
Also, added driver data for exynos4 and exynos5 to pick the timing base address
at runtime to write data into appropriate register address.
Signed-off-by: Leela Krishna Amudala <l.krishna@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Sachin Kamat [Tue, 18 Sep 2012 10:21:30 +0000 (15:51 +0530)]
drm/exynos: Fix potential NULL pointer dereference
drm_mode_create() returns NULL if it fails to create
a new display mode. Check the value returned to avoid NULL
pointer deferencing later.
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Inki Dae [Wed, 19 Sep 2012 02:02:43 +0000 (11:02 +0900)]
drm/exynos: support drm_wait_vblank feature for VIDI
this patch adds drm_wait_vblank support to Virtual Display module
so user can use DRM_IOCT_WAIT_VBLANK ioctl with this patch.
for this, you should set _DRM_VBLANK_EXYNOS_VIDI flags to
vblwait->request.type
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Inki Dae [Fri, 14 Sep 2012 04:29:47 +0000 (13:29 +0900)]
drm/exynos: check crtc's dpms mode at SetCrtc
when fb changing is requested, crtc's dpms mode should be on.
if not on, return -EPERM so that the hardware can't be accessed.
if user requesed dpms off and next SetCrtc with an another fb
then the hardware can be accessed with dpms off to write overlay
data onto some registers so this patch will prevent from accessing
the hardware with dpms off.
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Inki Dae [Tue, 11 Sep 2012 09:25:21 +0000 (18:25 +0900)]
drm/exynos: check crtc's dpms mode at page flip
when page flip is requested, crtc's dpms mode should be on.
if not on, return -EINVAL so that it doesn't access hardware.
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Inki Dae [Tue, 11 Sep 2012 07:35:23 +0000 (16:35 +0900)]
drm/exynos: fix duplicated mutex lock issue
exynos_drm_crtc_dpms function doesn't need mutex lock
because mutex lock was called by drm framework so this
patch removes mutex lock call from that function to avoid
duplicated mutex locking.
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Inki Dae [Tue, 11 Sep 2012 01:45:36 +0000 (10:45 +0900)]
drm/exynos: add pid to g2d_runqueue_node
this patch adds pid to g2d_runqueue_node as member to identify
which process owns this node.
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Inki Dae [Fri, 24 Aug 2012 17:54:12 +0000 (10:54 -0700)]
drm/exynos: Disable plane when released
this patch ensures that each plane connected to encoder is disabled
when released, by adding disable callback function of encoder helper
we had faced with one issue that invalid memory is accessed by dma
once drm is released and then the dma is turned on again. actually,
in our case, page fault was incurred with iommu. the reason is that
a gem buffer accessed by the dma is also released once drm is released.
so this patch would fix this issue ensuring the dma is disabled
when released.
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Inki Dae [Fri, 17 Aug 2012 08:58:38 +0000 (17:58 +0900)]
drm/exynos: update crtc to plane safely
if old_crtc isn't same as encoder->crtc then it means that
user changed crtc id to another one so a plane to old_crtc
should be disabled so that current plane can be updated safely
and plane->crtc should be set to new crtc(encoder->crtc)
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Inki Dae [Mon, 20 Aug 2012 11:05:56 +0000 (20:05 +0900)]
drm/exynos: check NV12M format specific to Exynos properly
this patch adds buf_cnt variable in exynos_drm_fb structure and
that means a buffer count to drm framebuffer and also adds two
functions to get/set the buffer count from/to exynos_drm_fb structure.
if pixel format is not DRM_FORMAT_NV12MT then it gets a buffer count
to drm framebuffer refering to mode_cmd->handles and offsets.
but when booted, the buffer count will always be 1 because pixel
format of console framebuffer is RGB format.
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Inki Dae [Fri, 17 Aug 2012 09:35:47 +0000 (18:35 +0900)]
drm/exynos: make sure that hardware overlay for hdmi is disabled
the values set to registers will be updated into real registers
at vsync so dma operation could be malfunctioned when accessed
to memory after gem buffer was released. this patch makes sure
that hw overlay is disabled before the gem buffer is released.
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Inki Dae [Mon, 20 Aug 2012 10:58:05 +0000 (19:58 +0900)]
drm/exynos: make sure that hardware overlay for fimd is disabled
Changelog v2:
wait for VSYNC instead of BACKPORCH.
Changelog v1:
the values set to registers will be updated into real registers
at vsync so dma operation could be malfunctioned when accessed
to memory after gem buffer was released. this patch makes sure
that hw overlay is disabled before the gem buffer is released.
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Inki Dae [Mon, 20 Aug 2012 10:55:14 +0000 (19:55 +0900)]
drm/exynos: add wait_for_vblank callback interface.
Changelog v2:
fixed comments.
Changelog v1:
this interface can be used to make sure that hardware overlay is disabled
to avoid that memory region is accessed by dma after gem buffer was released.
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Inki Dae [Mon, 20 Aug 2012 12:29:25 +0000 (21:29 +0900)]
drm/exynos: fixed duplicated mode setting.
this patch fixes that when drm_crtc_helper_set_mode() is called,
mode data for hardware overlay and conntroller are updated two times.
for example, in case that drm_crtc_helper_set_mode() is called,
overlay_ops->commit() and manager_ops->commit() callbacks can be called
two times, first at drm_crtc_helper_set_mode() and second
at drm_helper_connector_dpms().
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Inki Dae [Fri, 17 Aug 2012 08:08:04 +0000 (17:08 +0900)]
drm/exynos: separeated fimd_power_on into some parts.
Changelog v2:
fix pm operation when resume.
Changelog v1:
this patch separetes fimd_power_on into fimd_activate and fimd_clock and
fimd_activate function will call fimd_clock to control fimd power and
vsync interrupt.
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Inki Dae [Fri, 17 Aug 2012 04:23:25 +0000 (13:23 +0900)]
drm/exynos: separated subdrv_probe function into two parts.
Changelog v2:
fixed the issue that when sub driver is probed, no kms drivers such as
fimd or hdmi are failed. no kms drivers have no manager so if manager is
null then encoder and connector creation should be ignored.
Changelog v1:
this patch separates exynos_drm_subdrv_probe function into sub driver's probe call
and encoder/connector creation so that exynos drm core module can take exception
when some operation was failed properly.
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Inki Dae [Wed, 5 Sep 2012 05:12:06 +0000 (14:12 +0900)]
drm/exynos: added device object to subdrv's remove callback as argument
when remove callback of exynos_drm_subdrv is called, it could need
device object for sub driver to control things specific to hw such as
runtime pm.
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Dave Airlie [Wed, 3 Oct 2012 03:26:15 +0000 (13:26 +1000)]
Merge branch 'drm-nouveau-next' of git://anongit.freedesktop.org/git/nouveau/linux-2.6 into drm-next
This is a major rework of the nouveau driver core, to reflect more closely
how the hw is used and to make it easier to implement newer features now
that the GPUs are more clearly understood than when nouveau started.
It also contains a few other bits:
thermal patches
nv41/44 pcie gart fixes
i2c unregistering fixes.
* 'drm-nouveau-next' of git://anongit.freedesktop.org/git/nouveau/linux-2.6: (191 commits)
drm/nv98/crypt: fix fuc build with latest envyas
drm/nouveau/devinit: fixup various issues with subdev ctor/init ordering
drm/nv41/vm: fix and enable use of "real" pciegart
drm/nv44/vm: fix and enable use of "real" pciegart
drm/nv04/dmaobj: fixup vm target handling in preparation for nv4x pcie
drm/nouveau: store supported dma mask in vmmgr
drm/nvc0/ibus: initial implementation of subdev
drm/nouveau/therm: add support for fan-control modes
drm/nouveau/hwmon: rename pwm0* to pmw1* to follow hwmon's rules
drm/nouveau/therm: calculate the pwm divisor on nv50+
drm/nouveau/fan: rewrite the fan tachometer driver to get more precision, faster
drm/nouveau/therm: move thermal-related functions to the therm subdev
drm/nouveau/bios: parse the pwm divisor from the perf table
drm/nouveau/therm: use the EXTDEV table to detect i2c monitoring devices
drm/nouveau/therm: rework thermal table parsing
drm/nouveau/gpio: expose the PWM/TOGGLE parameter found in the gpio vbios table
drm/nouveau: fix pm initialization order
drm/nouveau/bios: check that fixed tvdac gpio data is valid before using it
drm/nouveau: log channel debug/error messages from client object rather than drm client
drm/nouveau: have drm debugging macros build on top of core macros
...
Conflicts:
drivers/gpu/drm/nouveau/nouveau_dp.c
Ben Skeggs [Wed, 3 Oct 2012 00:52:58 +0000 (10:52 +1000)]
drm/nv98/crypt: fix fuc build with latest envyas
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Tue, 2 Oct 2012 00:30:34 +0000 (10:30 +1000)]
drm/nouveau/devinit: fixup various issues with subdev ctor/init ordering
Details of the problem, and solution, are in comments in the commit
proper.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Wed, 26 Sep 2012 22:56:24 +0000 (08:56 +1000)]
drm/nv41/vm: fix and enable use of "real" pciegart
Hopefully fixed the tlb flush timeout issue. Was able to observe this
condition occur occasionally, and it appears the binary driver doesn't
wait on the old condition either..
Should give 39-bit DMA addressing on the relevant chipsets.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Wed, 26 Sep 2012 22:55:53 +0000 (08:55 +1000)]
drm/nv44/vm: fix and enable use of "real" pciegart
Something seems to be missing in regards to flushing specific ranges of
the TLB. For the moment, flushing the entire thing seems to make it
work alright.
Should give 39-bit DMA addressing on the relevant chipsets.
v2: allocate contig 16KiB for dummy pages, reported by mwk on irc
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Wed, 26 Sep 2012 05:01:39 +0000 (15:01 +1000)]
drm/nv04/dmaobj: fixup vm target handling in preparation for nv4x pcie
We don't need to pull the page address out of the page tables on nv4x
chips that have a real GART.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Wed, 26 Sep 2012 04:37:51 +0000 (14:37 +1000)]
drm/nouveau: store supported dma mask in vmmgr
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Wed, 26 Sep 2012 03:05:01 +0000 (13:05 +1000)]
drm/nvc0/ibus: initial implementation of subdev
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Martin Peres [Tue, 4 Sep 2012 11:52:00 +0000 (13:52 +0200)]
drm/nouveau/therm: add support for fan-control modes
For now, only 2 control modes are available:
- NONE: The fan is never touched (default)
- MANUAL: The fan is set to the user-defined fan speed (pwm1)
This patch introduces a distinction between ptherm internal fan management
and external fan management. The latter is bound to respect the fan mode
while the first can still select the speed it wants unless the NONE mode
is selected. This is important for automatic fan management.
Signed-off-by: Martin Peres <martin.peres@labri.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Martin Peres [Tue, 4 Sep 2012 11:39:40 +0000 (13:39 +0200)]
drm/nouveau/hwmon: rename pwm0* to pmw1* to follow hwmon's rules
This was reported by tizbac on IRC.
Signed-off-by: Martin Peres <martin.peres@labri.fr>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Martin Peres [Sun, 2 Sep 2012 02:01:43 +0000 (04:01 +0200)]
drm/nouveau/therm: calculate the pwm divisor on nv50+
v2: Martin Peres <martin.peres@labri.fr>
- fixed unintentional use of floating point
Signed-off-by: Martin Peres <martin.peres@labri.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Martin Peres [Sun, 2 Sep 2012 01:20:45 +0000 (03:20 +0200)]
drm/nouveau/fan: rewrite the fan tachometer driver to get more precision, faster
The previous driver waited for 250ms to accumulate data. This version times a
complete fan rotation and extrapolates to RPM.
The fan rotational speed should now be read in less than 250ms (worst case)
and usually in less 50ms.
Signed-off-by: Martin Peres <martin.peres@labri.fr>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Martin Peres [Sun, 2 Sep 2012 00:55:58 +0000 (02:55 +0200)]
drm/nouveau/therm: move thermal-related functions to the therm subdev
It looks scary because of the size, but I tried to keep the differences minimal.
Further patches will fix the actual "driver" code and add new features.
v2: change filenames, split to submodules
v3: add a missing include
v4: Ben Skeggs <bskeggs@redhat.com>
- fixed set_defaults() to allow min_duty < 30 (thermal table will
override this if it's actually necessary)
- fixed set_defaults() to not provide pwm_freq so nv4x (which only has
pwm_div) can actually work. the boards using pwm_freq will have a
thermal table entry to provide us the value.
- removed unused files
Signed-off-by: Martin Peres <martin.peres@labri.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Martin Peres [Thu, 30 Aug 2012 00:31:59 +0000 (02:31 +0200)]
drm/nouveau/bios: parse the pwm divisor from the perf table
v2: perf_table now is more in line with the other functions
Signed-off-by: Martin Peres <martin.peres@labri.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Martin Peres [Sat, 18 Aug 2012 14:33:53 +0000 (16:33 +0200)]
drm/nouveau/therm: use the EXTDEV table to detect i2c monitoring devices
This commit also adds a static list of all known devices and their possible
i2c addresses.
v2: use the common table parsing technique as suggested by darktama
Signed-off-by: Martin Peres <martin.peres@labri.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Martin Peres [Thu, 16 Aug 2012 09:00:55 +0000 (11:00 +0200)]
drm/nouveau/therm: rework thermal table parsing
As an accident, it should also fix temperature reading on nv4x.
v2: introduce nvbios_therm_entry as advised by darktama
Signed-off-by: Martin Peres <martin.peres@labri.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Martin Peres [Sat, 12 May 2012 13:28:51 +0000 (15:28 +0200)]
drm/nouveau/gpio: expose the PWM/TOGGLE parameter found in the gpio vbios table
Signed-off-by: Martin Peres <martin.peres@labri.fr>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Dmitry Eremin-Solenikov [Tue, 25 Sep 2012 06:31:40 +0000 (10:31 +0400)]
drm/nouveau: fix pm initialization order
If nouveau_pm_perflvl_get() fails, pm->profiles list will be left
uninitialized, which causes oops during nouveau_pm_fini().
Move INIT_LIST_HEAD before call to nouveau_pm_perflvl_get().
Signed-off-by: Dmitry Eremin-Solenikov <dmitry_eremin@mentor.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Wed, 12 Sep 2012 05:55:01 +0000 (15:55 +1000)]
drm/nouveau/bios: check that fixed tvdac gpio data is valid before using it
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Wed, 12 Sep 2012 03:40:47 +0000 (13:40 +1000)]
drm/nouveau: log channel debug/error messages from client object rather than drm client
This will make it more obvious which application caused particular messages.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Wed, 12 Sep 2012 03:38:13 +0000 (13:38 +1000)]
drm/nouveau: have drm debugging macros build on top of core macros
May kill the DRM version completely at some point, undecided..
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Wed, 12 Sep 2012 03:09:23 +0000 (13:09 +1000)]
drm/nouveau/core: have client-id be a string, rather than an integer
Can be somewhat more informative that way...
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Fri, 7 Sep 2012 00:26:38 +0000 (20:26 -0400)]
drm/nvc0/fifo: re-bash PBUS regs after vm-fault to BARs/PEEPHOLE
Seems to be required to "re-arm" the engines after a vm fault.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Thu, 6 Sep 2012 05:03:47 +0000 (01:03 -0400)]
drm/nvc0/gr: implement initial trap handler
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Thu, 6 Sep 2012 03:09:22 +0000 (13:09 +1000)]
drm/nvc0/gr: rebuild fuc with latest envyas
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Wed, 5 Sep 2012 02:19:26 +0000 (12:19 +1000)]
drm/nvc0/ltcg: read LTS count at startup
Not really sure how to confirm this 100%, but, the numbers match on all the
traces I have for NVCx (2 LTS), NVD9 (1LTS) and NVEx (4LTS).
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Thu, 23 Aug 2012 05:52:28 +0000 (01:52 -0400)]
drm/nve0/gr: enable use of our fuc by default
Graphics acceleration is still disabled by default due to lingering issues
that need to be solved.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Thu, 23 Aug 2012 05:32:38 +0000 (01:32 -0400)]
drm/nve0/gr: remove 0x404160 bashing from hub fuc
Triggers PIBUS interrupts due to register not existing anymore, and as
a result HUB_SET_CHAN times out.
After this commit, our fuc loads and can accelerate at least fbcon, X,
glxgears and OA on NVE4. NVE7 not tested as of yet.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Thu, 23 Aug 2012 00:47:40 +0000 (20:47 -0400)]
drm/nve0/gr: initial fuc implementation, based on fermi's code
Currently identical except the available chipset register lists. This will
*not* currently work and is disabled by default because of this.
May get merged again later, remains to be seen what further changes will be
required.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Thu, 23 Aug 2012 03:55:42 +0000 (23:55 -0400)]
drm/nve0/ibus: handle PIBUS interrupts to prevent storm
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Thu, 23 Aug 2012 05:14:21 +0000 (01:14 -0400)]
drm/nouveau/sw: trap and clear PMC_INTR_0_SOFTWARE
Came in useful for debugging another issue earlier, so keep it around.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Marcin Slusarz [Sun, 19 Aug 2012 21:00:00 +0000 (23:00 +0200)]
drm/nouveau: quiet some static-related sparse noise
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Marcin Slusarz [Sun, 19 Aug 2012 20:59:59 +0000 (22:59 +0200)]
drm/nouveau: constify instances of nouveau_bitfield and nouveau_enum structs
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Sun, 19 Aug 2012 06:03:00 +0000 (16:03 +1000)]
drm/nouveau/fifo: use defines instead of hardcoded class ids
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Sun, 19 Aug 2012 05:58:38 +0000 (15:58 +1000)]
drm/nouveau/dmaobj: reject unsupported parent types instead of half-succeeding
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Sun, 19 Aug 2012 05:53:15 +0000 (15:53 +1000)]
drm/nouveau: add defines for internal class names
Will probably flesh the documentation of the classes out a bit too at some
later point.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Tue, 14 Aug 2012 05:33:20 +0000 (15:33 +1000)]
drm/nv50/fifo: add support for dma channel class
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Tue, 14 Aug 2012 05:30:14 +0000 (15:30 +1000)]
drm/nv84/fifo: add support for dma channel class
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Tue, 14 Aug 2012 05:02:29 +0000 (15:02 +1000)]
drm/nouveau/fifo: version the dma channel class struct
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Tue, 14 Aug 2012 04:53:51 +0000 (14:53 +1000)]
drm/nouveau/fifo: separate object classes for dma channels
Future code will use the object class rather than chipset checks in order to
identify available channel features.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Mon, 13 Aug 2012 06:26:07 +0000 (16:26 +1000)]
drm/nouveau: restore fifo chid information in engine error messages
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Fri, 10 Aug 2012 05:10:34 +0000 (15:10 +1000)]
drm/nouveau/core: have fifo store a unique context identifier at attach time
This value will match something that's easily available from the engine IRQ
handlers, and used to lookup the relevant context.
Since the changes in how this is done on each generation match when the
major PFIFO changes happened, fifo is responsible for calculating the
correct value to avoid duplicating the same code among many engine modules.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Fri, 10 Aug 2012 04:02:44 +0000 (14:02 +1000)]
drm/nouveau/fifo: add method to lookup fifo chid related to a given object
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Fri, 10 Aug 2012 03:47:56 +0000 (13:47 +1000)]
drm/nouveau/core: protect engine context list with hardirq-safe spinlock
IRQ handlers will need access to engine contexts.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Mon, 6 Aug 2012 11:56:18 +0000 (21:56 +1000)]
drm/nv84/fifo: mask only the engine we're waiting on for channel unload
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Mon, 6 Aug 2012 09:38:25 +0000 (19:38 +1000)]
drm/nve0: use async copy engine for ttm buffer moves if available
Kepler PFIFO lost the ability to address multiple engines from a single
channel, so we need a separate one for the copy engine.
v2: Marcin Slusarz <marcin.slusarz@gmail.com>
- regression fix: restore hw accelerated buffer copies
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Mon, 6 Aug 2012 09:28:02 +0000 (19:28 +1000)]
drm/nve0/copy: add initial support for the async copy engines
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Mon, 6 Aug 2012 08:16:37 +0000 (18:16 +1000)]
drm/nve0/fifo: support engine selection when creating fifo channels
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Mon, 6 Aug 2012 06:31:26 +0000 (16:31 +1000)]
drm/nouveau/device: return proper error codes if ioremap fails
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Mon, 6 Aug 2012 06:30:10 +0000 (16:30 +1000)]
drm/nouveau/core: remove some left-over pieces from the porting process
Reported-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Sun, 5 Aug 2012 01:29:10 +0000 (11:29 +1000)]
drm/nvc0-/gr: remove reset-after-grctx-construction hack
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Fri, 3 Aug 2012 04:58:10 +0000 (14:58 +1000)]
drm/nouveau: add Kconfig options for debug control
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Tue, 31 Jul 2012 06:16:21 +0000 (16:16 +1000)]
drm/nouveau: port remainder of drm code, and rip out compat layer
v2: Ben Skeggs <bskeggs@redhat.com>
- fill in nouveau_pm.dev to prevent oops
- fix ppc issues (build + OF shadow)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Thu, 26 Jul 2012 22:28:20 +0000 (08:28 +1000)]
drm/nouveau/device: include the official chipset names
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Wed, 25 Jul 2012 23:12:47 +0000 (09:12 +1000)]
drm/nouveau/backlight: remove dependence on nouveau_drv.h
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Wed, 25 Jul 2012 22:59:23 +0000 (08:59 +1000)]
drm/nouveau: flatten nv{Read,Write}{MC,VIDEO,FB,EXTDEV}
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Wed, 25 Jul 2012 22:54:33 +0000 (08:54 +1000)]
drm/nouveau: move compat ioctl out of nouveau_drv.h
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Wed, 25 Jul 2012 22:51:21 +0000 (08:51 +1000)]
drm/nouveau/acpi: move definitions out of nouveau_drv.h
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Sun, 22 Jul 2012 06:41:26 +0000 (16:41 +1000)]
drm/nouveau/mxm: split up into bios code and a subdev module
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Sun, 22 Jul 2012 05:03:09 +0000 (15:03 +1000)]
drm/nouveau: start culling unused code
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Thu, 19 Jul 2012 22:17:34 +0000 (08:17 +1000)]
drm/nouveau: port all engines to new engine module format
This is a HUGE commit, but it's not nearly as bad as it looks - any problems
can be isolated to a particular chipset and engine combination. It was
simply too difficult to port each one at a time, the compat layers are
*already* ridiculous.
Most of the changes here are simply to the glue, the process for each of the
engine modules was to start with a standard skeleton and copy+paste the old
code into the appropriate places, fixing up variable names etc as needed.
v2: Marcin Slusarz <marcin.slusarz@gmail.com>
- fix find/replace bug in license header
v3: Ben Skeggs <bskeggs@redhat.com>
- bump indirect pushbuf size to 8KiB, 4KiB barely enough for userspace and
left no space for kernel's requirements during GEM pushbuf submission.
- fix duplicate assignments noticed by clang
v4: Marcin Slusarz <marcin.slusarz@gmail.com>
- add sparse annotations to nv04_fifo_pause/nv04_fifo_start
- use ioread32_native/iowrite32_native for fifo control registers
v5: Ben Skeggs <bskeggs@redhat.com>
- rebase on v3.6-rc4, modified to keep copy engine fix intact
- nv10/fence: unmap fence bo before destroying
- fixed fermi regression when using nvidia gr fuc
- fixed typo in supported dma_mask checking
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Sat, 4 Aug 2012 08:40:45 +0000 (18:40 +1000)]
drm/nvc0-/gr: generate grctx template at init time, not first context ctor
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Sat, 4 Aug 2012 08:26:50 +0000 (18:26 +1000)]
drm/nvc0-/gr: share headers between fermi and kepler graphics code
v2: Ben Skeggs <bskeggs@redhat.com>
- de-inline nv_icmd, triggers some gcc issue causing ctxnv[ce]0.c to
take a *very* *very* long time to build on some configs.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Sun, 22 Jul 2012 01:55:54 +0000 (11:55 +1000)]
drm/nouveau/pageflip: kick flip handling out of engsw and into fence
This is all very much a policy thing, and hence will not belong in SW
after the rework.
engsw now only handles receiving the event to say "can flip now" and makes
a callback to perform the actual work.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Thu, 19 Jul 2012 07:54:21 +0000 (17:54 +1000)]
drm/nouveau: move some more code around to more appropriate places
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Thu, 19 Jul 2012 07:32:01 +0000 (17:32 +1000)]
drm/nvc0-nve0/graph: rename dev to priv, no code changes
There's a *lot* of code in here, and it's all going to use the PGRAPH priv
pointer rather than drm_device after the engine rework. This is handling
all the rename-only parts of the change.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Thu, 19 Jul 2012 00:51:42 +0000 (10:51 +1000)]
drm/nouveau/fence: un-port from nouveau_exec_engine interfaces
Still the same code, but not an "engine" anymore. The fence code is more of
a policy decision rather than exposing mechanisms, so it's not appropriate
to port it to the new engine subsystem.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Wed, 18 Jul 2012 12:15:33 +0000 (22:15 +1000)]
drm/nouveau: pull nouveau_gem definitions into their own header
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Wed, 18 Jul 2012 07:17:09 +0000 (17:17 +1000)]
drm/nouveau: pull nouveau_bo definitions into their own header
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Wed, 18 Jul 2012 00:00:50 +0000 (10:00 +1000)]
drm/nv04/disp: kick all private state out to own header
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Sat, 14 Jul 2012 09:09:17 +0000 (19:09 +1000)]
drm/nouveau/instmem: completely new implementation, as a subdev module
v2 (Ben Skeggs):
- some fixes for 64KiB PAGE_SIZE
- fix porting issues in (currently unused) nv41/nv44 pciegart code
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>