summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2013-09-05Merge branch 'exynos-drm-next' of ↵drm-nextDave Airlie26-399/+357
git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos into drm-next Summary: - Consider fallback option to gem allocation fail . try to allocate physically non-contiguous memory if iommu is supported when physically contiguous memory allocation failed. - Add runtime pm support to g2d driver - Add device tree support . add device tree support to rotator driver, make fimd driver get signal polarities from device tree. - some fixups . correct pixel format setting to fimd driver, and consider pixel format checking to a particular window layer. - some cleanups . replace fb_videomode with videomode. . remove non-DT support * 'exynos-drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos: (21 commits) drm/exynos: Fix build error with exynos_drm_connector.c drm/exynos: Remove non-DT support in exynos_drm_fimd drm/exynos: Remove non-DT support in exynos_hdmi drm/exynos: Remove non-DT support in exynos_drm_g2d drm/exynos: Remove non-DT support in exynos_hdmiphy drm/exynos: Remove non-DT support in exynos_ddc drm/exynos: Make Exynos DRM drivers depend on OF drm/exynos: Consider fallback option to allocation fail drm/exynos: fimd: move platform data parsing to separate function drm/exynos: fimd: get signal polarities from device tree drm/exynos: fimd: replace struct fb_videomode with videomode drm/exynos: check a pixel format to a particular window layer drm/exynos: fix fimd pixel format setting drm/exynos: Add NULL pointer check drm/exynos: Remove redundant error messages drm/exynos: Add missing of.h header include drm/exynos: Remove redundant NULL check in exynos_drm_buf drm/exynos: add device tree support for rotator drm/exynos: Add missing includes drm/exynos: add runtime pm interfaces to g2d driver ...
2013-09-05drm/exynos: Fix build error with exynos_drm_connector.cSachin Kamat1-1/+1
exynos_drm_connector.c now uses videomode helper API. Hence select VIDEOMODE_HELPERS at DRM_EXYNOS level itself instead of at DRM_EXYNOS_FIMD to avoid the following compilation error when FIMD is not selected (introduced by commit cf796235a6 "drm/exynos: fimd: replace struct fb_videomode with videomode"): drivers/built-in.o: In function `exynos_drm_connector_get_modes': drivers/gpu/drm/exynos/exynos_drm_connector.c:86: undefined reference to `drm_display_mode_from_videomode' Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2013-09-05drm/exynos: Remove non-DT support in exynos_drm_fimdSachin Kamat1-53/+21
Since commit 383ffda2fa ("ARM: EXYNOS: no more support non-DT for EXYNOS SoCs"), Exynos platform is DT only. Hence remove all the conditional macros and make the driver DT only. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2013-09-05drm/exynos: Remove non-DT support in exynos_hdmiSachin Kamat1-58/+12
Since commit 383ffda2fa ("ARM: EXYNOS: no more support non-DT for EXYNOS SoCs"), Exynos platform is DT only. Hence remove all the conditional macros and make the driver DT only. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2013-09-05drm/exynos: Remove non-DT support in exynos_drm_g2dSachin Kamat1-3/+1
Since commit 383ffda2fa ("ARM: EXYNOS: no more support non-DT for EXYNOS SoCs"), Exynos platform is DT only. Hence remove all the conditional macros and make the driver DT only. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2013-09-05drm/exynos: Remove non-DT support in exynos_hdmiphySachin Kamat1-10/+1
Since commit 383ffda2fa ("ARM: EXYNOS: no more support non-DT for EXYNOS SoCs"), Exynos platform is DT only. Hence remove all the conditional macros and make the driver DT only. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2013-09-05drm/exynos: Remove non-DT support in exynos_ddcSachin Kamat1-10/+1
Since commit 383ffda2fa ("ARM: EXYNOS: no more support non-DT for EXYNOS SoCs"), Exynos platform is DT only. Hence remove all the conditional macros and make the driver DT only. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2013-09-05drm/exynos: Make Exynos DRM drivers depend on OFSachin Kamat1-2/+2
Exynos is a DT-only platform. Add this info to Kconfig. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2013-09-05drm/exynos: Consider fallback option to allocation failVikas Sajjan1-0/+13
To address the case where physically contiguous memory MAY NOT be a mandatory requirement for framebuffer for the application calling exynos_drm_gem_dumb_create, the patch adds a feature to get non physically contiguous memory for framebuffer, if physically contiguous memory allocation fails and if IOMMU is supported. Signed-off-by: Vikas Sajjan <vikas.sajjan@linaro.org> Signed-off-by: Arun Kumar <arun.kk@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2013-09-05drm/exynos: fimd: move platform data parsing to separate functionAndrzej Hajda1-32/+31
The patch moves platfrom_data and device tree parsing to separate function. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2013-09-05drm/exynos: fimd: get signal polarities from device treeAndrzej Hajda1-0/+9
The patch adds code to get signal polarization setting from device tree display-timings node. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2013-09-05drm/exynos: fimd: replace struct fb_videomode with videomodeAndrzej Hajda3-97/+70
The patch replaces all occurrences of struct fb_videomode by more accurate struct videomode. The change allows to remove mode conversion function and simplifies clock divider calculation. Clock configuration is moved to separate function. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2013-09-05drm/exynos: check a pixel format to a particular window layerInki Dae1-0/+11
This patch checks if a requested window supports alpha channel or not. In case of s3c64xx, window 0 doesn't support alpha channel so if the request pixel format is ARGB8888 then change it to XRGB8888. Signed-off-by: Inki Dae <inki.dae@samsung.com> Reviewed-by: Tomasz Figa <t.figa@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2013-09-05drm/exynos: fix fimd pixel format settingInki Dae1-21/+13
This patch fixes wrong pixel format setting. A pixel format is decided according to bpp and depth, or user-requested format but fimd driver considered only bpp value to decide a proper pixel format. So this patch makes a proper pixel format to be set according to drm_framebuffer's pixel_format which is set by addfb with bpp and depth, or addfb2 with user-requested format. Signed-off-by: Inki Dae <inki.dae@samsung.com> Reviewed-by: Tomasz Figa <t.figa@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2013-09-05drm/exynos: Add NULL pointer checkSachin Kamat1-0/+9
devm_kzalloc can fail. Hence check the pointer to avoid NULL pointer dereferencing. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2013-09-05drm/exynos: Remove redundant error messagesSachin Kamat19-96/+30
kzalloc already has built-in error messages. Hence remove additional ones. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2013-09-05drm/exynos: Add missing of.h header includeSachin Kamat6-1/+6
Add of.h explicitly for of_* APIs. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2013-09-05drm/exynos: Remove redundant NULL check in exynos_drm_bufSachin Kamat1-5/+0
kfree handles null pointers. Hence this check is not necessary. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2013-09-05drm/exynos: add device tree support for rotatorChanho Park2-28/+107
The exynos4 platform is only dt-based since 3.10, we should convert driver data and ids to dt-based parsing methods. The rotator driver has a limit table to get size limit of input picture. Each SoCs has slightly different limit value compared with any others. For example, exynos4210's max_size of RGB888 is 16k x 16k. But, others have 8k x 8k. Another example the exynos5250 should have multiple of 2 pixel size for its X/Y axis. Thus, we should keep different tables for each of them. This patch also includes desciptions of each nodes for the rotator and specifies a example how to bind it. Signed-off-by: Chanho Park <chanho61.park@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2013-09-05drm/exynos: Add missing includesMark Brown10-0/+10
Ensure that all externally accessed functions are correctly prototyped when defined in each file by making sure the headers with the protoypes are included in the file with the definition. Signed-off-by: Mark Brown <broonie@linaro.org> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2013-09-05drm/exynos: add runtime pm interfaces to g2d driverInki Dae1-12/+28
This patch makes g2d power domain and clock to be controlled through pm runtime interfaces instead of controlling them respectively. Signed-off-by: Inki Dae <inki.dae@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2013-09-05drm/exynos: Add fallback option to get non physically contiguous memory for fbVikas Sajjan1-2/+13
While trying to get boot-logo up on exynos5420 SMDK which has eDP panel connected with resolution 2560x1600, following error occured even with IOMMU enabled: [0.880000] [drm:lowlevel_buffer_allocate] *ERROR* failed to allocate buffer. [0.890000] [drm] Initialized exynos 1.0.0 20110530 on minor 0 To address the cases where physically contiguous memory MAY NOT be a mandatory requirement for fb, the patch adds a feature to get non physically contiguous memory for fb if physically contiguous memory allocation fails and if IOMMU is supported. Signed-off-by: Vikas Sajjan <vikas.sajjan@linaro.org> Signed-off-by: Arun Kumar <arun.kk@samsung.com> Reviewed-by: Rob Clark <robdclark@gmail.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2013-09-05drm/tda998x: BUG() on invalid audio formatDavid Herrmann1-0/+4
Suppress warning of unused-variables by adding a BUG()+return for invalid audio-formats. Cc: Rob Clark <robdclark@gmail.com> Signed-off-by: David Herrmann <dh.herrmann@gmail.com> Signed-off-by: Dave Airlie <airlied@gmail.com>
2013-09-05drm/radeon: protect ACPI calls with CONFIG_ACPIStephen Rothwell1-0/+4
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Acked-by: Alex Deucher <Alexander.Deucher@amd.com> Signed-off-by: Dave Airlie <airlied@gmail.com>
2013-09-04Merge branch 'drm-nouveau-next' of ↵Dave Airlie37-145/+323
git://anongit.freedesktop.org/git/nouveau/linux-2.6 into drm-next Nothing major ready for merging yet, so mostly bug fixes below, in addition to VP3 enablement from Ilia. * 'drm-nouveau-next' of git://anongit.freedesktop.org/git/nouveau/linux-2.6: drm/nouveau: fix command submission to use vmalloc for big allocations drm/nouveau/bios/therm: handle vbioses with duplicate entries (mostly nva5) drm/nouveau: use MSI interrupts drm/nv50-/kms: assume analog display connected if load on any pin drm/nv50/disp: prevent false output detection on the original nv50 drm/nouveau/i2c: pass the function pointers in at creation time drm/nouveau/therm: survive to suspend/resume cycles drm/nouveau/timer: add a way to cancel alarms drm/nouveau/timer: restore the time on resume drm/nouveau/fan: restore pwm value on resume when in manual/auto mode drm/nouveau/therm: Set the correct pwm_mode upon resume drm/nouveau: require contiguous bo for framebuffer drm/nv50-/disp: use the number of dac, sor, pior rather than hardcoded values drm/nouveau: remove duplicate copy of nv44_graph_class drm/nouveau/vdec: implement support for VP3 engines drm/nouveau/core: get rid of math.h, replace log2i with order_base_2
2013-09-04drm/nouveau: fix command submission to use vmalloc for big allocationsMaarten Lankhorst1-7/+20
I was getting a order 4 allocation failure from kmalloc when testing some game after a few days uptime with some suspend/resumes. For big allocations vmalloc should be used instead. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-09-04drm/nouveau/bios/therm: handle vbioses with duplicate entries (mostly nva5)Martin Peres1-1/+2
Some vbioses have extra useless entries after "the end" of the table. This is problematic since all of the vbios I found with this issue redefine the pwm freq divider to insane levels (52750 Hz instead of 2500), thus breaking fan management. The first solution to solve this mess would be to change the length of the table. The solution I choose was simply to avoid setting the pwm freq twice as the other redefinitions are harmless with our current parser. Signed-off-by: Martin Peres <martin.peres@labri.fr> Reported-by: Mariusz Bialonczyk <manio@skyboo.net> Tested-by: Mariusz Bialonczyk <manio@skyboo.net> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-09-04drm/nouveau: use MSI interruptsLucas Stach3-1/+25
MSIs were only problematic on some old, broken chipsets. But now that we already see systems where PCI legacy interrupts are somewhat flaky, it's really time to move to MSIs. v2 (Ben Skeggs): blacklist BR02 boards Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-09-04drm/nv50-/kms: assume analog display connected if load on any pinBen Skeggs1-1/+1
Fixes a VGA monitor with a dodgy red (in this case) pin not being detected. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-09-04drm/nv50/disp: prevent false output detection on the original nv50Emil Velikov1-5/+10
Commit ea9197cc323839ef3d5280c0453b2c622caa6bc7 effectively enabled the use of an improved DAC detection code, but introduced a regression on the original nv50 chipset, causing a ghost monitor to be detected. v2 (Ben Skeggs): the offending line was likely a thinko, removed it for all chipsets (tested nv50 and nve6 to cover entire range) and added some additional debugging. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67382 Tested-by: Martin Peres <martin.peres@labri.fr> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Cc: <stable@vger.kernel.org> # 3.9+ Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-09-04drm/nouveau/i2c: pass the function pointers in at creation timeIlia Mirkin8-21/+23
i2c_bit_add_bus can call the pre_xfer function, which expects the func pointer to be set. Pass in func to the port creation logic so that it is set before i2c_bit_add_bus. See https://bugs.freedesktop.org/show_bug.cgi?id=68456 Reported-by: Hans-Peter Deifel <hpdeifel@gmx.de> Tested-by: Hans-Peter Deifel <hpdeifel@gmx.de> Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-09-04drm/nouveau/therm: survive to suspend/resume cyclesMartin Peres4-1/+51
Therm uses 3 ptimer alarms. Two to drive the fan and one for polling the temperature. When suspending/resuming, alarms will never be fired. As we are checking if there isn't an alarm pending before rescheduling another one, we end up never checking temperature or updating the fan speed. This commit also adds debug messages to be able to spot more easily if this case happens again in the future. Sorry for the spam if you activate the debug level though. Tested-by: Dash Four <mr.dash.four@googlemail.com> v2: - fix temperature polling too Signed-off-by: Martin Peres <martin.peres@labri.fr> Tested-by: Martin Peres <martin.peres@labri.fr> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-09-04drm/nouveau/timer: add a way to cancel alarmsMartin Peres3-0/+29
Since alarms don't play well with suspend, it is important every alarm user cancels his tasks before suspending. The task should be rescheduled on resume. Signed-off-by: Martin Peres <martin.peres@labri.fr> Tested-by: Martin Peres <martin.peres@labri.fr> Tested-by: Dash Four <mr.dash.four@googlemail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-09-04drm/nouveau/timer: restore the time on resumeMartin Peres1-1/+14
This can be useful if some parts of Nouveau try to calculate the time between two events. Without this patch, the time difference would be negative in the case where the computer is suspended/resumed between two events. This patch should fix fan speed probing when done while suspending/resuming. Solve this by saving the current time before suspending and by restoring it on resume. Signed-off-by: Martin Peres <martin.peres@labri.fr> Tested-by: Martin Peres <martin.peres@labri.fr> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-09-04drm/nouveau/fan: restore pwm value on resume when in manual/auto modeMartin Peres2-1/+9
If the fan was in manual or auto mode, we should restore the fan speed that was previously set when resuming. The initial pwm value is saved when loading the module. Signed-off-by: Martin Peres <martin.peres@labri.fr> Tested-by: Martin Peres <martin.peres@labri.fr> Tested-by: Dash Four <mr.dash.four@googlemail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-09-04drm/nouveau/therm: Set the correct pwm_mode upon resumeEmil Velikov1-1/+1
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Signed-off-by: Martin Peres <martin.peres@labri.fr> Tested-by: Martin Peres <martin.peres@labri.fr> Tested-by: Dash Four <mr.dash.four@googlemail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-09-04drm/nouveau: require contiguous bo for framebufferMaarten Lankhorst1-0/+5
This was already required before, but no check in the kernel was done to enforce it. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-09-04drm/nv50-/disp: use the number of dac, sor, pior rather than hardcoded valuesEmil Velikov1-17/+17
The values are already stored on chipset specific basis in the ctor. Make the most of them and simplify the code further by using a temporary variable to avoid code duplication. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-09-04drm/nouveau: remove duplicate copy of nv44_graph_classIlia Mirkin2-8/+5
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-09-04drm/nouveau/vdec: implement support for VP3 enginesIlia Mirkin6-53/+104
For NV98+, BSP/VP/PPP are all FUC-based engines. Hook them all up in the same way as NVC0, but with a couple of different values. Also make sure that the PPP engine is handled in the fifo/mc/vm. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-09-04drm/nouveau/core: get rid of math.h, replace log2i with order_base_2Ilia Mirkin7-27/+7
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-09-04Merge tag 'drm/for-3.12-rc1' of git://anongit.freedesktop.org/tegra/linux ↵Dave Airlie5-17/+23
into drm-next drm/tegra: Changes for v3.12-rc1 Only a couple of small patches this time around. These are mostly fixes for minor bugs that showed up, but there is also some preparatory work that will come in handy for future patches. * tag 'drm/for-3.12-rc1' of git://anongit.freedesktop.org/tegra/linux: drm/tegra: Parse device tree earlier gpu: host1x: Sort drivers by probe order gpu: host1x: Check for valid host1x pointer gpu: host1x: returning success instead of -ENOMEM gpu: host1x: fix an integer overflow check drm/tegra: hdmi: Make sure clock is enabled before dumping registers
2013-09-03drm/tegra: Parse device tree earlierThierry Reding1-7/+7
Parsing the device tree may cause probing to be deferred. Doing this as early as possible prevents any other resources from being requested and enabled, therefore reducing the need to cleanup on deferred probe while at the same time not wasting precious CPU cycles determining if probing needs to be deferred or not. Signed-off-by: Thierry Reding <treding@nvidia.com>
2013-09-03gpu: host1x: Sort drivers by probe orderThierry Reding1-1/+1
External driver declarations are sorted by probe order for consistency. Signed-off-by: Thierry Reding <treding@nvidia.com>
2013-09-03gpu: host1x: Check for valid host1x pointerThierry Reding1-1/+1
Under rare circumstances it can happen that the host1x driver's .probe() doesn't finish properly, in which case the device's driver-specific data will not be set. Instead of crashing in such a situation, propagate the error to callers of the host1x_get_drm_data() function. Signed-off-by: Thierry Reding <treding@nvidia.com>
2013-09-02drm/radeon: support render nodesChristian König2-12/+12
Enable support for drm render nodes for radeon by flagging the ioctls that are safe and just needed for rendering. Signed-off-by: Christian König <christian.koenig@amd.com> Signed-off-by: David Herrmann <dh.herrmann@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-09-02drm/nouveau: Support render nodesMartin Peres1-12/+12
Enable support for drm render nodes for nouveau by flagging the ioctls that are safe and just needed for rendering. Cc: Ben Skeggs <bskeggs@redhat.com> Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com> Signed-off-by: Martin Peres <martin.peres@labri.fr> Signed-off-by: David Herrmann <dh.herrmann@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-09-02drm/i915: Support render nodesKristian Høgsberg2-22/+23
Enable support for drm render nodes for i915 by flagging the ioctls that are safe and just needed for rendering. v2: mark reg_read, set_caching and get_caching (ickle, danvet) Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> Signed-off-by: David Herrmann <dh.herrmann@gmail.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-09-02drm: fix DRM_IOCTL_MODE_GETFB handle-leakDavid Herrmann1-3/+15
DRM_IOCTL_MODE_GETFB is used to retrieve information about a given framebuffer ID. It is a read-only helper and was thus declassified for unprivileged access in: commit a14b1b42477c5ef089fcda88cbaae50d979eb8f9 Author: Mandeep Singh Baines <mandeep.baines@gmail.com> Date: Fri Jan 20 12:11:16 2012 -0800 drm: remove master fd restriction on mode setting getters However, alongside width, height and stride information, DRM_IOCTL_MODE_GETFB also passes back a handle to the underlying buffer of the framebuffer. This handle allows users to mmap() it and read or write into it. Obviously, this should be restricted to DRM-Master. With the current setup, *any* process with access to /dev/dri/card0 (which means any process with access to hardware-accelerated rendering) can access the current screen framebuffer and modify it ad libitum. For backwards-compatibility reasons we want to keep the DRM_IOCTL_MODE_GETFB call unprivileged. Besides, it provides quite useful information regarding screen setup. So we simply test whether the caller is the current DRM-Master and if not, we return 0 as handle, which is always invalid. A following DRM_IOCTL_GEM_CLOSE on this handle will fail with EINVAL, but we accept this. Users shouldn't test for errors during GEM_CLOSE, anyway. And it is still better as a failing MODE_GETFB call. v2: add capable(CAP_SYS_ADMIN) check for compatibility with i-g-t Cc: <stable@vger.kernel.org> Signed-off-by: David Herrmann <dh.herrmann@gmail.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Dave Airlie <airlied@redhat.com>
2013-09-02drm/msm: convert to drm_bridgeRob Clark10-260/+274
Drop the msm_connector base class, and special calls to base class methods from the encoder, and use instead drm_bridge. This allows for a cleaner division between the hdmi (and in future dsi) blocks, from the mdp block. Signed-off-by: Rob Clark <robdclark@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>