openwrt/staging/blogic.git
12 years agodrm/radeon/kms: update duallink checks for DCE6
Alex Deucher [Tue, 20 Mar 2012 21:18:42 +0000 (17:18 -0400)]
drm/radeon/kms: update duallink checks for DCE6

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: add trinity pci ids
Alex Deucher [Tue, 20 Mar 2012 21:18:41 +0000 (17:18 -0400)]
drm/radeon/kms: add trinity pci ids

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: add radeon_asic struct for trinity
Alex Deucher [Tue, 20 Mar 2012 21:18:40 +0000 (17:18 -0400)]
drm/radeon/kms: add radeon_asic struct for trinity

Trinity (TN) is an APU with:
- Cayman 3D
- DCE6.1 display

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: add support for ucode loading on trinity (v2)
Alex Deucher [Tue, 20 Mar 2012 21:18:39 +0000 (17:18 -0400)]
drm/radeon/kms: add support for ucode loading on trinity (v2)

v2: fix check for MC ucode from Tom.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms/vm: set vram base offset properly for TN
Alex Deucher [Tue, 20 Mar 2012 21:18:38 +0000 (17:18 -0400)]
drm/radeon/kms/vm: set vram base offset properly for TN

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: Update evergreen functions for trinity
Alex Deucher [Tue, 20 Mar 2012 21:18:37 +0000 (17:18 -0400)]
drm/radeon/kms: Update evergreen functions for trinity

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: cayman gpu init updates for trinity
Alex Deucher [Tue, 20 Mar 2012 21:18:36 +0000 (17:18 -0400)]
drm/radeon/kms: cayman gpu init updates for trinity

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: Add checks for TN in the DP bridge code
Alex Deucher [Tue, 20 Mar 2012 21:18:35 +0000 (17:18 -0400)]
drm/radeon/kms: Add checks for TN in the DP bridge code

TN (trinity) uses DP bridges for LVDS and VGA just like llano.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms/DCE6.1: ss is not supported on the internal pplls
Alex Deucher [Tue, 20 Mar 2012 21:18:34 +0000 (17:18 -0400)]
drm/radeon/kms/DCE6.1: ss is not supported on the internal pplls

It's handled via external clock. It should already be protected
by the external ss flag, but add an explicit check just in case.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: disable PPLL0 on DCE6.1 when not in use
Alex Deucher [Tue, 20 Mar 2012 21:18:33 +0000 (17:18 -0400)]
drm/radeon/kms: disable PPLL0 on DCE6.1 when not in use

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: Adjust pll picker for DCE6.1
Alex Deucher [Tue, 20 Mar 2012 21:18:32 +0000 (17:18 -0400)]
drm/radeon/kms: Adjust pll picker for DCE6.1

On TN, UNIPHYA always uses PPLL2, UNIPHYB/C/D/E/F
can use either PPLL1 or PPLL0.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: DCE6.1 disp eng pll updates
Alex Deucher [Tue, 20 Mar 2012 21:18:31 +0000 (17:18 -0400)]
drm/radeon/kms: DCE6.1 disp eng pll updates

DCE6.1 uses EXT_PLL1 for disp eng.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: DCE6.1 watermark updates for TN
Alex Deucher [Tue, 20 Mar 2012 21:18:30 +0000 (17:18 -0400)]
drm/radeon/kms: DCE6.1 watermark updates for TN

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: no support for internal thermal sensor on TN yet
Alex Deucher [Tue, 20 Mar 2012 21:18:29 +0000 (17:18 -0400)]
drm/radeon/kms: no support for internal thermal sensor on TN yet

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: add trinity (TN) chip family
Alex Deucher [Tue, 20 Mar 2012 21:18:28 +0000 (17:18 -0400)]
drm/radeon/kms: add trinity (TN) chip family

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: Add SI pci ids
Alex Deucher [Tue, 20 Mar 2012 21:18:27 +0000 (17:18 -0400)]
drm/radeon/kms: Add SI pci ids

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon: Update radeon_info_ioctl for SI. (v2)
Michel Dänzer [Tue, 20 Mar 2012 21:18:26 +0000 (17:18 -0400)]
drm/radeon: Update radeon_info_ioctl for SI. (v2)

v2: agd5f: add new MAX_PIPES param

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: add radeon_asic struct for SI
Alex Deucher [Tue, 20 Mar 2012 21:18:25 +0000 (17:18 -0400)]
drm/radeon/kms: add radeon_asic struct for SI

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: add support for compute rings in CS ioctl on SI
Alex Deucher [Tue, 20 Mar 2012 21:18:24 +0000 (17:18 -0400)]
drm/radeon/kms: add support for compute rings in CS ioctl on SI

Very basic implementation for picking the ring priority.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: fill in startup/shutdown callbacks for SI
Alex Deucher [Tue, 20 Mar 2012 21:18:23 +0000 (17:18 -0400)]
drm/radeon/kms: fill in startup/shutdown callbacks for SI

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: add support for interrupts on SI
Alex Deucher [Tue, 20 Mar 2012 21:18:22 +0000 (17:18 -0400)]
drm/radeon/kms: add support for interrupts on SI

This is mostly identical to evergreen/ni, however
there are some additional fields in the IV vector
for RINGID and VMID.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: Add support for RLC init on SI
Alex Deucher [Tue, 20 Mar 2012 21:18:21 +0000 (17:18 -0400)]
drm/radeon/kms: Add support for RLC init on SI

RLC handles the interrupt controller and other tasks
on the GPU.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: add IB and fence dispatch functions for SI
Alex Deucher [Tue, 20 Mar 2012 21:18:20 +0000 (17:18 -0400)]
drm/radeon/kms: add IB and fence dispatch functions for SI

Support both IBs (DE) and CONST IBs (CE).

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: add support for CP setup on SI
Alex Deucher [Tue, 20 Mar 2012 21:18:19 +0000 (17:18 -0400)]
drm/radeon/kms: add support for CP setup on SI

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: add support for MC ucode loading on SI
Alex Deucher [Tue, 20 Mar 2012 21:18:18 +0000 (17:18 -0400)]
drm/radeon/kms: add support for MC ucode loading on SI

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: add ucode loading for SI
Alex Deucher [Tue, 20 Mar 2012 21:18:17 +0000 (17:18 -0400)]
drm/radeon/kms: add ucode loading for SI

Currently the driver required 5 sets of ucode:
1. pfp - pre-fetch parser, part of the CP
2. me - micro engine, part of the CP
3. ce - constant engine, part of the CP
4. rlc - interrupt controller
5. mc - memory controller

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: Only VM CS ioctl is supported on SI (v2)
Alex Deucher [Tue, 20 Mar 2012 21:18:16 +0000 (17:18 -0400)]
drm/radeon/kms: Only VM CS ioctl is supported on SI (v2)

v2: avoid double free.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: add VM CS checker for SI
Alex Deucher [Tue, 20 Mar 2012 21:18:15 +0000 (17:18 -0400)]
drm/radeon/kms: add VM CS checker for SI

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: add support for the CONST IB to the CS ioctl
Alex Deucher [Tue, 20 Mar 2012 21:18:14 +0000 (17:18 -0400)]
drm/radeon/kms: add support for the CONST IB to the CS ioctl

This adds a new chunk id to the CS ioctl to support the
INDIRECT_BUFFER_CONST packet.

On SI, the CP adds a new engine called the CE (Constant Engine)
which runs simulatenously with the DE (Drawing Engine, formerly
called the ME).  This allows the CP to process two related IBs
simultaneously.  The CE is tasked with loading the constant data
(constant buffers, resource descriptors, samplers, etc.) while
the DE loads context register state and issues drawing commands.
It's up to the userspace application to sychronize the CE and the
DE using special synchronization packets.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: add support for MC/VM setup on SI
Alex Deucher [Tue, 20 Mar 2012 21:18:13 +0000 (17:18 -0400)]
drm/radeon/kms: add support for MC/VM setup on SI

Sets up the VM and adds support for the new VM ioctls.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: Add support for SI GPU reset
Alex Deucher [Tue, 20 Mar 2012 21:18:12 +0000 (17:18 -0400)]
drm/radeon/kms: Add support for SI GPU reset

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: add gpu init support for SI
Alex Deucher [Tue, 20 Mar 2012 21:18:11 +0000 (17:18 -0400)]
drm/radeon/kms: add gpu init support for SI

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: add support for internal thermal sensor on SI
Alex Deucher [Tue, 20 Mar 2012 21:18:10 +0000 (17:18 -0400)]
drm/radeon/kms: add support for internal thermal sensor on SI

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: update power table parsing for SI
Alex Deucher [Tue, 20 Mar 2012 21:18:09 +0000 (17:18 -0400)]
drm/radeon/kms: update power table parsing for SI

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms/atom: add support for SI SetVoltage table
Alex Deucher [Tue, 20 Mar 2012 21:18:08 +0000 (17:18 -0400)]
drm/radeon/kms/atom: add support for SI SetVoltage table

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: update comments about dig encoders/transmitters
Alex Deucher [Tue, 20 Mar 2012 21:18:07 +0000 (17:18 -0400)]
drm/radeon/kms: update comments about dig encoders/transmitters

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: DP aux updates for DCE6
Alex Deucher [Tue, 20 Mar 2012 21:18:06 +0000 (17:18 -0400)]
drm/radeon/kms: DP aux updates for DCE6

DCE6 requires a non-0 value for lpAuxRequest for the
ProcessAuxChannelTransaction command table.  Setting
lpAuxRequest to 0 is a special case used by AsicInit
for setting up the aux pads.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms/atom: add support for DCE6.x dig transmitters
Alex Deucher [Tue, 20 Mar 2012 21:18:05 +0000 (17:18 -0400)]
drm/radeon/kms/atom: add support for DCE6.x dig transmitters

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: DCE6 disp eng pll updates
Alex Deucher [Tue, 20 Mar 2012 21:18:04 +0000 (17:18 -0400)]
drm/radeon/kms: DCE6 disp eng pll updates

Rename the function to better match the functionality.
DCPLL became PLL0 on DCE6.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms/atom: add support for crtc power gating
Alex Deucher [Tue, 20 Mar 2012 21:18:03 +0000 (17:18 -0400)]
drm/radeon/kms/atom: add support for crtc power gating

Each pair of crtcs (0/1, 2/3, 4/5) can be power gated.
Make sure the power is applied when the crtc is in use and
only power down the pair when both are off.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms/atom: DCE6 no longer has crtcmemreq bits
Alex Deucher [Tue, 20 Mar 2012 21:18:02 +0000 (17:18 -0400)]
drm/radeon/kms/atom: DCE6 no longer has crtcmemreq bits

The hw no longer has the bits and the table is removed.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: fix up atom HPD gpio parsing for DCE6
Alex Deucher [Tue, 20 Mar 2012 21:18:01 +0000 (17:18 -0400)]
drm/radeon/kms: fix up atom HPD gpio parsing for DCE6

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: add initial DCE6 display watermark support
Alex Deucher [Tue, 20 Mar 2012 21:18:00 +0000 (17:18 -0400)]
drm/radeon/kms: add initial DCE6 display watermark support

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: add SI chip families
Alex Deucher [Tue, 20 Mar 2012 21:17:59 +0000 (17:17 -0400)]
drm/radeon/kms: add SI chip families

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: upstream power table updates
Alex Deucher [Tue, 20 Mar 2012 21:17:58 +0000 (17:17 -0400)]
drm/radeon/kms: upstream power table updates

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: upstream atombios.h updates
Alex Deucher [Tue, 20 Mar 2012 21:17:57 +0000 (17:17 -0400)]
drm/radeon/kms: upstream atombios.h updates

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: Upstream ObjectID.h updates
Alex Deucher [Tue, 20 Mar 2012 21:17:56 +0000 (17:17 -0400)]
drm/radeon/kms: Upstream ObjectID.h updates

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: add info query for max pipes
Tom Stellard [Tue, 20 Mar 2012 21:17:55 +0000 (17:17 -0400)]
drm/radeon/kms: add info query for max pipes

The maximum number of pipes is needed by the user space compute
driver to calculate the number of wavefronts per thread group.

Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm: allow loading an EDID as firmware to override broken monitor
Carsten Emde [Sun, 18 Mar 2012 21:37:33 +0000 (22:37 +0100)]
drm: allow loading an EDID as firmware to override broken monitor

Broken monitors and/or broken graphic boards may send erroneous or no
EDID data. This also applies to broken KVM devices that are unable to
correctly forward the EDID data of the connected monitor but invent
their own fantasy data.

This patch allows to specify an EDID data set to be used instead of
probing the monitor for it. It contains built-in data sets of frequently
used screen resolutions. In addition, a particular EDID data set may be
provided in the /lib/firmware directory and loaded via the firmware
interface. The name is passed to the kernel as module parameter of the
drm_kms_helper module either when loaded
  options drm_kms_helper edid_firmware=edid/1280x1024.bin
or as kernel commandline parameter
  drm_kms_helper.edid_firmware=edid/1280x1024.bin

It is also possible to restrict the usage of a specified EDID data set
to a particular connector. This is done by prepending the name of the
connector to the name of the EDID data set using the syntax
  edid_firmware=[<connector>:]<edid>
such as, for example,
  edid_firmware=DVI-I-1:edid/1920x1080.bin
in which case no other connector will be affected.

The built-in data sets are
Resolution    Name
--------------------------------
1024x768      edid/1024x768.bin
1280x1024     edid/1280x1024.bin
1680x1050     edid/1680x1050.bin
1920x1080     edid/1920x1080.bin

They are ignored, if a file with the same name is available in the
/lib/firmware directory.

The built-in EDID data sets are based on standard timings that may not
apply to a particular monitor and even crash it. Ideally, EDID data of
the connected monitor should be used. They may be obtained through the
drm/cardX/cardX-<connector>/edid entry in the /sys/devices PCI directory
of a correctly working graphics adapter.

It is even possible to specify the name of an EDID data set on-the-fly
via the /sys/module interface, e.g.
echo edid/myedid.bin >/sys/module/drm_kms_helper/parameters/edid_firmware
The new screen mode is considered when the related kernel function is
called for the first time after the change. Such calls are made when the
X server is started or when the display settings dialog is opened in an
already running X server.

Signed-off-by: Carsten Emde <C.Emde@osadl.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/exynos: enable hdmi audio feature
Seung-Woo Kim [Fri, 16 Mar 2012 09:47:16 +0000 (18:47 +0900)]
drm/exynos: enable hdmi audio feature

This patch adds hdmi audio feature for exynos drm.
With this patch, i2s channel feeds audio data in hdmi when hdmi is connected.

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/exynos: add default pixel format for plane
Eunchul Kim [Fri, 16 Mar 2012 09:47:15 +0000 (18:47 +0900)]
drm/exynos: add default pixel format for plane

DRM checks whether the plane supports a pixel format of fb when plane is
updated. This adds a default pixel format supporting format exynos drm
plane.

Signed-off-by: Eunchul Kim <chulspro.kim@samsung.com>
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/exynos: cleanup exynos_hdmi.h
Joonyoung Shim [Fri, 16 Mar 2012 09:47:14 +0000 (18:47 +0900)]
drm/exynos: cleanup exynos_hdmi.h

The some contents of the exynos_hdmi.h are used only in exynos_hdmi.c,
so move them to exynos_hdmi.c.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/exynos: add is_local member in exynos_drm_subdrv struct
Joonyoung Shim [Fri, 16 Mar 2012 09:47:10 +0000 (18:47 +0900)]
drm/exynos: add is_local member in exynos_drm_subdrv struct

The is_local member indicates unused subdrv such connector and encoder
so doesn't make resources for them.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/exynos: add subdrv open/close functions
Joonyoung Shim [Fri, 16 Mar 2012 09:47:09 +0000 (18:47 +0900)]
drm/exynos: add subdrv open/close functions

Some subdrv need open and close functions call when open and close drm.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/exynos: remove module of exynos drm subdrv
Joonyoung Shim [Fri, 16 Mar 2012 09:47:08 +0000 (18:47 +0900)]
drm/exynos: remove module of exynos drm subdrv

The exynos drm driver has several subdrv. They each can be module but it
causes unfixed probe order of exynodr drm driver and each subdrv. It
also needs some weird codes such as exynos_drm_fbdev_reinit and
exynos_drm_mode_group_reinit. This patch can remove weird codes and
clear codes through we doesn't modularity each subdrv.

Also this removes unnecessary codes related module.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/exynos: release pending pageflip events when closed
Joonyoung Shim [Fri, 16 Mar 2012 09:47:07 +0000 (18:47 +0900)]
drm/exynos: release pending pageflip events when closed

We should release pending pageflip events when closed. If not, they will
be dangling events.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/exynos: added new funtion to get/put dma address.
Inki Dae [Fri, 16 Mar 2012 09:47:06 +0000 (18:47 +0900)]
drm/exynos: added new funtion to get/put dma address.

this function would be used for drm based 2d acceleration driver
to get/put dma address through gem handle.
when exynos_drm_get_dma_address is called reference count of
gem object would be increased not to be released by gem close and
when exynos_drm_put_dma_address is called the reference count of
this gem object would be decreased to be released.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/exynos: update gem and buffer framework.
Inki Dae [Fri, 16 Mar 2012 09:47:05 +0000 (18:47 +0900)]
drm/exynos: update gem and buffer framework.

with this patch, we can allocate physically continuous or non-continuous
memory and also it creates scatterlist for iommu support so allocated
memory region can be mapped to iommu page table using scatterlist.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/exynos: added mode_fixup feature and code clean.
Inki Dae [Fri, 16 Mar 2012 09:47:04 +0000 (18:47 +0900)]
drm/exynos: added mode_fixup feature and code clean.

this patch adds mode_fixup feature for hdmi module that
specific driver changes current mode to driver desired mode
properly.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/exynos: add HDMI version 1.4 support
Joonyoung Shim [Fri, 16 Mar 2012 09:47:03 +0000 (18:47 +0900)]
drm/exynos: add HDMI version 1.4 support

Later Exynos series from Exynos4X12 support HDMI version 1.4. We will
distinguish to use which version via platform data. This patch supports
only default features of HDMI version 1.4(The 3D, sound and etc don't
support yet)

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/exynos: remove exynos_mixer.h
Joonyoung Shim [Thu, 15 Mar 2012 08:19:04 +0000 (17:19 +0900)]
drm/exynos: remove exynos_mixer.h

The contents of exynos_mixer.h are used only in exynos_mixer.c, so
separated header is unnecessary.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogma500: Fix mmap frambuffer
Yoichi Yuasa [Thu, 15 Mar 2012 14:50:16 +0000 (14:50 +0000)]
gma500: Fix mmap frambuffer

It cannot map correctly if page fault begins from a intermediate address.

[The driver prefaults the mapping, so we need to work from the correct
 base address not the faulting address otherwise the map appears offset by
 the fault offset]

Signed-off-by: Yoichi Yuasa <yuasa@linux-mips.org>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agoMerge tag 'drm-intel-next-2012-03-01' of git://people.freedesktop.org/~danvet/drm...
Dave Airlie [Tue, 20 Mar 2012 08:51:37 +0000 (08:51 +0000)]
Merge tag 'drm-intel-next-2012-03-01' of git://people.freedesktop.org/~danvet/drm-intel into drm-next

* tag 'drm-intel-next-2012-03-01' of git://people.freedesktop.org/~danvet/drm-intel:
  drm/i915: Only clear the GPU domains upon a successful finish
  drm/i915: reenable gmbus on gen3+ again
  drm/i915: i2c: unconditionally set up gpio fallback
  drm/i915: merge gmbus and gpio i2c adpater into one
  drm/i915: merge struct intel_gpio into struct intel_gmbus
  i2c: export bit-banging algo functions
  drm/nouveau: do a better job at hiding the NIH i2c bit-banging algo
  drm/i915: add dev_priv to intel_gmbus
  drm/i915: Fix single msg gmbus_xfers writes
  drm/i915: error_buffer->ring should be signed
  drm/i915: Silence the error message from i915_wait_request()
  drm/i915: use the new hdmi_force_audio enum more
  drm/i915: No need to search again after retiring requests
  drm/i915: Only bump refcnt on objects scheduled for eviction
  drm/i915/bios: Downgrade the "signature missing" DRM_ERROR to debug
  drm/i915: Ignore LVDS on hp t5745 and hp st5747 thin client
  drm/i915: Fixes distorted external screen image on HP 2730p

12 years agodrm/radeon: Drop radeon_gem_object_(un)pin.
Michel Dänzer [Wed, 14 Mar 2012 13:59:25 +0000 (14:59 +0100)]
drm/radeon: Drop radeon_gem_object_(un)pin.

Only radeon_gem_object_unpin was used anymore, in only one place.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon: Restrict offset for legacy display engine.
Michel Dänzer [Wed, 14 Mar 2012 16:12:42 +0000 (17:12 +0100)]
drm/radeon: Restrict offset for legacy display engine.

The hardware only takes 27 bits for the offset, so larger offsets are
truncated, and the display shows random bits other than the intended ones.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon: Restrict offset for legacy hardware cursor.
Michel Dänzer [Wed, 14 Mar 2012 16:12:41 +0000 (17:12 +0100)]
drm/radeon: Restrict offset for legacy hardware cursor.

The hardware only takes 27 bits for the offset, so larger offsets are
truncated, and the hardware cursor shows random bits other than the intended
ones.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46796

Cc: stable@vger.kernel.org
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: reduce probe latency on digital connectors
Tvrtko Ursulin [Fri, 16 Mar 2012 16:22:11 +0000 (12:22 -0400)]
drm/radeon/kms: reduce probe latency on digital connectors

On a system with one HDMI and one VGA connector the latter
causes output polling to run every ten seconds. This causes
full EDID re-fetch on every poll and approx. 100ms rendering
stalls are experienced by full screen page-flipping applications.
Optimisation is to trust HPD sense on R600+ ASICs and to skip
doing these expensive probes unless HPD sense has changed.

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=47007

agd5f: fix patch and message formatting.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@onelan.co.uk>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: add connector quirk for Fujitsu D3003-S2 board
Alex Deucher [Fri, 16 Mar 2012 16:22:10 +0000 (12:22 -0400)]
drm/radeon/kms: add connector quirk for Fujitsu D3003-S2 board

vbios lists DVI-I port as VGA and DVI-D.

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=47007

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: fix analog load detection on DVI-I connectors
Alex Deucher [Fri, 16 Mar 2012 16:22:09 +0000 (12:22 -0400)]
drm/radeon/kms: fix analog load detection on DVI-I connectors

We digital encoders have a detect function as well (for
DP to VGA bridges), so we make sure we choose the analog
one here.

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=47007

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/ttm: Use pr_fmt and pr_<level>
Joe Perches [Sat, 17 Mar 2012 04:43:50 +0000 (21:43 -0700)]
drm/ttm: Use pr_fmt and pr_<level>

Use the more current logging style.

Add pr_fmt and remove the TTM_PFX uses.
Coalesce formats and align arguments.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrivers/gpu/drm/savage/savage_state.c: add missing kfree
Julia Lawall [Sat, 17 Mar 2012 17:57:02 +0000 (18:57 +0100)]
drivers/gpu/drm/savage/savage_state.c: add missing kfree

Most of the error handling code in this function frees the buffers
kcmd_addr, kvb_addr, and kbox_addr allocated at the beginning of this
function.  These two branches are changed to do the same.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrivers/gpu/drm/radeon/radeon_cs.c: eliminate possible double free
Julia Lawall [Sat, 17 Mar 2012 17:03:29 +0000 (18:03 +0100)]
drivers/gpu/drm/radeon/radeon_cs.c: eliminate possible double free

The function radeon_cs_parser_init is only called from two places, in
drivers/gpu/drm/radeon/radeon_cs.c and drivers/gpu/drm/radeon/r600_cs.c.
In each case, if the call fails another function is called that frees all
of the kdata and dpage information in the chunks array.  So this
information should not be freed in radeon_cs_parser_init as well.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon: dp only enable enhanced framing if sink supports.
Dave Airlie [Sun, 18 Mar 2012 10:10:50 +0000 (10:10 +0000)]
drm/radeon: dp only enable enhanced framing if sink supports.

DisplayPort spec v1.1a, Table 2-52.

Same commit to Intel by ajax in 9962c9252e46eda7058067cbe73bdf1ed74b0d37

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: skip db/cb/streamout checking when possible on r600
Marek Olšák [Mon, 19 Mar 2012 02:09:38 +0000 (03:09 +0100)]
drm/radeon/kms: skip db/cb/streamout checking when possible on r600

Signed-off-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: compute GPU addresses correctly on r600
Marek Olšák [Mon, 19 Mar 2012 02:09:37 +0000 (03:09 +0100)]
drm/radeon/kms: compute GPU addresses correctly on r600

Signed-off-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: remove some unused variables in evergreen_cs_track
Marek Olšák [Mon, 19 Mar 2012 02:09:36 +0000 (03:09 +0100)]
drm/radeon/kms: remove some unused variables in evergreen_cs_track

and document the other unused ones.

Signed-off-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: skip db/cb/streamout checking when possible on evergreen
Marek Olšák [Mon, 19 Mar 2012 02:09:35 +0000 (03:09 +0100)]
drm/radeon/kms: skip db/cb/streamout checking when possible on evergreen

Signed-off-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: optimize streamout checking for evergreen
Marek Olšák [Mon, 19 Mar 2012 02:09:34 +0000 (03:09 +0100)]
drm/radeon/kms: optimize streamout checking for evergreen

Signed-off-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: compute GPU addresses correctly on evergreen
Marek Olšák [Mon, 19 Mar 2012 02:09:33 +0000 (03:09 +0100)]
drm/radeon/kms: compute GPU addresses correctly on evergreen

There are also two fixes:
- In DRAW_INDEX_2, we read idx_value, but should have read idx+1.
- When correcting SQ_VTX_CONSTANT_WORD1_0.SIZE, we should subtract
  the offset.

Signed-off-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: make some DRM errors more informative
Marek Olšák [Mon, 19 Mar 2012 02:09:32 +0000 (03:09 +0100)]
drm/radeon/kms: make some DRM errors more informative

Signed-off-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/radeon/kms: skip cb/db checking if SX_MISC is 1 on r600+
Marek Olšák [Wed, 7 Mar 2012 23:56:00 +0000 (00:56 +0100)]
drm/radeon/kms: skip cb/db checking if SX_MISC is 1 on r600+

Signed-off-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/usb: move usb support into a separate module
Dave Airlie [Tue, 20 Mar 2012 06:59:29 +0000 (06:59 +0000)]
drm/usb: move usb support into a separate module

In order to satisfy all the various Kconfig options between
USB and DRM, we need to split the USB code out into a separate module
and export symbols to it.

This fixes build problems in -next reported by sfr.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm: fix build with UDL if USB is a module
Dave Airlie [Fri, 16 Mar 2012 09:28:03 +0000 (09:28 +0000)]
drm: fix build with UDL if USB is a module

reported by sfr on -next merge.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/udl: initial UDL driver (v4)
Dave Airlie [Tue, 14 Dec 2010 21:14:24 +0000 (07:14 +1000)]
drm/udl: initial UDL driver (v4)

This is an initial drm/kms driver for the displaylink devices.

Supports fb_defio,
supports KMS dumb interface
supports 24bpp via conversion to 16bpp, hw can do this better.
supports hot unplug using new drm core features.

On an unplug, it disables connector polling, unplugs connectors
from sysfs, unplugs fbdev layer (using Kay's API), drops all the
USB device URBs, and call the drm core to unplug the device.

This driver is based in large parts on udlfb.c so I've licensed
it under GPLv2.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm: add core support for unplugging a device (v2)
Dave Airlie [Mon, 20 Feb 2012 14:18:07 +0000 (14:18 +0000)]
drm: add core support for unplugging a device (v2)

Two parts to this, one is simple unplug from sysfs for the device node.

The second adds an unplugged state, if we have device opens, we
just set the unplugged state and return, if we have no device
opens we drop the drm device.

If after a lastclose we discover we are unplugged we then
drop the drm device.

v2: use an atomic for unplugged and wrap it for users,
add checks on open + mmap + ioctl entry points.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/modeset: add helper to unplug all connectors from sysfs
Dave Airlie [Mon, 20 Feb 2012 14:16:40 +0000 (14:16 +0000)]
drm/modeset: add helper to unplug all connectors from sysfs

In order to get correct ordering at hot-unplug for userspace,
we need to tear down all the sysfs bits at the correct time.

This adds a helper to allow drivers to remove the sysfs nodes
for all connectors.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm/sysfs: protect sysfs removal code against being run twice.
Dave Airlie [Mon, 20 Feb 2012 14:15:02 +0000 (14:15 +0000)]
drm/sysfs: protect sysfs removal code against being run twice.

a step towards correct hot unplug for USB devices, we need to
remove the userspace facing bits at the unplug time for correct
udev operation.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agoudlfb: remove sysfs framebuffer device with USB .disconnect()
Kay Sievers [Sat, 28 Jan 2012 19:57:46 +0000 (19:57 +0000)]
udlfb: remove sysfs framebuffer device with USB .disconnect()

The USB graphics card driver delays the unregistering of the framebuffer
device to a workqueue, which breaks the userspace visible remove uevent
sequence. Recent userspace tools started to support USB graphics card
hotplug out-of-the-box and rely on proper events sent by the kernel.

The framebuffer device is a direct child of the USB interface which is
removed immediately after the USB .disconnect() callback. But the fb device
in /sys stays around until its final cleanup, at a time where all the parent
devices have been removed already.

To work around that, we remove the sysfs fb device directly in the USB
.disconnect() callback and leave only the cleanup of the internal fb
data to the delayed work.

Before:
 add      /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2 (usb)
 add      /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0 (usb)
 add      /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0/graphics/fb0 (graphics)
 remove   /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0 (usb)
 remove   /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2 (usb)
 remove   /2-1.2:1.0/graphics/fb0 (graphics)

After:
 add      /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2 (usb)
 add      /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0 (usb)
 add      /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0/graphics/fb1 (graphics)
 remove   /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0/graphics/fb1 (graphics)
 remove   /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0 (usb)
 remove   /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2 (usb)

Cc: stable@vger.kernel.org
Tested-by: Bernie Thompson <bernie@plugable.com>
Acked-by: Bernie Thompson <bernie@plugable.com>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
12 years agodrm: Merge tag 'v3.3-rc7' into drm-core-next
Dave Airlie [Thu, 15 Mar 2012 10:24:32 +0000 (10:24 +0000)]
drm: Merge tag 'v3.3-rc7' into drm-core-next

Merge the fixes so far into core-next, needed to test
intel driver.

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

12 years agodrm: Add drm_mode_copy()
Ville Syrjälä [Tue, 13 Mar 2012 10:35:51 +0000 (12:35 +0200)]
drm: Add drm_mode_copy()

Add a helper function to copy a display mode. Use it in
drm_mode_duplicate() and nouveau mode_fixup hooks.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm: Use a flexible array member for blob property data
Ville Syrjälä [Tue, 13 Mar 2012 10:35:49 +0000 (12:35 +0200)]
drm: Use a flexible array member for blob property data

The blob property data is always allocated immediately after the object
header. No need for the extra indirection when accessing it, just use
a flexible array member.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm: Handle drm_object_get() failures
Ville Syrjälä [Tue, 13 Mar 2012 10:35:48 +0000 (12:35 +0200)]
drm: Handle drm_object_get() failures

Check drm_mode_object_get() return value everywhere.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm: Make drm_crtc_convert_{umode, to_umode} static and constify their params
Ville Syrjälä [Tue, 13 Mar 2012 10:35:47 +0000 (12:35 +0200)]
drm: Make drm_crtc_convert_{umode, to_umode} static and constify their params

drm_crtc_convert_umode() and drm_crtc_convert_to_umode() are never
used outside drm_crtc.c, so make them static. Also make the input
mode structure const for both functions.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm: Fix drm_mode_attachmode_crtc()
Ville Syrjälä [Tue, 13 Mar 2012 10:35:46 +0000 (12:35 +0200)]
drm: Fix drm_mode_attachmode_crtc()

Change drm_mode_attachmode_crtc() to take an "all or nothing" approach.
If an error is returned, there are no side effects visible.

Also change the function to always duplicate the mode passed in.

Also change the function to not give up when it finds the first
connector without and encoder.

A simpler approach would be to just remove the function completely as
it's unused currently.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm: Check CRTC viewport against framebuffer size
Ville Syrjälä [Tue, 13 Mar 2012 10:35:45 +0000 (12:35 +0200)]
drm: Check CRTC viewport against framebuffer size

Make sure the requested CRTC viewport fits inside the
framebuffer.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm: Check user mode against overflows
Ville Syrjälä [Tue, 13 Mar 2012 10:35:44 +0000 (12:35 +0200)]
drm: Check user mode against overflows

The internal mode representation drm_display_mode uses signed data
types. When converting the user mode to internal representation,
check that the unsigned values don't overflow the signed datatypes.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm: Fix memory leak in drm_mode_setcrtc()
Ville Syrjälä [Tue, 13 Mar 2012 10:35:43 +0000 (12:35 +0200)]
drm: Fix memory leak in drm_mode_setcrtc()

The mode passed to the .set_config() hook was never freed. The drivers
will make a copy of the mode, so simply free it when done.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm: Make drm_mode_attachmode() void
Ville Syrjälä [Tue, 13 Mar 2012 10:35:42 +0000 (12:35 +0200)]
drm: Make drm_mode_attachmode() void

drm_mode_attachmode() always returns 0. Change the return type to void.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm: Check crtc x and y coordinates
Ville Syrjälä [Tue, 13 Mar 2012 10:35:41 +0000 (12:35 +0200)]
drm: Check crtc x and y coordinates

The crtc x/y panning coordinates are stored as signed integers
internally. The user provides them as unsigned, so we should check
that the user provided values actually fit in the internal datatypes.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrm: Warn if mode to umode conversion overflows the destination types
Ville Syrjälä [Tue, 13 Mar 2012 10:35:40 +0000 (12:35 +0200)]
drm: Warn if mode to umode conversion overflows the destination types

When converting from a drm_display_mode to drm_mode_modeinfo, print a
warning if the the timings values don't fit into the __u16 datatype.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>