Daniel Vetter
4a536934e6
drm/tegra: Use drm_fb_helper_fill_info
...
Another driver that didn't set fbinfo->fix.id before.
v2: Fix subject and rebase
Reviewed-by: Noralf Trønnes <noralf@tronnes.org >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Acked-by: Thierry Reding <treding@nvidia.com >
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Cc: Thierry Reding <thierry.reding@gmail.com >
Cc: Jonathan Hunter <jonathanh@nvidia.com >
Cc: linux-tegra@vger.kernel.org
Link: https://patchwork.freedesktop.org/patch/msgid/20190326132008.11781-18-daniel.vetter@ffwll.ch
2019-03-27 10:06:02 +01:00
Daniel Vetter
668447e5aa
drm/rockchip: Use drm_fb_helper_fill_info
...
This will set an fb name for the first time!
v2: Rebase
Reviewed-by: Noralf Trønnes <noralf@tronnes.org >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Heiko Stuebner <heiko@sntech.de >
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Cc: Sandy Huang <hjc@rock-chips.com >
Cc: "Heiko Stübner" <heiko@sntech.de >
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-rockchip@lists.infradead.org
Link: https://patchwork.freedesktop.org/patch/msgid/20190326132008.11781-17-daniel.vetter@ffwll.ch
2019-03-27 10:05:37 +01:00
Daniel Vetter
19d8a4e3d9
drm/radeon: Use drm_fb_helper_fill_info
...
This should not result in any changes.
v2: Rebase
Acked-by: Noralf Trønnes <noralf@tronnes.org >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Cc: Alex Deucher <alexander.deucher@amd.com >
Cc: "Christian König" <christian.koenig@amd.com >
Cc: "David (ChunMing) Zhou" <David1.Zhou@amd.com >
Cc: amd-gfx@lists.freedesktop.org
Link: https://patchwork.freedesktop.org/patch/msgid/20190326132008.11781-16-daniel.vetter@ffwll.ch
2019-03-27 10:05:18 +01:00
Daniel Vetter
e8f9ad5a00
drm/omap: Use drm_fb_helper_fill_info
...
This changes the fb name from "omapdrm" to "omapdrmfb".
v2: Rebase
Reviewed-by: Noralf Trønnes <noralf@tronnes.org >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190326132008.11781-15-daniel.vetter@ffwll.ch
2019-03-27 10:05:07 +01:00
Matteo Croce
14bc296466
drm/omap: fix typo
...
Fix spelling mistake: "lenght" -> "length"
Signed-off-by: Matteo Croce <mcroce@redhat.com >
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190107130934.9997-1-mcroce@redhat.com
2019-03-27 11:03:38 +02:00
Daniel Vetter
f243dd0618
drm/nouveau: Use drm_fb_helper_fill_info
...
This changes the fb name from "nouveaufb" to "nouveaudrmfb".
Aside: I wonder whether the in_interrupt() check is good enough for
the nouveau acceleration. Cargo-cult says drm_can_sleep() is needed,
which isn't actually working if you pick a .config without PREEMPT.
For the generic fbdev defio support we've gone with offloading
everything to a worker. For the non-accel callbacks (set_par, blank
and friends) checking for oops_in_progress is good enough to catch all
the evil calling contexts.
v2: Rebase
Acked-by: Noralf Trønnes <noralf@tronnes.org >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Cc: Ben Skeggs <bskeggs@redhat.com >
Cc: nouveau@lists.freedesktop.org
Link: https://patchwork.freedesktop.org/patch/msgid/20190326132008.11781-14-daniel.vetter@ffwll.ch
2019-03-27 10:03:16 +01:00
Daniel Vetter
d4eae71f81
drm/msm: Use drm_fb_helper_fill_info
...
This will change the fb name from "msm" to "msmdrmfb".
v2: Rebase
v3: Fix subject prefix (Noralf)
Reviewed-by: Noralf Trønnes <noralf@tronnes.org >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Cc: Rob Clark <robdclark@gmail.com >
Cc: linux-arm-msm@vger.kernel.org
Cc: freedreno@lists.freedesktop.org
Link: https://patchwork.freedesktop.org/patch/msgid/20190326132008.11781-13-daniel.vetter@ffwll.ch
2019-03-27 10:02:53 +01:00
Daniel Vetter
82367d80d8
drm/mga200g: Use drm_fb_helper_fill_info
...
Only changes the name of the fb from "mgadrmfb" to "mga200drmfb".
v2: Rebase
v3: Note the name change (Noralf)
Acked-by: Noralf Trønnes <noralf@tronnes.org >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Cc: Dave Airlie <airlied@redhat.com >
Cc: Alex Deucher <alexander.deucher@amd.com >
Cc: "Christian König" <christian.koenig@amd.com >
Cc: Junwei Zhang <Jerry.Zhang@amd.com >
Cc: Daniel Vetter <daniel.vetter@ffwll.ch >
Link: https://patchwork.freedesktop.org/patch/msgid/20190326132008.11781-12-daniel.vetter@ffwll.ch
2019-03-27 10:02:13 +01:00
Daniel Vetter
7a0f9ef970
drm/i915: Use drm_fb_helper_fill_info
...
This changes the fb name from "inteldrmfb" to "i915drmfb".
v2: Rebase
Reviewed-by: Noralf Trønnes <noralf@tronnes.org >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Cc: Jani Nikula <jani.nikula@linux.intel.com >
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com >
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com >
Cc: intel-gfx@lists.freedesktop.org
Link: https://patchwork.freedesktop.org/patch/msgid/20190326132008.11781-11-daniel.vetter@ffwll.ch
2019-03-27 09:58:07 +01:00
Daniel Vetter
2b617b1453
drm/hibmc: Use drm_fb_helper_fill_info
...
Should not result in any changes.
v2: Rebase
Acked-by: Noralf Trønnes <noralf@tronnes.org >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Cc: Alex Deucher <alexander.deucher@amd.com >
Cc: Junwei Zhang <Jerry.Zhang@amd.com >
Cc: Xinliang Liu <z.liuxinliang@hisilicon.com >
Cc: "Christian König" <christian.koenig@amd.com >
Cc: Ajit Negi <ajitn.linux@gmail.com >
Cc: Souptick Joarder <jrdr.linux@gmail.com >
Cc: Daniel Vetter <daniel.vetter@ffwll.ch >
Cc: John Garry <john.garry@huawei.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190326132008.11781-10-daniel.vetter@ffwll.ch
2019-03-27 09:57:48 +01:00
Daniel Vetter
dfec164ea9
drm/gma500: Use drm_fb_helper_fill_info
...
This will change the fb name from "psbdrmfb" to "gma500drmfb".
v2: Rebase
Acked-by: Noralf Trønnes <noralf@tronnes.org >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190326132008.11781-9-daniel.vetter@ffwll.ch
2019-03-27 09:57:28 +01:00
Daniel Vetter
fb68e5969f
drm/exynos: Use drm_fb_helper_fill_info
...
This will give the exynos fbdev a name!
v2: Rebase
Reviewed-by: Noralf Trønnes <noralf@tronnes.org >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Cc: Inki Dae <inki.dae@samsung.com >
Cc: Joonyoung Shim <jy0922.shim@samsung.com >
Cc: Seung-Woo Kim <sw0312.kim@samsung.com >
Cc: Kyungmin Park <kyungmin.park@samsung.com >
Cc: Kukjin Kim <kgene@kernel.org >
Cc: Krzysztof Kozlowski <krzk@kernel.org >
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-samsung-soc@vger.kernel.org
Link: https://patchwork.freedesktop.org/patch/msgid/20190326132008.11781-8-daniel.vetter@ffwll.ch
2019-03-27 09:57:17 +01:00
Daniel Vetter
f68aeae671
drm/cirrus: Use drm_fb_helper_fill_info
...
Should not result in any changes.
v2: Rebase
Acked-by: Noralf Trønnes <noralf@tronnes.org >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Cc: Gerd Hoffmann <kraxel@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190326132008.11781-7-daniel.vetter@ffwll.ch
2019-03-27 09:57:02 +01:00
Daniel Vetter
2f5791cd03
drm/ast: Use drm_fb_helper_fill_info
...
Should not result in any changes.
v2: Rebase
Acked-by: Noralf Trønnes <noralf@tronnes.org >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Cc: Dave Airlie <airlied@redhat.com >
Cc: Junwei Zhang <Jerry.Zhang@amd.com >
Cc: Alex Deucher <alexander.deucher@amd.com >
Cc: "Christian König" <christian.koenig@amd.com >
Cc: Daniel Vetter <daniel.vetter@ffwll.ch >
Cc: Sean Paul <sean@poorly.run >
Cc: YueHaibing <yuehaibing@huawei.com >
Cc: Sam Bobroff <sbobroff@linux.ibm.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190326132008.11781-6-daniel.vetter@ffwll.ch
2019-03-27 09:56:44 +01:00
Daniel Vetter
f21b6e47eb
drm/armada: Use drm_fb_helper_fill_info
...
Only changes the name of the fb from "armada-drmfb" to armadadrmfb.
v2: Rebase
v3: Fix commit message (Noralf)
Reviewed-by: Noralf Trønnes <noralf@tronnes.org >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Cc: Russell King <linux@armlinux.org.uk >
Link: https://patchwork.freedesktop.org/patch/msgid/20190326132008.11781-5-daniel.vetter@ffwll.ch
2019-03-27 09:56:14 +01:00
Daniel Vetter
bb1c08f982
drm/amdgpu: Use drm_fb_helper_fill_info
...
Should not cause any changes.
v2: Rebase
Reviewed-by: Noralf Trønnes <noralf@tronnes.org >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Cc: Alex Deucher <alexander.deucher@amd.com >
Cc: "Christian König" <christian.koenig@amd.com >
Cc: Samuel Li <Samuel.Li@amd.com >
Cc: "Michel Dänzer" <michel.daenzer@amd.com >
Cc: Huang Rui <ray.huang@amd.com >
Cc: Junwei Zhang <Jerry.Zhang@amd.com >
Cc: Daniel Vetter <daniel.vetter@ffwll.ch >
Cc: Daniel Stone <daniels@collabora.com >
Cc: Shirish S <shirish.s@amd.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190326132008.11781-4-daniel.vetter@ffwll.ch
2019-03-27 09:55:58 +01:00
Daniel Vetter
ecbfc474f0
drm/fb_helper: set info->par in fill_info()
...
The fbdev emulation helpers pretty much assume that this is set.
Let's do it for everyone.
Reviewed-by: Sam Ravnborg <sam@ravnborg.org >
Cc: Sam Ravnborg <sam@ravnborg.org >
Reviewed-by: Noralf Trønnes <noralf@tronnes.org >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Link: https://patchwork.freedesktop.org/patch/msgid/20190326132008.11781-3-daniel.vetter@ffwll.ch
2019-03-27 09:55:46 +01:00
Daniel Vetter
f1eca684b7
drm/fb-helper: set fbi->fix.id in fill_info()
...
Looking at the oldest/most popular drivers ${driver}drmfb seems to be
the standard, except i915.ko went with "inteldrmfb". I guess renaming
that for consistency won't hurt, it definitely confused me when I
started with kms 10 years ago.
I hope this never became uapi ... worst case drivers can overwrite it
after having called fill_info().
Since subsequent patches change this for some drivers later on in the
series, here's the exhaustive list of where all fix.id is used:
- /proc/fb which prints the minor number and fix.id name.
- per-fb sysfs name file
- getfix ioctl, which is used by fbset only to print out the name when
dumping information
- lots and lots of places in dmesg, anytime anything happens with an
fbdev really
I think minimal to 0 chances that changing this will screw up a config
script or something, since outside of informational message it's not
used by anything to identify which fbdev maps to which minor. After
all the last fbset release is from 1999, and that predates even devfs
I think.
v2: Rebase and amend commit message, thanks to Ilia for pointing out
that this needs to be spelled out.
Cc: Ilia Mirkin <imirkin@alum.mit.edu >
Reviewed-by: Noralf Trønnes <noralf@tronnes.org >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190326132008.11781-2-daniel.vetter@ffwll.ch
2019-03-27 09:55:27 +01:00
Daniel Vetter
3df3116ab4
drm/fb-helper: Add fill_info() functions
...
The fbdev split between fix and var information is kinda
pointless for drm drivers since everything is fixed: The fbdev
emulation doesn't support changing modes at all.
Create a new simplified helper and use it in the generic fbdev
helper code. Follow-up patches will beef it up more and roll
it out to all drivers.
v2: We need to keep sizes, since they might not match the fb dimensions
(Noralf)
v3: Fix typo in commit message and remove extraneous line in kerneldoc (Noralf)
Reviewed-by: Noralf Trønnes <noralf@tronnes.org >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Cc: Noralf Trønnes <noralf@tronnes.org >
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190326132008.11781-1-daniel.vetter@ffwll.ch
2019-03-27 09:54:57 +01:00
Dan Carpenter
71cd6cb234
drm/i915/selftests: Fix an IS_ERR() vs NULL check
...
The live_context() function returns error pointers. It never returns
NULL.
Fixes: 9c1477e83e
("drm/i915/selftests: Exercise adding requests to a full GGTT")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com >
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com >
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk >
Link: https://patchwork.freedesktop.org/patch/msgid/20190326050843.GA20038@kadam
(cherry picked from commit 602cbe8efc
)
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
2019-03-27 10:10:32 +02:00
Daniele Ceraolo Spurio
98721b84bc
drm/i915: fix i386 build of 64b raw_uncore functions
...
When building with ARCH=i386, readq and writeq are not defined,
resulting in:
intel_uncore.h: In function ‘__raw_uncore_read64’:
intel_uncore.h:257:9: error: implicit declaration of function ‘readq’;
did you mean ‘readl’? [-Werror=implicit-function-declaration]
return read##s__(uncore->regs + i915_mmio_reg_offset(reg)); \
^
and:
intel_uncore.h: In function ‘__raw_uncore_write64’:
intel_uncore.h:264:2: error: implicit declaration of function ‘writeq’;
did you mean ‘writel’? [-Werror=implicit-function-declaration]
write##s__(val, uncore->regs + i915_mmio_reg_offset(reg)); \
^
Add the io-64-nonatomic-lo-hi include to have readq and writeq available
for all builds. This header internally includes linux/io.h, so the
native readq and writeq definitions will be used when available.
Fixes: 6cc5ca7688
("drm/i915: rename raw reg access functions")
Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com >
Cc: Chris Wilson <chris@chris-wilson.co.uk >
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com >
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk >
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk >
Link: https://patchwork.freedesktop.org/patch/msgid/20190326233817.5417-1-daniele.ceraolospurio@intel.com
2019-03-27 07:48:54 +00:00
Chris Wilson
9511cb6481
drm/i915: Adding missing '; ' to ENGINE_INSTANCES
...
Tvrtko spotted that I left off the trailing ';'. It went unnoticed by CI
because despite adding the macro, we didn't add a user, so include one as
well (a simple debug print).
Reported-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Fixes: 97ee6e9255
("drm/i915: stop storing the media fuse")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk >
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190326180007.11722-1-chris@chris-wilson.co.uk
2019-03-26 21:09:23 +00:00
Michał Winiarski
e163484afa
drm/i915: Update size upon return from GEM_CREATE
...
Since GEM_CREATE is trying to outsmart the user by rounding up unaligned
objects, we used to update the size returned to userspace.
This update seems to have been lost throughout the history.
v2: Use round_up(), reorder locals (Chris)
References: ff72145bad
("drm: dumb scanout create/mmap for intel/radeon (v3)")
Signed-off-by: Michał Winiarski <michal.winiarski@intel.com >
Cc: Chris Wilson <chris@chris-wilson.co.uk >
Cc: Janusz Krzysztofik <janusz.krzysztofik@intel.com >
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com >
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk >
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk >
Link: https://patchwork.freedesktop.org/patch/msgid/20190326170218.13255-1-michal.winiarski@intel.com
2019-03-26 20:24:44 +00:00
Daniele Ceraolo Spurio
baba6e572b
drm/i915: take a reference to uncore in the engine and use it
...
A few advantages:
- Prepares us for the planned split of display uncore from GT uncore
- Improves our engine-centric view of the world in the engine code
and allows us to avoid jumping back to dev_priv.
- Allows us to wrap accesses to engine register in nice macros that
automatically pick the right mmio base.
Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com >
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com >
Cc: Chris Wilson <chris@chris-wilson.co.uk >
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk >
Link: https://patchwork.freedesktop.org/patch/msgid/20190325214940.23632-10-daniele.ceraolospurio@intel.com
2019-03-26 20:20:40 +00:00
Daniele Ceraolo Spurio
97a04e0d07
drm/i915: switch intel_wait_for_register to uncore
...
The intel_uncore structure is the owner of register access, so
subclass the function to it.
While at it, use a local uncore var and switch to the new read/write
functions where it makes sense.
Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com >
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com >
Cc: Chris Wilson <chris@chris-wilson.co.uk >
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk >
Link: https://patchwork.freedesktop.org/patch/msgid/20190325214940.23632-9-daniele.ceraolospurio@intel.com
2019-03-26 20:20:24 +00:00
Daniele Ceraolo Spurio
d2d551c06f
drm/i915: intel_wait_for_register_fw to uncore
...
The intel_uncore structure is the owner of register access, so
subclass the function to it.
While at it, use a local uncore var and switch to the new read/write
functions where it makes sense.
Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com >
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com >
Cc: Chris Wilson <chris@chris-wilson.co.uk >
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk >
Link: https://patchwork.freedesktop.org/patch/msgid/20190325214940.23632-8-daniele.ceraolospurio@intel.com
2019-03-26 20:16:45 +00:00
Daniele Ceraolo Spurio
4319382e9b
drm/i915: switch intel_uncore_forcewake_for_reg to intel_uncore
...
The intel_uncore structure is the owner of FW, so subclass the
function to it.
While at it, use a local uncore var and switch to the new read/write
functions where it makes sense.
Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com >
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com >
Cc: Chris Wilson <chris@chris-wilson.co.uk >
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk >
Link: https://patchwork.freedesktop.org/patch/msgid/20190325214940.23632-7-daniele.ceraolospurio@intel.com
2019-03-26 20:16:31 +00:00
Daniele Ceraolo Spurio
a2b4abfc62
drm/i915: switch uncore mmio funcs to use intel_uncore
...
The full read/write ops can now work on the intel_uncore struct.
Introduce intel_uncore_read/write functions working on intel_uncore
and switch the I915_READ/WRITE macro to internally call those.
v2: no change
v3: add intel_uncore_read/write functions (Chris), update commit msg
Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com >
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com >
Cc: Chris Wilson <chris@chris-wilson.co.uk >
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk >
Link: https://patchwork.freedesktop.org/patch/msgid/20190325214940.23632-6-daniele.ceraolospurio@intel.com
2019-03-26 20:16:13 +00:00
Daniele Ceraolo Spurio
eb17af67eb
drm/i915: take a ref to the rpm in the uncore structure
...
Remove a bit of pointer dancing in the reg access path.
Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com >
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com >
Cc: Chris Wilson <chris@chris-wilson.co.uk >
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk >
Link: https://patchwork.freedesktop.org/patch/msgid/20190325214940.23632-5-daniele.ceraolospurio@intel.com
2019-03-26 20:16:04 +00:00
Daniele Ceraolo Spurio
2cf7bf6f2f
drm/i915: add uncore flags for unclaimed mmio
...
Save the HW capabilities to avoid having to jump back to dev_priv
every time.
Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com >
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com >
Cc: Chris Wilson <chris@chris-wilson.co.uk >
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com >
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk >
Link: https://patchwork.freedesktop.org/patch/msgid/20190325214940.23632-4-daniele.ceraolospurio@intel.com
2019-03-26 19:30:59 +00:00
Daniele Ceraolo Spurio
5a0ba77709
drm/i915: add HAS_FORCEWAKE flag to uncore
...
We have several cases where we don't have forcewake (older gens, GVT and
planned display-only uncore), so, instead of checking every time against
the various condition, save the info in a flag and use that.
Note that this patch also change the behavior for gen5 with vpgu
enabled, but this is not an issue since we don't support vgpu on gen5.
v2: split out from previous path, fix check for missing case (Paulo)
v3: Inline helper for clarity in testing flags
Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com >
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com >
Cc: Chris Wilson <chris@chris-wilson.co.uk >
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com >
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk >
Link: https://patchwork.freedesktop.org/patch/msgid/20190325214940.23632-3-daniele.ceraolospurio@intel.com
2019-03-26 19:25:49 +00:00
Daniele Ceraolo Spurio
6cc5ca7688
drm/i915: rename raw reg access functions
...
They now work on uncore, so use raw_uncore_ prefix. Also move them to
uncore.h
Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com >
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com >
Cc: Chris Wilson <chris@chris-wilson.co.uk >
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com >
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk >
Link: https://patchwork.freedesktop.org/patch/msgid/20190325214940.23632-2-daniele.ceraolospurio@intel.com
2019-03-26 19:15:15 +00:00
Lucas De Marchi
077973c8c3
drm/i915/icl: reduce pll_id scope and use enum type
...
Now that pll_id is not used anymore for combophy, reduce its scope.
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190322223751.22089-6-lucas.demarchi@intel.com
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
2019-03-26 09:30:12 -07:00
Lucas De Marchi
02c99d26f5
drm/i915/icl: use previous pll hw readout
...
By the time icl_ddi_clock_get() is called we've just got the hw state
from the pll registers. We don't need to read them again: we can rather
reuse what was cached in the dpll_hw_state.
While at it, s/refclk/ref_clock/ just to be consistent with the name
used in code nearby.
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190322223751.22089-5-lucas.demarchi@intel.com
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
2019-03-26 09:30:12 -07:00
Lucas De Marchi
5e65216d8d
drm/i915/cnl: use previous pll hw readout
...
By the time cnl_ddi_clock_get() is called we've just got the hw state
from the pll registers. We don't need to read them again: we can rather
reuse what was cached in the dpll_hw_state.
This also affects the code for ICL since it partially reuses the CNL
code. However the more intricate part on ICL is left for another patch.
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190322223751.22089-4-lucas.demarchi@intel.com
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
2019-03-26 09:30:12 -07:00
Lucas De Marchi
47c9877e9b
drm/i915/bxt: make bxt_calc_pll_link() similar to skl
...
Rename state to pll_state and use it as the argument to
bxt_calc_pll_link(), similar to how it's done in the skl variant.
The WARN_ON(!crtc_state->shared_dpll) is not very useful, so remove it
as well.
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190322223751.22089-3-lucas.demarchi@intel.com
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
2019-03-26 09:30:12 -07:00
Lucas De Marchi
947f441746
drm/i915/skl: use previous pll hw readout
...
By the time skl_ddi_clock_get() is called - and thus
skl_calc_wrpll_link() - we've just got the hw state from the pll
registers. We don't need to read them again: we can rather reuse what
was cached in the dpll_hw_state.
v2: rename state variable to pll_state, make argument const in
skl_calc_wrpll_link() and remove not useful warning (from Ville)
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com >
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190322223751.22089-2-lucas.demarchi@intel.com
2019-03-26 09:30:12 -07:00
Daniel Vetter
8782c647ae
drm/fbdev: Make skip_vt_switch the default
...
KMS drivers really should all be able to restore their display state
on resume without fbcon helping out. So make this the default.
Since I'm not entirely foolish, make it only a default, which drivers
can still override. That way when the inevitable regression report
happens I can fix things up with a one-liner plus FIXME comment that
someone should fix up the suspend/resume code in that driver.
But at least all new drivers won't be broken by accident as soon as
you turn off fbcon because "suspend/resume worked when I tested it".
v2: Keep this for radeon because of
commit 18c437caa5
Author: Alex Deucher <alexander.deucher@amd.com >
Date: Tue Nov 14 17:19:29 2017 -0500
Revert "drm/radeon: dont switch vt on suspend"
Thanks to Michel Dänzer for pointing this one out.
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Cc: Michel Dänzer <michel@daenzer.net >
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Cc: Maxime Ripard <maxime.ripard@bootlin.com >
Cc: Sean Paul <sean@poorly.run >
Cc: David Airlie <airlied@linux.ie >
Cc: Jani Nikula <jani.nikula@linux.intel.com >
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com >
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com >
Cc: Ben Skeggs <bskeggs@redhat.com >
Cc: Sandy Huang <hjc@rock-chips.com >
Cc: "Heiko Stübner" <heiko@sntech.de >
Cc: Alex Deucher <alexander.deucher@amd.com >
Cc: "Christian König" <christian.koenig@amd.com >
Cc: Samuel Li <Samuel.Li@amd.com >
Cc: "Michel Dänzer" <michel.daenzer@amd.com >
Cc: Daniel Vetter <daniel.vetter@ffwll.ch >
Cc: Junwei Zhang <Jerry.Zhang@amd.com >
Cc: Huang Rui <ray.huang@amd.com >
Cc: Shirish S <shirish.s@amd.com >
Cc: Daniel Stone <daniels@collabora.com >
Cc: "Noralf Trønnes" <noralf@tronnes.org >
Cc: intel-gfx@lists.freedesktop.org
Cc: nouveau@lists.freedesktop.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-rockchip@lists.infradead.org
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Acked-by: Heiko Stuebner <heiko@sntech.de >
Tested-by: Heiko Stuebner <heiko@sntech.de >
Reviewed-by: Samuel Li <samuel.li@amd.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20181127173424.301-1-daniel.vetter@ffwll.ch
2019-03-26 16:24:26 +01:00
Dan Carpenter
602cbe8efc
drm/i915/selftests: Fix an IS_ERR() vs NULL check
...
The live_context() function returns error pointers. It never returns
NULL.
Fixes: 9c1477e83e
("drm/i915/selftests: Exercise adding requests to a full GGTT")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com >
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com >
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk >
Link: https://patchwork.freedesktop.org/patch/msgid/20190326050843.GA20038@kadam
2019-03-26 14:53:01 +00:00
Ville Syrjälä
4b9a3932e7
drm/i915: Mark AML 0x87CA as ULX
...
If I'm reading the spec right AML 0x87CA is a Y SKU, so it
should be marked as ULX in our old style terminology.
Cc: stable@vger.kernel.org
Cc: José Roberto de Souza <jose.souza@intel.com >
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com >
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Fixes: c0c46ca461
("drm/i915/aml: Add new Amber Lake PCI ID")
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190322204944.23613-1-ville.syrjala@linux.intel.com
Reviewed-by: José Roberto de Souza <jose.souza@intel.com >
(cherry picked from commit 57b1c4460d
)
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
2019-03-26 10:44:55 +02:00
Daniele Ceraolo Spurio
97ee6e9255
drm/i915: stop storing the media fuse
...
We're already updating the engine_mask to reflect what's in the HW, so
we can just get the info from there. A couple of macros have been added
to facilitate this.
v2: Appease checkpatch
Suggested-by: Chris Wilson <chris@chris-wilson.co.uk >
Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com >
Cc: Chris Wilson <chris@chris-wilson.co.uk >
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com >
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk >
Reviewed-by: Michal Wajdeczko <michal.wajdeczko@intel.com >
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk >
Link: https://patchwork.freedesktop.org/patch/msgid/20190322002431.9585-1-daniele.ceraolospurio@intel.com
2019-03-25 21:09:26 +00:00
Dave Airlie
de53874a0f
Merge tag 'drm-misc-fixes-2019-03-25' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes
...
- A bunch of fixes to cleanup path in meson
- Fix the DMT TDMS clock filtering on meson
- Fix an issue with NV12 buffers on rockchip when scaling is active
- Fix a couple of use-after-free
Signed-off-by: Dave Airlie <airlied@redhat.com >
From: Maxime Ripard <maxime.ripard@bootlin.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190325104523.obnfelgvaglyhe5e@flea
2019-03-26 06:32:09 +10:00
Jani Nikula
b024ab9b2d
drm/i915/bios: iterate over child devices to initialize ddi_port_info
...
Iterate over child devices instead of ports in parse_ddi_ports() to
initialize ddi_port_info. We'll eventually need to decide some stuff
based on the child device order, which may be different from the port
order.
As a bonus, this allows better abstractions for e.g. dvo port mapping.
There's a subtle change in the DDC pin and AUX channel sanitization as
we change the order. Otherwise, this should not change behaviour.
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190322121008.4456-1-jani.nikula@intel.com
2019-03-25 15:16:33 +02:00
Neil Armstrong
836f90f9e2
drm/bridge: dw-hdmi: disable SCDC configuration for invalid setups
...
This patch is an attempt to limit HDMI 2.0 SCDC setup when :
- the SoC embeds an HDMI 1.4 only controller
- the EDID supports SCDC but not scrambling
- the EDID supports SCDC scrambling but not for low TMDS bit rates,
while only supporting low TMDS bit rates
This to avoid communicating with the SCDC DDC slave uncessary, and
setting the DW-HDMI TMDS Scrambler setup when not supported by the
underlying hardware.
Reported-by: Rob Herring <robh@kernel.org >
Fixes: 264fce6cc2
("drm/bridge: dw-hdmi: Add SCDC and TMDS Scrambling support")
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com >
Tested-by: Rob Herring <robh@kernel.org >
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190315095414.28520-1-narmstrong@baylibre.com
2019-03-25 13:15:00 +01:00
Neil Armstrong
3d565a21f2
drm/meson: fix TMDS clock filtering for DMT monitors
...
DMT monitors does not necessarely report a maximum TMDS clock
in a VSDB EDID extension.
In this case, all modes are wrongly rejected, including
the DRM fallback EDID.
This patch only rejects modes whith clock > max_tmds_clock if
the max_tmds_clock is specified. This will only reject
4:2:0 HDMI2.0 modes, who reports a clock > max_tmds_clock.
Reported-by: Maxime Jourdan <mjourdan@baylibre.com >
Fixes: d7d8fb7046
("drm/meson: add HDMI div40 TMDS mode")
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com >
Tested-by: Maxime Jourdan <mjourdan@baylibre.com >
Reviewed-by: Maxime Jourdan <mjourdan@baylibre.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190320081110.1718-1-narmstrong@baylibre.com
2019-03-25 11:19:50 +01:00
Jean-Philippe Brucker
2d8f92897a
drm/meson: Uninstall IRQ handler
...
meson_drv_unbind() doesn't unregister the IRQ handler, which can lead to
use-after-free if the IRQ fires after unbind:
[ 64.656876] Unable to handle kernel paging request at virtual address ffff000011706dbc
...
[ 64.662001] pc : meson_irq+0x18/0x30 [meson_drm]
I'm assuming that a similar problem could happen on the error path of
bind(), so uninstall the IRQ handler there as well.
Fixes: bbbe775ec5
("drm: Add support for Amlogic Meson Graphic Controller")
Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com >
Acked-by: Neil Armstrong <narmstrong@baylibre.com >
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190322152657.13752-2-jean-philippe.brucker@arm.com
2019-03-25 11:18:47 +01:00
Jean-Philippe Brucker
776e78677f
drm/meson: Fix invalid pointer in meson_drv_unbind()
...
meson_drv_bind() registers a meson_drm struct as the device's privdata,
but meson_drv_unbind() tries to retrieve a drm_device. This may cause a
segfault on shutdown:
[ 5194.593429] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000197
...
[ 5194.788850] Call trace:
[ 5194.791349] drm_dev_unregister+0x1c/0x118 [drm]
[ 5194.795848] meson_drv_unbind+0x50/0x78 [meson_drm]
Retrieve the right pointer in meson_drv_unbind().
Fixes: bbbe775ec5
("drm: Add support for Amlogic Meson Graphic Controller")
Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com >
Acked-by: Neil Armstrong <narmstrong@baylibre.com >
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190322152657.13752-1-jean-philippe.brucker@arm.com
2019-03-25 11:18:31 +01:00
Daniel Vetter
0bec6219e5
Merge tag 'drm-misc-next-2019-03-21' of git://anongit.freedesktop.org/drm/drm-misc into drm-next
...
drm-misc-next for 5.2:
UAPI Changes:
- Add Colorspace connector property (Uma)
- fourcc: Several new YUV formats from ARM (Brian & Ayan)
- fourcc: Fix merge conflicts between new formats above and Swati's that
went in via topic/hdr-formats-2019-03-07 branch (Maarten)
Cross-subsystem Changes:
- Typed component support via topic/component-typed-2019-02-11 (Maxime/Daniel)
Core Changes:
- Improve component helper documentation (Daniel)
- Avoid calling drm_dev_unregister() twice on unplugged devices (Noralf)
- Add device managed (devm) drm_device init function (Noralf)
- Graduate TINYDRM_MODE to DRM_SIMPLE_MODE in core (Noralf)
- Move MIPI/DSI rate control params computation into core from i915 (David)
- Add support for shmem backed gem objects (Noralf)
Driver Changes:
- various: Use of_node_name_eq for node name comparisons (Rob Herring)
- sun4i: Add DSI burst mode support (Konstantin)
- panel: Add Ronbo RB070D30 MIPI/DSI panel support (Konstantin)
- virtio: A few prime improvements (Gerd)
- tinydrm: Remove tinydrm_device (Noralf)
- vc4: Add load tracker to driver to detect underflow in atomic check (Boris)
- vboxvideo: Move it out of staging \o/ (Hans)
- v3d: Add support for V3D v4.2 (Eric)
Cc: Konstantin Sudakov <k.sudakov@integrasources.com >
Cc: Rob Herring <robh@kernel.org >
Cc: Daniel Vetter <daniel.vetter@ffwll.ch >
Cc: Maxime Ripard <maxime.ripard@bootlin.com >
Cc: Uma Shankar <uma.shankar@intel.com >
Cc: Noralf Trønnes <noralf@tronnes.org >
Cc: Gerd Hoffmann <kraxel@redhat.com >
Cc: David Francis <David.Francis@amd.com >
Cc: Boris Brezillon <boris.brezillon@bootlin.com >
Cc: Eric Anholt <eric@anholt.net >
Cc: Hans de Goede <hdegoede@redhat.com >
Cc: Brian Starkey <brian.starkey@arm.com >
Cc: Ayan Kumar Halder <ayan.halder@arm.com >
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch >
From: Sean Paul <sean@poorly.run >
Link: https://patchwork.freedesktop.org/patch/msgid/20190321170805.GA50145@art_vandelay
2019-03-25 11:05:12 +01:00
Chris Wilson
32c13bcd35
drm/i915: Report the correct errno from i915_gem_context_open()
...
Fixup the errno as we adjusted the error path to receive the errno and
not compute it itself from ERR_PTR(ctx) anymore.
drivers/gpu/drm/i915/i915_gem_context.c:793 i915_gem_context_open() warn: passing a valid pointer to 'PTR_ERR'
Reported-by: Dan Carpenter <dan.carpenter@oracle.com >
Fixes: 3aa9945a52
("drm/i915: Separate GEM context construction and registration to userspace")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk >
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20190325090413.19906-2-chris@chris-wilson.co.uk
2019-03-25 09:27:48 +00:00
Kangjie Lu
208c6e8cff
drm: vkms: check status of alloc_ordered_workqueue
...
alloc_ordered_workqueue may fail and return NULL.
The fix returns ENOMEM when it fails to avoid potential NULL
pointer dereference.
Signed-off-by: Kangjie Lu <kjlu@umn.edu >
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Link: https://patchwork.freedesktop.org/patch/msgid/20190309043628.6078-1-kjlu@umn.edu
2019-03-25 09:33:42 +01:00