profile/common/kernel-common.git
10 years agodrm/cirrus: Fix cirrus drm driver for fbdev + qemu
Martin Koegler [Thu, 9 Jan 2014 09:05:07 +0000 (10:05 +0100)]
drm/cirrus: Fix cirrus drm driver for fbdev + qemu

Xorg fbdev driver requires smem_start/smem_len, otherwise
it tries to map 0 bytes as video memory.

Bugzilla: https://bugzilla.novell.com/show_bug.cgi?id=856760
Signed-off-by: Martin Koegler <martin.koegler@chello.at>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
10 years agoMerge branch 'exynos-drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/daein...
Dave Airlie [Mon, 13 Jan 2014 03:55:48 +0000 (13:55 +1000)]
Merge branch 'exynos-drm-next' of git://git./linux/kernel/git/daeinki/drm-exynos into drm-next

This pull request adds an anon file for exynos specific mmaper
to resolve potential a dead lock issue pointed out by Al Viro,
and fixes build break of drm-next.

* 'exynos-drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos:
  drm/exynos: fix build error caused by removed drm core macros
  drm/exynos: use a new anon file for exynos gem mmaper

10 years agoMerge branch 'drm-next-3.14-wip' of git://people.freedesktop.org/~agd5f/linux into...
Dave Airlie [Mon, 13 Jan 2014 03:55:10 +0000 (13:55 +1000)]
Merge branch 'drm-next-3.14-wip' of git://people.freedesktop.org/~agd5f/linux into drm-next

This is the drm-next pull for radeon for 3.14. Highlights include:
- dpm rework which fixes some issues and allows us to enable dpm by
default on CIK parts
- enable clockgating on CIK parts
- pci config reset.  This is a bus-level chip reset that can be more
reliable than soft reset in certain cases.  Disabled by default.  Enable
with the hard_reset module option.
- big endian rptr/wrptr update fixes
- lots of debugfs improvements
- some driver cleanup patches from Rashika Kheria
- bug fixes

* 'drm-next-3.14-wip' of git://people.freedesktop.org/~agd5f/linux: (50 commits)
  drm/radeon: implement pci config reset for CIK (v3)
  drm/radeon: implement pci config reset for SI (v2)
  drm/radeon: implement pci config reset for evergreen/cayman (v2)
  drm/radeon: implement pci config reset for r6xx/7xx (v3)
  drm/radeon: add pci config hard reset
  drm/radeon: add hard_reset module parameter
  drm/radeon: skip colorbuffer checking if COLOR_INFO.FORMAT is set to INVALID
  radeon/pm: Guard access to rdev->pm.power_state array
  drivers: gpu: Move prototype declarations to header file radeon_mode.h from radeon_atombios.c and radeon_combios.c
  drivers: gpu: Move prototype declaration to header file radeon_mode.h
  drm/radeon: move com/atombios scratch reg functions to radeon_mode.h
  drm/radeon/dpm: make some functions static for TN
  drm/radeon/dpm: make some functions static for sumo
  drm/radeon/dpm: make some functions static for CI
  drivers: gpu: Include appropriate header file in ci_smc.c
  drivers: gpu: Move prototype declaration to header file radeon_mode.h from atombios_i2c.c
  drivers: gpu: Include appropriate header file in si_smc.c and remove prototype declaration from header file sislands_smc.h
  drivers: gpu: Add static keyword to the definition of KMS_INVALID_IOCTL in radeon_kms.c
  drivers: gpu: Mark function as static in r600_hdmi.c
  drivers: gpu: Mark function as static in radeon_gem.c
  ...

10 years agoMerge branch 'msm-next' of git://people.freedesktop.org/~robclark/linux into drm...
Dave Airlie [Mon, 13 Jan 2014 03:53:56 +0000 (13:53 +1000)]
Merge branch 'msm-next' of git://people.freedesktop.org/~robclark/linux into drm-next

MSM tree from Rob.

* 'msm-next' of git://people.freedesktop.org/~robclark/linux:
  drm/msm: add a330/apq8x74
  drm/msm: add mdp5/apq8x74
  drm/msm: add hdmi support for apq8x74/mdp5
  drm/msm: move irq utils to mdp_kms
  drm/msm: split out msm_kms.h
  drm/msm: mdp4_format -> mdp_format
  drm/msm: resync generated headers
  drm/msm: move mdp4 -> mdp/mdp4
  drm/msm: add support for msm8060ab/bstem
  drm/msm: add support for non-IOMMU systems
  drm/msm: fix bus scaling
  drm/msm: add missing MODULE_FIRMWARE()s
  drm/msm: COMPILE_TEST support

10 years agodrm/msm: add a330/apq8x74
Rob Clark [Thu, 5 Dec 2013 22:39:53 +0000 (17:39 -0500)]
drm/msm: add a330/apq8x74

Add support for adreno 330.  Not too much different, just a few
differences in initial configuration plus setting OCMEM base.
Userspace support is already in upstream mesa.

Note that the existing DT code is simply using the bindings from
downstream android kernel, to simplify porting of this driver to
existing devices.  These do not constitute any committed/stable
DT ABI.  The addition of proper DT bindings will be a subsequent
patch, at which point (as best as possible) I will try to support
either upstream bindings or what is found in downstream android
kernel, so that existing device DT files can be used.

Signed-off-by: Rob Clark <robdclark@gmail.com>
10 years agodrm/msm: add mdp5/apq8x74
Rob Clark [Sat, 30 Nov 2013 22:51:47 +0000 (17:51 -0500)]
drm/msm: add mdp5/apq8x74

Add support for the new MDP5 display controller block.  The mapping
between parts of the display controller and KMS is:

  plane   -> PIPE{RGBn,VIGn}             \
  crtc    -> LM (layer mixer)            |-> MDP "device"
  encoder -> INTF                        /
  connector -> HDMI/DSI/eDP/etc          --> other device(s)

Unlike MDP4, it appears we can get by with a single encoder, rather
than needing a different implementation for DTV, DSI, etc.  (Ie. the
register interface is same, just different bases.)

Also unlike MDP4, all the IRQs for other blocks (HDMI, DSI, etc) are
routed through MDP.

And finally, MDP5 has this "Shared Memory Pool" (called "SMP"), from
which blocks need to be allocated to the active pipes based on fetch
stride.

Signed-off-by: Rob Clark <robdclark@gmail.com>
10 years agodrm/msm: add hdmi support for apq8x74/mdp5
Rob Clark [Sun, 1 Dec 2013 17:12:54 +0000 (12:12 -0500)]
drm/msm: add hdmi support for apq8x74/mdp5

The HDMI block is basically the same between older SoC's with mdp4
display controller, and newer ones with mdp5.

So mostly this consists of better abstracting out the different sets of
regulators, clks, etc.  In particular, for regulators and clks we can
split it up by what is needed for hot plug detect to work, and what is
needed to light up the display.

Also, 8x74 has a new phy.. a very simple one, but split out into a
different mmio space.  And with mdp5, the irq is shared with mdp, so we
don't directly register our own irq handler.

Signed-off-by: Rob Clark <robdclark@gmail.com>
10 years agodrm/msm: move irq utils to mdp_kms
Rob Clark [Sat, 30 Nov 2013 22:24:22 +0000 (17:24 -0500)]
drm/msm: move irq utils to mdp_kms

We'll want basically the same thing for mdp5, so refactor it out so it
can be shared.

Signed-off-by: Rob Clark <robdclark@gmail.com>
10 years agodrm/msm: split out msm_kms.h
Rob Clark [Sat, 30 Nov 2013 21:12:10 +0000 (16:12 -0500)]
drm/msm: split out msm_kms.h

Signed-off-by: Rob Clark <robdclark@gmail.com>
10 years agodrm/msm: mdp4_format -> mdp_format
Rob Clark [Sat, 30 Nov 2013 19:58:23 +0000 (14:58 -0500)]
drm/msm: mdp4_format -> mdp_format

This can be shared between mdp4 and mdp5.  Both use the same set of
parameters to describe the format to the hw.

Signed-off-by: Rob Clark <robdclark@gmail.com>
10 years agodrm/msm: resync generated headers
Rob Clark [Sat, 30 Nov 2013 17:45:48 +0000 (12:45 -0500)]
drm/msm: resync generated headers

resync to latest envytools db, add mdp5 registers

Signed-off-by: Rob Clark <robdclark@gmail.com>
10 years agodrm/msm: move mdp4 -> mdp/mdp4
Rob Clark [Sat, 30 Nov 2013 17:37:42 +0000 (12:37 -0500)]
drm/msm: move mdp4 -> mdp/mdp4

There are some little bits and pieces that mdp4 and mdp5 can share, so
move things around so that we can have both in a common parent
directory.

Signed-off-by: Rob Clark <robdclark@gmail.com>
10 years agodrm/msm: add support for msm8060ab/bstem
Rob Clark [Sat, 16 Nov 2013 18:07:31 +0000 (13:07 -0500)]
drm/msm: add support for msm8060ab/bstem

This adds the necessary configuration for the APQ8060A SoC (dual-core
krait + a320 gpu) as found on the bstem board.

Signed-off-by: Rob Clark <robdclark@gmail.com>
10 years agodrm/msm: add support for non-IOMMU systems
Rob Clark [Sat, 16 Nov 2013 17:56:06 +0000 (12:56 -0500)]
drm/msm: add support for non-IOMMU systems

Add a VRAM carveout that is used for systems which do not have an IOMMU.

The VRAM carveout uses CMA.  The arch code must setup a CMA pool for the
device (preferrably in highmem.. a 256m-512m VRAM pool in lowmem is not
cool).  The user can configure the VRAM pool size using msm.vram module
param.

Technically, the abstraction of IOMMU behind msm_mmu is not strictly
needed, but it simplifies the GEM code a bit, and will be useful later
when I add support for a2xx devices with GPUMMU, so I decided to keep
this part.

It appears to be possible to configure the GPU to restrict access to
addresses within the VRAM pool, but this is not done yet.  So for now
the GPU will refuse to load if there is no sort of mmu.  Once address
based limits are supported and tested to confirm that we aren't giving
the GPU access to arbitrary memory, this restriction can be lifted

Signed-off-by: Rob Clark <robdclark@gmail.com>
10 years agodrm/msm: fix bus scaling
Rob Clark [Fri, 15 Nov 2013 14:03:15 +0000 (09:03 -0500)]
drm/msm: fix bus scaling

This got a bit broken with original patches when re-arranging things to
move dependencies on mach-msm inside #ifndef OF.

Signed-off-by: Rob Clark <robdclark@gmail.com>
10 years agodrm/msm: add missing MODULE_FIRMWARE()s
Rob Clark [Fri, 15 Nov 2013 14:03:48 +0000 (09:03 -0500)]
drm/msm: add missing MODULE_FIRMWARE()s

Signed-off-by: Rob Clark <robdclark@gmail.com>
10 years agodrm/msm: COMPILE_TEST support
Rob Clark [Wed, 27 Nov 2013 21:29:59 +0000 (16:29 -0500)]
drm/msm: COMPILE_TEST support

With a simple stub, we can get COMPILE_TEST support.

Signed-off-by: Rob Clark <robdclark@gmail.com>
10 years agodrm/radeon: implement pci config reset for CIK (v3)
Alex Deucher [Wed, 2 Oct 2013 19:18:14 +0000 (15:18 -0400)]
drm/radeon: implement pci config reset for CIK (v3)

pci config reset is a low level reset that resets
the entire chip from the bus interface.  It can
be more reliable if soft reset fails.

v2: fix rebase
v3: hide behind module parameter

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 years agodrm/radeon: implement pci config reset for SI (v2)
Alex Deucher [Fri, 15 Nov 2013 21:35:55 +0000 (16:35 -0500)]
drm/radeon: implement pci config reset for SI (v2)

pci config reset is a low level reset that resets
the entire chip from the bus interface.  It can
be more reliable if soft reset fails.

v2: hide behind module parameter

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 years agodrm/radeon: implement pci config reset for evergreen/cayman (v2)
Alex Deucher [Fri, 1 Nov 2013 20:25:10 +0000 (16:25 -0400)]
drm/radeon: implement pci config reset for evergreen/cayman (v2)

pci config reset is a low level reset that resets
the entire chip from the bus interface.  It can
be more reliable if soft reset fails.

v2: put behind module parameter

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 years agodrm/radeon: implement pci config reset for r6xx/7xx (v3)
Alex Deucher [Fri, 1 Nov 2013 23:01:36 +0000 (19:01 -0400)]
drm/radeon: implement pci config reset for r6xx/7xx (v3)

pci config reset is a low level reset that resets
the entire chip from the bus interface.  It can
be more reliable if soft reset fails.

There's not much information still available on
r6xx, so r6xx is based on guess-work.

v2: put behind module parameter
v3: add IGP check

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 years agodrm/radeon: add pci config hard reset
Alex Deucher [Wed, 2 Oct 2013 17:01:36 +0000 (13:01 -0400)]
drm/radeon: add pci config hard reset

This is used to hard reset the asic.  If a soft
reset is not able to reset things, a hard reset
can be used.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 years agodrm/radeon: add hard_reset module parameter
Alex Deucher [Wed, 8 Jan 2014 22:55:08 +0000 (17:55 -0500)]
drm/radeon: add hard_reset module parameter

Enabling this parameter enables pci config reset,
aka hard reset, which is a bus level chip reset.
In some cases this works more reliably than a soft
reset.  Disabled by default.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 years agodrm/radeon: skip colorbuffer checking if COLOR_INFO.FORMAT is set to INVALID
Marek Olšák [Wed, 8 Jan 2014 17:16:26 +0000 (18:16 +0100)]
drm/radeon: skip colorbuffer checking if COLOR_INFO.FORMAT is set to INVALID

This fixes a bug which was causing rejections of valid GPU commands
from userspace.

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 years agoradeon/pm: Guard access to rdev->pm.power_state array
Michel Dänzer [Wed, 8 Jan 2014 02:40:20 +0000 (11:40 +0900)]
radeon/pm: Guard access to rdev->pm.power_state array

It's never allocated on systems without an ATOMBIOS or COMBIOS ROM.

Should fix an oops I encountered while resetting the GPU after a lockup
on my PowerBook with an RV350.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
10 years agodrivers: gpu: Move prototype declarations to header file radeon_mode.h from radeon_at...
Rashika Kheria [Tue, 7 Jan 2014 18:06:31 +0000 (13:06 -0500)]
drivers: gpu: Move prototype declarations to header file radeon_mode.h from radeon_atombios.c and radeon_combios.c

Move prototype declarations of functions radeon_get_encoder_enum() and
radeon_link_encoder_connector() to header file drm/radeon/radeon_mode.h
because they are used by more than one file.

This eliminates the following warnings in drm/radeon/radeon_encoders.c:
drivers/gpu/drm/radeon/radeon_encoders.c:86:1: warning: no previous prototype for ‘radeon_get_encoder_enum’ [-Wmissing-prototypes]
drivers/gpu/drm/radeon/radeon_encoders.c:162:1: warning: no previous prototype for ‘radeon_link_encoder_connector’ [-Wmissing-prototypes]

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 years agodrivers: gpu: Move prototype declaration to header file radeon_mode.h
Rashika Kheria [Tue, 7 Jan 2014 18:01:32 +0000 (13:01 -0500)]
drivers: gpu: Move prototype declaration to header file radeon_mode.h

Move prototype declaration of functions radeon_add_atom_connector() and
radeon_add_legacy_connector() to header file drm/radeon/radeon_mode.h
because  they are used by more than one file.

This eliminates the following warning in drm/radeon/radeon_connectors.c:
drivers/gpu/drm/radeon/radeon_connectors.c:1588:1: warning: no previous prototype for ‘radeon_add_atom_connector’ [-Wmissing-prototypes]
drivers/gpu/drm/radeon/radeon_connectors.c:2020:1: warning: no previous prototype for ‘radeon_add_legacy_connector’ [-Wmissing-prototypes]

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 years agodrm/radeon: move com/atombios scratch reg functions to radeon_mode.h
Alex Deucher [Tue, 7 Jan 2014 17:53:29 +0000 (12:53 -0500)]
drm/radeon: move com/atombios scratch reg functions to radeon_mode.h

fixes warnings with -Wmissing-prototypes

Based on initial patches from Rashika Kheria.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: Rashika Kheria <rashika.kheria@gmail.com>
10 years agodrm/radeon/dpm: make some functions static for TN
Alex Deucher [Tue, 7 Jan 2014 17:23:49 +0000 (12:23 -0500)]
drm/radeon/dpm: make some functions static for TN

Noticed by Rashika Kheria and cherry-picked from
her larger patch set.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: Rashika Kheria <rashika.kheria@gmail.com>
10 years agodrm/radeon/dpm: make some functions static for sumo
Alex Deucher [Tue, 7 Jan 2014 17:20:45 +0000 (12:20 -0500)]
drm/radeon/dpm: make some functions static for sumo

Noticed by Rashika Kheria and cherry-picked from
her larger patch set.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: Rashika Kheria <rashika.kheria@gmail.com>
10 years agodrm/radeon/dpm: make some functions static for CI
Alex Deucher [Tue, 7 Jan 2014 17:16:05 +0000 (12:16 -0500)]
drm/radeon/dpm: make some functions static for CI

Noticed by Rashika Kheria and cherry-picked from
her larger patch set.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: Rashika Kheria <rashika.kheria@gmail.com>
10 years agodrivers: gpu: Include appropriate header file in ci_smc.c
Rashika Kheria [Mon, 6 Jan 2014 16:35:34 +0000 (22:05 +0530)]
drivers: gpu: Include appropriate header file in ci_smc.c

Include header file drm/radeon/ci_dpm.h in drm/radeon/ci_smc.c because
it uses function declared in the header file.

This eliminates the following warnings in drm/radeon/ci_smc.c:
drivers/gpu/drm/radeon/ci_smc.c:46:5: warning: no previous prototype for ‘ci_copy_bytes_to_smc’ [-Wmissing-prototypes]
drivers/gpu/drm/radeon/ci_smc.c:113:6: warning: no previous prototype for ‘ci_start_smc’ [-Wmissing-prototypes]
drivers/gpu/drm/radeon/ci_smc.c:121:6: warning: no previous prototype for ‘ci_reset_smc’ [-Wmissing-prototypes]
drivers/gpu/drm/radeon/ci_smc.c:129:5: warning: no previous prototype for ‘ci_program_jump_on_start’ [-Wmissing-prototypes]
drivers/gpu/drm/radeon/ci_smc.c:136:6: warning: no previous prototype for ‘ci_stop_smc_clock’ [-Wmissing-prototypes]
drivers/gpu/drm/radeon/ci_smc.c:145:6: warning: no previous prototype for ‘ci_start_smc_clock’ [-Wmissing-prototypes]
drivers/gpu/drm/radeon/ci_smc.c:154:6: warning: no previous prototype for ‘ci_is_smc_running’ [-Wmissing-prototypes]
drivers/gpu/drm/radeon/ci_smc.c:165:14: warning: no previous prototype for ‘ci_send_msg_to_smc’ [-Wmissing-prototypes]
drivers/gpu/drm/radeon/ci_smc.c:186:14: warning: no previous prototype for ‘ci_wait_for_smc_inactive’ [-Wmissing-prototypes]
drivers/gpu/drm/radeon/ci_smc.c:204:5: warning: no previous prototype for ‘ci_load_smc_ucode’ [-Wmissing-prototypes]
drivers/gpu/drm/radeon/ci_smc.c:251:5: warning: no previous prototype for ‘ci_read_smc_sram_dword’ [-Wmissing-prototypes]
drivers/gpu/drm/radeon/ci_smc.c:266:5: warning: no previous prototype for ‘ci_write_smc_sram_dword’ [-Wmissing-prototypes]

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 years agodrivers: gpu: Move prototype declaration to header file radeon_mode.h from atombios_i2c.c
Rashika Kheria [Mon, 6 Jan 2014 15:46:34 +0000 (21:16 +0530)]
drivers: gpu: Move prototype declaration to header file radeon_mode.h from atombios_i2c.c

Move prototype declaration of function radeon_atom_copy_swap() to header
file drm/radeon/radeon_mode.h because it is used by more than one file.

This eliminates the following warnings in drm/radeon/atombios_dp.c:
drivers/gpu/drm/radeon/atombios_dp.c:53:6: warning: no previous prototype for ‘radeon_atom_copy_swap’ [-Wmissing-prototypes]

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 years agodrivers: gpu: Include appropriate header file in si_smc.c and remove prototype declar...
Rashika Kheria [Mon, 6 Jan 2014 16:30:45 +0000 (22:00 +0530)]
drivers: gpu: Include appropriate header file in si_smc.c and remove prototype declaration from header file sislands_smc.h

Include header file gpu/drm/radeon/sislands_smc.h in drm/radeon/si_smc.c
because it uses function declared in the header file.

Remove prototype declaration of function si_set_smc_sram_address() from
drm/radeon/sislands_smc.h because the function is used only in one file
where it is declared static already.

This eliminates the following warnings in drm/radeon/si_smc.c:
drivers/gpu/drm/radeon/si_smc.c:46:5: warning: no previous prototype for ‘si_copy_bytes_to_smc’ [-Wmissing-prototypes]
drivers/gpu/drm/radeon/si_smc.c:112:6: warning: no previous prototype for ‘si_start_smc’ [-Wmissing-prototypes]
drivers/gpu/drm/radeon/si_smc.c:121:6: warning: no previous prototype for ‘si_reset_smc’ [-Wmissing-prototypes]
drivers/gpu/drm/radeon/si_smc.c:135:5: warning: no previous prototype for ‘si_program_jump_on_start’ [-Wmissing-prototypes]
drivers/gpu/drm/radeon/si_smc.c:142:6: warning: no previous prototype for ‘si_stop_smc_clock’ [-Wmissing-prototypes]
drivers/gpu/drm/radeon/si_smc.c:151:6: warning: no previous prototype for ‘si_start_smc_clock’ [-Wmissing-prototypes]
drivers/gpu/drm/radeon/si_smc.c:160:6: warning: no previous prototype for ‘si_is_smc_running’ [-Wmissing-prototypes]
drivers/gpu/drm/radeon/si_smc.c:171:14: warning: no previous prototype for ‘si_send_msg_to_smc’ [-Wmissing-prototypes]
drivers/gpu/drm/radeon/si_smc.c:192:14: warning: no previous prototype for ‘si_wait_for_smc_inactive’ [-Wmissing-prototypes]
drivers/gpu/drm/radeon/si_smc.c:210:5: warning: no previous prototype for ‘si_load_smc_ucode’ [-Wmissing-prototypes]
drivers/gpu/drm/radeon/si_smc.c:269:5: warning: no previous prototype for ‘si_read_smc_sram_dword’ [-Wmissing-prototypes]
drivers/gpu/drm/radeon/si_smc.c:284:5: warning: no previous prototype for ‘si_write_smc_sram_dword’ [-Wmissing-prototypes]

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 years agodrivers: gpu: Add static keyword to the definition of KMS_INVALID_IOCTL in radeon_kms.c
Rashika Kheria [Mon, 6 Jan 2014 15:36:44 +0000 (21:06 +0530)]
drivers: gpu: Add static keyword to the definition of KMS_INVALID_IOCTL in radeon_kms.c

Add static keyword to the definition of KMS_INVALID_IOCTL(name) in
radeon_kms.c because the functions passed to it as arguments are not
used anywhere else.

This eliminates the following warnings in drm/radeon/radeon_kms.c:
drivers/gpu/drm/radeon/radeon_kms.c:719:1: warning: no previous prototype for ‘radeon_cp_init_kms’ [-Wmissing-prototypes]
drivers/gpu/drm/radeon/radeon_kms.c:720:1: warning: no previous prototype for ‘radeon_cp_start_kms’ [-Wmissing-prototypes]
drivers/gpu/drm/radeon/radeon_kms.c:721:1: warning: no previous prototype for ‘radeon_cp_stop_kms’ [-Wmissing-prototypes]
drivers/gpu/drm/radeon/radeon_kms.c:722:1: warning: no previous prototype for ‘radeon_cp_reset_kms’ [-Wmissing-prototypes]
drivers/gpu/drm/radeon/radeon_kms.c:723:1: warning: no previous prototype for ‘radeon_cp_idle_kms’ [-Wmissing-prototypes]
drivers/gpu/drm/radeon/radeon_kms.c:724:1: warning: no previous prototype for ‘radeon_cp_resume_kms’ [-Wmissing-prototypes]
drivers/gpu/drm/radeon/radeon_kms.c:725:1: warning: no previous prototype for ‘radeon_engine_reset_kms’ [-Wmissing-prototypes]
drivers/gpu/drm/radeon/radeon_kms.c:726:1: warning: no previous prototype for ‘radeon_fullscreen_kms’ [-Wmissing-prototypes]
drivers/gpu/drm/radeon/radeon_kms.c:727:1: warning: no previous prototype for ‘radeon_cp_swap_kms’ [-Wmissing-prototypes]
drivers/gpu/drm/radeon/radeon_kms.c:728:1: warning: no previous rototype for ‘radeon_cp_clear_kms’ [-Wmissing-prototypes]
drivers/gpu/drm/radeon/radeon_kms.c:729:1: warning: no previous prototype for ‘radeon_cp_vertex_kms’ [-Wmissing-prototypes]
drivers/gpu/drm/radeon/radeon_kms.c:730:1: warning: no previous rototype for ‘radeon_cp_indices_kms’ [-Wmissing-prototypes]
drivers/gpu/drm/radeon/radeon_kms.c:731:1: warning: no previous prototype for ‘radeon_cp_texture_kms’ [-Wmissing-prototypes]
drivers/gpu/drm/radeon/radeon_kms.c:732:1: warning: no previous prototype for ‘radeon_cp_stipple_kms’ [-Wmissing-prototypes]
drivers/gpu/drm/radeon/radeon_kms.c:733:1: warning: no previous prototype for ‘radeon_cp_indirect_kms’ [-Wmissing-prototypes]
drivers/gpu/drm/radeon/radeon_kms.c:734:1: warning: no previous prototype for ‘radeon_cp_vertex2_kms’ [-Wmissing-prototypes]
drivers/gpu/drm/radeon/radeon_kms.c:735:1: warning: no previous prototype for ‘radeon_cp_cmdbuf_kms’ [-Wmissing-prototypes]
drivers/gpu/drm/radeon/radeon_kms.c:736:1: warning: no previous prototype for ‘radeon_cp_getparam_kms’ [-Wmissing-prototypes]
drivers/gpu/drm/radeon/radeon_kms.c:737:1: warning: no previous prototype for ‘radeon_cp_flip_kms’ [-Wmissing-prototypes]
drivers/gpu/drm/radeon/radeon_kms.c:738:1: warning: no previous prototype for ‘radeon_mem_alloc_kms’ [-Wmissing-prototypes]
drivers/gpu/drm/radeon/radeon_kms.c:739:1: warning: no previous prototype for ‘radeon_mem_free_kms’ [-Wmissing-prototypes]
drivers/gpu/drm/radeon/radeon_kms.c:740:1: warning: no previous rototype for ‘radeon_mem_init_heap_kms’ [-Wmissing-prototypes]
drivers/gpu/drm/radeon/radeon_kms.c:741:1: warning: no previous rototype for ‘radeon_irq_emit_kms’ [-Wmissing-prototypes]
drivers/gpu/drm/radeon/radeon_kms.c:742:1: warning: no previous prototype for ‘radeon_irq_wait_kms’ [-Wmissing-prototypes]
drivers/gpu/drm/radeon/radeon_kms.c:743:1: warning: no previous rototype for ‘radeon_cp_setparam_kms’ [-Wmissing-prototypes]
drivers/gpu/drm/radeon/radeon_kms.c:744:1: warning: no previous prototype for ‘radeon_surface_alloc_kms’ [-Wmissing-prototypes]
drivers/gpu/drm/radeon/radeon_kms.c:745:1: warning: no previous prototype for ‘radeon_surface_free_kms’ [-Wmissing-prototypes]

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 years agodrivers: gpu: Mark function as static in r600_hdmi.c
Rashika Kheria [Mon, 6 Jan 2014 15:48:08 +0000 (21:18 +0530)]
drivers: gpu: Mark function as static in r600_hdmi.c

Mark function r600_audio_set_dto() as static in drm/radeon/r600_hdmi.c
because it is not used outside this file.

This eliminates the following warning in drm/radeon/r600_hdmi.c:
drivers/gpu/drm/radeon/r600_hdmi.c:253:6: warning: no previous prototype for ‘r600_audio_set_dto’ [-Wmissing-prototypes]

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 years agodrivers: gpu: Mark function as static in radeon_gem.c
Rashika Kheria [Mon, 6 Jan 2014 15:28:45 +0000 (20:58 +0530)]
drivers: gpu: Mark function as static in radeon_gem.c

Mark function radeon_gem_set_domain() as static in
drm/radeon/radeon_gem.c because it is not used outside this file.

This eliminates the following warning in drm/radeon/radeon_gem.c:
drivers/gpu/drm/radeon/radeon_gem.c:89:5: warning: no previous prototype for ‘radeon_gem_set_domain’ [-Wmissing-prototypes]

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 years agodrivers: gpu: Mark function as static in radeon_kms.c
Rashika Kheria [Mon, 6 Jan 2014 15:23:07 +0000 (20:53 +0530)]
drivers: gpu: Mark function as static in radeon_kms.c

Mark function radeon_info_ioctl() as static in drm/radeon/radeon_kms.c
because it is not used outside this file.

This eliminates the following warning in drm/radeon/radeon_kms.c:
drivers/gpu/drm/radeon/radeon_kms.c:194:5: warning: no previous prototype for ‘radeon_info_ioctl’ [-Wmissing-prototypes]

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 years agodrivers: gpu: Mark functions as static in radeon_device.c
Rashika Kheria [Mon, 6 Jan 2014 15:21:40 +0000 (20:51 +0530)]
drivers: gpu: Mark functions as static in radeon_device.c

Mark functions radeon_doorbell_init() and radeon_doorbell_fini() as
static in drm/radeon/radeon_device.c because they are not used outside
this file.

This eliminates the following warning in drm/radeon/radeon_device.c:
drivers/gpu/drm/radeon/radeon_device.c:252:5: warning: no previous prototype for ‘radeon_doorbell_init’ [-Wmissing-prototypes]
drivers/gpu/drm/radeon/radeon_device.c:281:6: warning: no previous prototype for ‘radeon_doorbell_fini’ [-Wmissing-prototypes]

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 years agodrivers: gpu: Mark function as static in radeon_object.c
Rashika Kheria [Mon, 6 Jan 2014 15:25:28 +0000 (20:55 +0530)]
drivers: gpu: Mark function as static in radeon_object.c

Mark function radeon_bo_clear_va() as static in
drm/radeon/radeon_object.c because it is not used outside this file.

This eliminates the following warning in drm/radeon/radeon_object.c:
drivers/gpu/drm/radeon/radeon_object.c:49:6: warning: no previous prototype for ‘radeon_bo_clear_va’ [-Wmissing-prototypes]

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 years agodrm/radeon: warn users when hw_i2c is enabled (v2)
Alex Deucher [Tue, 7 Jan 2014 15:05:02 +0000 (10:05 -0500)]
drm/radeon: warn users when hw_i2c is enabled (v2)

The hw i2c engines are disabled by default as the
current implementation is still experimental.  Print
a warning when users enable it so that it's obvious
when the option is enabled.

v2: check for non-0 rather than 1

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Cc: stable@vger.kernel.org
10 years agodrm/exynos: fix build error caused by removed drm core macros
Seung-Woo Kim [Mon, 30 Dec 2013 07:01:29 +0000 (16:01 +0900)]
drm/exynos: fix build error caused by removed drm core macros

DRM_HZ and DRM_WAKEUP macros are removed, but they still remained.
So this patch fixes build errors by replacing the macros.

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
10 years agodrm/exynos: use a new anon file for exynos gem mmaper
Inki Dae [Fri, 20 Dec 2013 10:16:24 +0000 (19:16 +0900)]
drm/exynos: use a new anon file for exynos gem mmaper

This patch resolves potential deadlock issue that can be incurred
by changing file->f_op and filp->private_data to exynos specific
mapper ops and gem object temporarily.

To resolve this issue, this patch creates a new anon file dedicated
to exynos specific mmaper, and making it used instead of existing one.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
10 years agodrm/radeon: fix pptable.h portability
Alex Deucher [Thu, 2 Jan 2014 22:55:35 +0000 (17:55 -0500)]
drm/radeon: fix pptable.h portability

The following isn't compatible with gcc 2.x:

pragma pack(push, 1)
...
pragma pack(pop)

replace with:

pragma pack(1)
...
pragma pack()

bug:
https://bugzilla.kernel.org/show_bug.cgi?id=67961

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 years agodrm/radeon: remove generic rptr/wptr functions (v2)
Alex Deucher [Tue, 10 Dec 2013 00:44:30 +0000 (19:44 -0500)]
drm/radeon: remove generic rptr/wptr functions (v2)

Fill in asic family specific versions rather than
using the generic version.  This lets us handle asic
specific differences more easily.  In this case, we
disable sw swapping of the rtpr writeback value on
r6xx+ since the hw does it for us.  Fixes bogus
rptr readback on BE systems.

v2: remove missed cpu_to_le32(), add comments

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 years agodrm/radeon: enable dpm by default on CI APUs
Alex Deucher [Thu, 19 Dec 2013 22:39:17 +0000 (17:39 -0500)]
drm/radeon: enable dpm by default on CI APUs

Dynamic power mangement works reliably now, so
enable it by default.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 years agodrm/radeon: enable dpm by default on CI dGPUs
Alex Deucher [Thu, 19 Dec 2013 22:37:33 +0000 (17:37 -0500)]
drm/radeon: enable dpm by default on CI dGPUs

Dynamic power mangement works reliably now, so
enable it by default.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 years agodrm/radeon: enable gfx cgcg on CIK APUs
Alex Deucher [Thu, 19 Dec 2013 14:15:24 +0000 (09:15 -0500)]
drm/radeon: enable gfx cgcg on CIK APUs

Enable coarse grained clockgating.  This works properly now
that smc is initialized earlier than the rlc and cp.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 years agodrm/radeon: enable gfx cgcg on CIK dGPUs
Alex Deucher [Thu, 19 Dec 2013 14:13:30 +0000 (09:13 -0500)]
drm/radeon: enable gfx cgcg on CIK dGPUs

Enable coarse grained clockgating on CIK dGPUs.  This
works properly now that smc is initialized earlier than
the rlc and cp.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 years agodrm/radeon/pm: move pm handling into the asic specific code
Alex Deucher [Wed, 18 Dec 2013 19:07:14 +0000 (14:07 -0500)]
drm/radeon/pm: move pm handling into the asic specific code

We need more control over the ordering of dpm init with
respect to the rest of the asic.  Specifically, the SMC
has to be initialized before the rlc and cg/pg.  The pm
code currently initializes late in the driver, but we need
it to happen much earlier so move pm handling into the asic
specific callbacks.

This makes dpm more reliable and makes clockgating work
properly on CIK parts and should help on SI parts as well.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 years agodrm/radeon/dpm: switch on new late_enable callback
Alex Deucher [Thu, 19 Dec 2013 21:17:47 +0000 (16:17 -0500)]
drm/radeon/dpm: switch on new late_enable callback

Right now it's called right after enable, but after
reworking the dpm init order, it will get called later
to accomodate loading the smc early, but enabling
thermal interrupts and block powergating later after
the ring tests are complete.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 years agodrm/radeon/dpm: add late_enable for KB/KV
Alex Deucher [Thu, 19 Dec 2013 19:03:36 +0000 (14:03 -0500)]
drm/radeon/dpm: add late_enable for KB/KV

Make sure interrupts are enabled
before we enable thermal interrupts.
Also, don't powergate uvd, etc. until after
the ring tests.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 years agodrm/radeon/dpm: add late_enable for CI
Alex Deucher [Thu, 19 Dec 2013 18:59:46 +0000 (13:59 -0500)]
drm/radeon/dpm: add late_enable for CI

Make sure interrupts are enabled
before we enable thermal interrupts.
Also, don't powergate uvd until after
the ring tests.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 years agodrm/radeon/dpm: add late_enable for SI
Alex Deucher [Thu, 19 Dec 2013 18:54:35 +0000 (13:54 -0500)]
drm/radeon/dpm: add late_enable for SI

Make sure interrupts are enabled
before we enable thermal interrupts.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 years agodrm/radeon/dpm: add late_enable for trinity
Alex Deucher [Thu, 19 Dec 2013 17:03:35 +0000 (12:03 -0500)]
drm/radeon/dpm: add late_enable for trinity

Need to wait to enable cg and pg until after
ring tests. Also make sure interrupts are enabled
before we enable thermal interrupts.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 years agodrm/radeon/dpm: add late_enable for sumo
Alex Deucher [Thu, 19 Dec 2013 16:56:52 +0000 (11:56 -0500)]
drm/radeon/dpm: add late_enable for sumo

Need to wait to enable cg and pg until after
ring tests. Also make sure interrupts are enabled
before we enable thermal interrupts.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 years agodrm/radeon/dpm: add late_enable for rv7xx-NI
Alex Deucher [Thu, 19 Dec 2013 18:48:36 +0000 (13:48 -0500)]
drm/radeon/dpm: add late_enable for rv7xx-NI

Make sure interrupts are enabled
before we enable thermal interrupts.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 years agodrm/radeon/dpm: add late_enable for rs780/rs880/rv6xx
Alex Deucher [Thu, 19 Dec 2013 17:18:13 +0000 (12:18 -0500)]
drm/radeon/dpm: add late_enable for rs780/rs880/rv6xx

Make sure interrupts are enabled before we enable
thermal interrupts.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 years agodrm/radeon/dpm: add a late enable callback
Alex Deucher [Thu, 19 Dec 2013 16:37:22 +0000 (11:37 -0500)]
drm/radeon/dpm: add a late enable callback

Certain features need to be enabled after ring tests
(e.g., powergating, etc.).  Add a function pointer
to split out late enable features.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 years agodrm/radeon: re-order firmware loading in preparation for dpm rework
Alex Deucher [Thu, 19 Dec 2013 00:11:27 +0000 (19:11 -0500)]
drm/radeon: re-order firmware loading in preparation for dpm rework

We need to reorder the driver init sequence to better accomodate
dpm which needs to be loaded earlier in the init sequence.  Move
fw init up so that it's available for dpm init.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 years agodrm/radeon/cik: drop cg_update from dpm code
Alex Deucher [Wed, 18 Dec 2013 19:16:50 +0000 (14:16 -0500)]
drm/radeon/cik: drop cg_update from dpm code

I'm not entirely sure this is required and it won't work
with the dpm restructing anyway.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 years agodrm/radeon/si: drop cg_update from dpm code
Alex Deucher [Wed, 18 Dec 2013 19:11:40 +0000 (14:11 -0500)]
drm/radeon/si: drop cg_update from dpm code

I'm not entirely sure this is required and it won't work
with the dpm restructing anyway.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 years agodrm/radeon/dpm: remove unnecessary checks in dpm_init
Alex Deucher [Wed, 18 Dec 2013 18:39:58 +0000 (13:39 -0500)]
drm/radeon/dpm: remove unnecessary checks in dpm_init

No need to check rdev->pm.num_power_states; this is a vestige
of the old pm code.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 years agodrm/radeon: add GART debugfs access v3
Christian König [Wed, 18 Dec 2013 20:07:40 +0000 (21:07 +0100)]
drm/radeon: add GART debugfs access v3

v2: add default_llseek
v3: set inode size in the open callback

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 years agodrm/radeon: add VRAM debugfs access v3
Christian König [Wed, 18 Dec 2013 20:07:39 +0000 (21:07 +0100)]
drm/radeon: add VRAM debugfs access v3

Not very fast, but makes it possible to access even the
normally inaccessible parts of VRAM from userspace.

v2: use MM_INDEX_HI for >2GB mem access, add default_llseek
v3: set inode size in the open callback

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 years agodrm/radeon: cleanup radeon_ttm debugfs handling
Christian König [Thu, 12 Dec 2013 08:42:40 +0000 (09:42 +0100)]
drm/radeon: cleanup radeon_ttm debugfs handling

Otherwise we not necessary export the right information.

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 years agodrm/radeon: update fence values in before reporting them
Christian König [Thu, 12 Dec 2013 08:42:39 +0000 (09:42 +0100)]
drm/radeon: update fence values in before reporting them

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 years agodrm/radeon: report the real offset in radeon_sa_bo_dump_debug_info
Christian König [Thu, 12 Dec 2013 08:42:38 +0000 (09:42 +0100)]
drm/radeon: report the real offset in radeon_sa_bo_dump_debug_info

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 years agodrm/radeon: improve ring debugfs a bit
Christian König [Thu, 12 Dec 2013 08:42:37 +0000 (09:42 +0100)]
drm/radeon: improve ring debugfs a bit

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 years agodrm/bochs: new driver
Gerd Hoffmann [Tue, 17 Dec 2013 17:04:46 +0000 (18:04 +0100)]
drm/bochs: new driver

DRM driver for (virtual) vga cards using the bochs dispi
interface, such as the qemu standard vga (qemu -vga std).

Don't bother supporting anything but 32bpp for now, even
though the virtual hardware is able to do that.

Known issue: mmap(/dev/fb0) doesn't work.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
10 years agoMerge tag 'drm-intel-next-2013-12-13' of git://people.freedesktop.org/~danvet/drm...
Dave Airlie [Mon, 23 Dec 2013 00:46:07 +0000 (10:46 +1000)]
Merge tag 'drm-intel-next-2013-12-13' of git://people.freedesktop.org/~danvet/drm-intel into drm-next

- fbc1 improvements from Ville (pre-gm45).
- vlv forcewake improvements from Deepak S.
- Some corner-cases fixes from Mika for the context hang stat code.
- pc8 improvements and prep work for runtime D3 from Paulo, almost ready for
  primetime.
- gen2 dpll fixes from Ville.
- DSI improvements from Shobhit Kumar.
- A few smaller fixes and improvements all over.

[airlied: intel_ddi.c conflict fixed up]

* tag 'drm-intel-next-2013-12-13' of git://people.freedesktop.org/~danvet/drm-intel: (61 commits)
  drm/i915/bdw: Implement ff workarounds
  drm/i915/bdw: Force all Data Cache Data Port access to be Non-Coherent
  drm/i915/bdw: Don't use forcewake needlessly
  drm/i915: Clear out old GT FIFO errors in intel_uncore_early_sanitize()
  drm/i915: dont call irq_put when irq test is on
  drm/i915: Rework the FBC interval/stall stuff a bit
  drm/i915: Enable FBC for all mobile gen2 and gen3 platforms
  drm/i915: FBC_CONTROL2 is gen4 only
  drm/i915: Gen2 FBC1 CFB pitch wants 32B units
  drm/i915: split intel_ddi_pll_mode_set in 2 pieces
  drm/i915: Fix timeout with missed interrupts in __wait_seqno
  drm/i915: touch VGA MSR after we enable the power well
  drm/i915: extract hsw_power_well_post_{enable, disable}
  drm/i915: remove i915_disable_vga_mem declaration
  drm/i915: Parametrize the dphy and other spec specific parameters
  drm/i915: Remove redundant DSI PLL enabling
  drm/i915: Reorganize the DSI enable/disable sequence
  drm/i915: Try harder to get best m, n, p values with minimal error
  drm/i915: Compute dsi_clk from pixel clock
  drm/i915: Use FLISDSI interface for band gap reset
  ...

Conflicts:
drivers/gpu/drm/i915/intel_ddi.c

10 years agoMerge tag 'drm/for-3.14-rc1' of git://anongit.freedesktop.org/tegra/linux into drm...
Dave Airlie [Mon, 23 Dec 2013 00:43:42 +0000 (10:43 +1000)]
Merge tag 'drm/for-3.14-rc1' of git://anongit.freedesktop.org/tegra/linux into drm-next

drm/tegra: Changes for v3.14-rc1

This series of changes brings DRM panel support as well as initial code
to register DSI hosts and peripherals and bind them to DSI drivers. The
panel and DSI code are both used by the simple panel driver.

The Tegra-specific changes build on top of this work to add support for
various panels found on Tegra boards. New drivers enable the DSI host
found on Tegra114 and a special hardware block that calibrates the pads
used for DSI and CSI. The host1x and the display controller drivers gain
basic Tegra124 support. To round of the new features, the DRM driver now
sports a very simple PRIME implementation.

In addition there are various improvements such as the host1x API being
exported so that client drivers (like the Tegra DRM driver) can be built
as modules. HDMI now does better power management and legacy FBDEV can
now be disabled via Kconfig (though it's still enabled by default). A
few sparse warnings have been squashed and various parts of the code
have become more robust.

* tag 'drm/for-3.14-rc1' of git://anongit.freedesktop.org/tegra/linux: (121 commits)
  drm/tegra: fix compile w/ CONFIG_DYNAMIC_DEBUG
  drm/tegra: Add PRIME support
  drm/tegra: Relocate some output-specific code
  drm/tegra: Add Tegra124 DC support
  drm/tegra: Fix small leak on error in tegra_fb_alloc()
  drm/tegra: Make legacy fbdev support optional
  drm/tegra: Sort reverse-dependencies alphabetically
  drm/tegra: Fix return value check
  drm/tegra: Add DSI support
  drm/tegra: Disable outputs for power-saving
  drm/tegra: Track HDMI enable state
  drm/tegra: Fix HDMI audio frequency typo
  drm/tegra: Do not export tegra_bo_ops
  drm/tegra: Remove spurious blank line
  drm/tegra: Increase compile test coverage
  drm/tegra: Allow the driver to be built as a module
  gpu: host1x: Add Tegra124 support
  gpu: host1x: clk_round_rate() can return a zero upon error
  gpu: host1x: Fix build warnings
  gpu: host1x: Increase compile test coverage
  ...

10 years agoMerge branch 'drm/next/du' of git://linuxtv.org/pinchartl/fbdev into drm-next
Dave Airlie [Mon, 23 Dec 2013 00:42:36 +0000 (10:42 +1000)]
Merge branch 'drm/next/du' of git://linuxtv.org/pinchartl/fbdev into drm-next

rcar misc changes.

* 'drm/next/du' of git://linuxtv.org/pinchartl/fbdev:
  drm/rcar-du: Add support for the r8a7791 DU
  drm/rcar-du: Add LVDS_LANES quirk
  drm/rcar-du: Split features and quirks
  drm/rcar-du: Update plane pitch in .mode_set_base() operation
  drm/rcar-du: Don't cast crtc to rcrtc twice in the same function
  drm/rcar-du: fix return value check in rcar_du_lvdsenc_get_resources()

10 years agodrm/tegra: fix compile w/ CONFIG_DYNAMIC_DEBUG
Stephen Warren [Wed, 18 Dec 2013 20:53:33 +0000 (13:53 -0700)]
drm/tegra: fix compile w/ CONFIG_DYNAMIC_DEBUG

With CONFIG_DYNAMIC_DEBUG=y, the following compile error occurs:

drivers/gpu/drm/tegra/mipi-phy.c: In function ‘mipi_dphy_timing_validate’:
drivers/gpu/drm/tegra/mipi-phy.c:69:11: error: ‘EINVAL’ undeclared (first use in this function)
drivers/gpu/drm/tegra/mipi-phy.c:69:11: note: each undeclared identifier is reported only once for each function it appears in

Fix this by directly including the header that defines EINVAL.

Fixes: dec727399a4b ("drm/tegra: Add DSI support")
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
10 years agodrm/tegra: Add PRIME support
Thierry Reding [Thu, 12 Dec 2013 09:00:43 +0000 (10:00 +0100)]
drm/tegra: Add PRIME support

Implement very basic PRIME support. This currently only works with
buffers that are contiguous in memory and will refuse to import any
physically non-contiguous buffers.

Signed-off-by: Thierry Reding <treding@nvidia.com>
10 years agodrm/tegra: Relocate some output-specific code
Thierry Reding [Thu, 12 Dec 2013 10:06:55 +0000 (11:06 +0100)]
drm/tegra: Relocate some output-specific code

Some of the code in the CRTC's mode setting code is specific to the RGB
output or needs to be called slightly differently depending on the type
of output. Push that code down into the output drivers.

Signed-off-by: Thierry Reding <treding@nvidia.com>
10 years agodrm/tegra: Add Tegra124 DC support
Thierry Reding [Thu, 12 Dec 2013 10:03:59 +0000 (11:03 +0100)]
drm/tegra: Add Tegra124 DC support

Tegra124 and later support interlacing, but the driver doesn't support
it yet. Make sure interlacing stays disabled on hardware that supports
it.

Signed-off-by: Thierry Reding <treding@nvidia.com>
10 years agodrm/tegra: Fix small leak on error in tegra_fb_alloc()
Dan Carpenter [Tue, 12 Nov 2013 10:25:26 +0000 (13:25 +0300)]
drm/tegra: Fix small leak on error in tegra_fb_alloc()

If we don't have enough memory for ->planes then we leak "fb".

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
10 years agodrm/tegra: Make legacy fbdev support optional
Thierry Reding [Thu, 31 Oct 2013 12:28:50 +0000 (13:28 +0100)]
drm/tegra: Make legacy fbdev support optional

A lot of the modern userspace is capable of working without the legacy
fbdev support. kmscon can be used as a replacement for the framebuffer
console, and KMS X drivers create their own framebuffers.

Most people don't have a system where all of this works yet, though, so
leave support enabled by default.

Signed-off-by: Thierry Reding <treding@nvidia.com>
10 years agodrm/tegra: Sort reverse-dependencies alphabetically
Thierry Reding [Fri, 8 Nov 2013 10:56:59 +0000 (11:56 +0100)]
drm/tegra: Sort reverse-dependencies alphabetically

Move the TEGRA_HOST1X and DRM_KMS_HELPER entries around to keep the list
sorted.

Signed-off-by: Thierry Reding <treding@nvidia.com>
10 years agodrm/tegra: Fix return value check
Wei Yongjun [Mon, 21 Oct 2013 03:34:07 +0000 (11:34 +0800)]
drm/tegra: Fix return value check

In case of error, the devm_ioremap_resource() function returns ERR_PTR()
and never NULL. The NULL test in the return value check should therefore
be replaced with IS_ERR().

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Thierry Reding <treding@nvidia.com>
10 years agodrm/tegra: Add DSI support
Thierry Reding [Tue, 3 Sep 2013 06:45:46 +0000 (08:45 +0200)]
drm/tegra: Add DSI support

This commit adds support for both DSI outputs found on Tegra. Only very
minimal functionality is implemented, so advanced features like ganged
mode won't work.

Due to the lack of other test hardware, some sections of the driver are
hardcoded to work with Dalmore.

Signed-off-by: Thierry Reding <treding@nvidia.com>
10 years agodrm/tegra: Disable outputs for power-saving
Thierry Reding [Tue, 29 Oct 2013 15:03:03 +0000 (16:03 +0100)]
drm/tegra: Disable outputs for power-saving

When an output is disabled, its DPMS mode is usually set to off. Instead
of only disabling the panel (if one is attached), turn the output off
entirely to save more power.

HDMI doesn't have any panels attached, so it previously didn't save any
power at all. With this commit, however, the complete HDMI interface
will be turned off, therefore allowing an attached monitor to go into a
standby mode.

Signed-off-by: Thierry Reding <treding@nvidia.com>
10 years agodrm/tegra: Track HDMI enable state
Thierry Reding [Tue, 29 Oct 2013 15:00:42 +0000 (16:00 +0100)]
drm/tegra: Track HDMI enable state

The DRM core doesn't track enable and disable state of encoders and/or
connectors, so calls to the output's .enable() and .disable() are not
guaranteed to be balanced. Track the enable state internally so that
calls to regulator and clock frameworks remain balanced.

Signed-off-by: Thierry Reding <treding@nvidia.com>
10 years agodrm/tegra: Fix HDMI audio frequency typo
Thierry Reding [Mon, 16 Dec 2013 09:01:24 +0000 (10:01 +0100)]
drm/tegra: Fix HDMI audio frequency typo

The correct check is for 48 kHz, not 480 kHz. Found by Coverity.

Signed-off-by: Thierry Reding <treding@nvidia.com>
10 years agodrm/tegra: Do not export tegra_bo_ops
Thierry Reding [Thu, 12 Dec 2013 09:10:46 +0000 (10:10 +0100)]
drm/tegra: Do not export tegra_bo_ops

These buffer object operations are never used outside of the GEM
implementation so there is no use in exporting them.

Signed-off-by: Thierry Reding <treding@nvidia.com>
10 years agodrm/tegra: Remove spurious blank line
Thierry Reding [Thu, 12 Dec 2013 09:09:46 +0000 (10:09 +0100)]
drm/tegra: Remove spurious blank line

Signed-off-by: Thierry Reding <treding@nvidia.com>
10 years agodrm/tegra: Increase compile test coverage
Thierry Reding [Wed, 20 Nov 2013 19:39:35 +0000 (20:39 +0100)]
drm/tegra: Increase compile test coverage

The ARCH_MULTIPLATFORM dependency was introduced back when Tegra didn't
support multiplatform yet as a means to allow the driver to be easily
compile-tested along with other DRM drivers. In the meantime, the new
COMPILE_TEST Kconfig option has been introduced for exactly that
purpose, so use that instead to clarify the intention.

Signed-off-by: Thierry Reding <treding@nvidia.com>
10 years agodrm/tegra: Allow the driver to be built as a module
Thierry Reding [Fri, 8 Nov 2013 10:43:15 +0000 (11:43 +0100)]
drm/tegra: Allow the driver to be built as a module

All APIs that the driver uses are exported, so the driver can now be
built as a module.

Signed-off-by: Thierry Reding <treding@nvidia.com>
10 years agogpu: host1x: Add Tegra124 support
Thierry Reding [Fri, 15 Nov 2013 13:58:05 +0000 (14:58 +0100)]
gpu: host1x: Add Tegra124 support

Tegra124 has 192 syncpoints whereas its predecessors had 32 syncpoints.
This required changes to the hardware register layout.

Signed-off-by: Arto Merilainen <amerilainen@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
10 years agogpu: host1x: clk_round_rate() can return a zero upon error
Paul Walmsley [Tue, 10 Dec 2013 02:00:12 +0000 (18:00 -0800)]
gpu: host1x: clk_round_rate() can return a zero upon error

Treat both negative and zero return values from clk_round_rate() as
errors.  This is needed since subsequent patches will convert
clk_round_rate()'s return value to be an unsigned type, rather than a
signed type, since some clock sources can generate rates higher than
(2^31)-1 Hz.

Eventually, when calling clk_round_rate(), only a return value of zero
will be considered a error.  All other values will be considered valid
rates.  The comparison against values less than 0 is kept to preserve
the correct behavior in the meantime.

Signed-off-by: Paul Walmsley <pwalmsley@nvidia.com>
Cc: Mikko Perttunen <mperttunen@nvidia.com>
Cc: Arto Merilainen <amerilainen@nvidia.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Terje Bergström <tbergstrom@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
10 years agogpu: host1x: Fix build warnings
Thierry Reding [Tue, 3 Dec 2013 10:44:48 +0000 (11:44 +0100)]
gpu: host1x: Fix build warnings

When debugfs support isn't enabled, gcc complains about some variables
being unused. To avoid further #ifdefery, move debugfs specific setup
code into static functions and use IS_ENABLED(CONFIG_DEBUG_FS) to have
the compiler, rather than the preprocessor, discard them when unused.
The advantage of doing it this way is that all the code will be
compile-tested whether or not debugfs support is enabled.

Signed-off-by: Thierry Reding <treding@nvidia.com>
10 years agogpu: host1x: Increase compile test coverage
Thierry Reding [Wed, 20 Nov 2013 19:58:36 +0000 (20:58 +0100)]
gpu: host1x: Increase compile test coverage

The ARCH_MULTIPLATFORM dependency was introduced back when Tegra didn't
support multiplatform yet as a means to allow the driver to be easily
compile-tested along with other DRM drivers. In the meantime, the new
COMPILE_TEST Kconfig option has been introduced for exactly that
purpose, so use that instead to clarify the intention.

Signed-off-by: Thierry Reding <treding@nvidia.com>
10 years agogpu: host1x: Fix more sparse warnings
Thierry Reding [Fri, 8 Nov 2013 12:28:34 +0000 (13:28 +0100)]
gpu: host1x: Fix more sparse warnings

Include the linux/host1x.h and dev.h headers so that function prototypes
are visible to keep sparse from suggesting that their implementations be
made static.

Signed-off-by: Thierry Reding <treding@nvidia.com>
10 years agogpu: host1x: Use the correct HW headers for host1x02
Thierry Reding [Fri, 8 Nov 2013 12:24:28 +0000 (13:24 +0100)]
gpu: host1x: Use the correct HW headers for host1x02

An earlier patch added a subset of the required HW specific header files
but didn't actually include the right ones when compiling for host1x02.

Signed-off-by: Thierry Reding <treding@nvidia.com>
10 years agogpu: host1x: Export public API
Thierry Reding [Fri, 8 Nov 2013 10:41:42 +0000 (11:41 +0100)]
gpu: host1x: Export public API

Make the public API symbols visible so that depending drivers can be
built as a module.

Signed-off-by: Thierry Reding <treding@nvidia.com>
10 years agogpu: host1x: Add MIPI pad calibration support
Thierry Reding [Mon, 2 Sep 2013 07:48:53 +0000 (09:48 +0200)]
gpu: host1x: Add MIPI pad calibration support

This driver adds support to perform calibration of the MIPI pads for CSI
and DSI.

Signed-off-by: Thierry Reding <treding@nvidia.com>
10 years agodrm/dp: Clarify automated test constant and add constant for FAUX test pattern
Todd Previte [Fri, 4 Oct 2013 19:59:03 +0000 (12:59 -0700)]
drm/dp: Clarify automated test constant and add constant for FAUX test pattern

  - DP_TEST_LINK_PATTERN is ambiguous, rename to DP_TEST_LINK_VIDEO_PATTERN to clarify
  - Added DP_TEST_LINK_FAUX_PATTERN to support automated testing of Fast AUX

Signed-off-by: Todd Previte <tprevite@gmail.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
10 years agodrm: use memdup_user() as a cleanup
Dan Carpenter [Wed, 11 Dec 2013 10:35:11 +0000 (11:35 +0100)]
drm: use memdup_user() as a cleanup

drivers/gpu/drm/r128/r128_state.c:1014:10-17: WARNING opportunity for memdup_user
/c/kernel-tests/src/cocci/drivers/gpu/drm/r128/r128_state.c:1029:9-16: WARNING opportunity for memdup_user
/c/kernel-tests/src/cocci/drivers/gpu/drm/r128/r128_state.c:904:10-17: WARNING opportunity for memdup_user
/c/kernel-tests/src/cocci/drivers/gpu/drm/r128/r128_state.c:914:9-16: WARNING opportunity for memdup_user

 Use memdup_user rather than duplicating its implementation
 This is a little bit restricted to reduce false positives

Generated by: coccinelle/api/memdup_user.cocci

CC: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
10 years agodrm: remove dev->vma_count
Daniel Vetter [Wed, 11 Dec 2013 10:35:10 +0000 (11:35 +0100)]
drm: remove dev->vma_count

This is just used for a debugfs file, and we can easily reconstruct
this number by just walking the list twice. Which isn't really bad for
a debugfs file anyway.

So let's rip this out.

There's the other issue that the dev->vmalist itself is a bit useless,
since that can be reconstructed with all the memory mapping
information from proc. But remove that is a different topic entirely.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>