- 02 Apr, 2014 4 commits
-
-
Matt Roper authored
Add a new drm_crtc_init_with_planes() to allow drivers to provide specific primary and cursor planes at CRTC initialization. The existing drm_crtc_init() interface remains to avoid driver churn in existing drivers; it will initialize the CRTC with a plane helper-created primary plane and no cursor plane. v2: - Move drm_crtc_init() to plane helper file so that nothing in the DRM core depends on helpers. [suggested by Daniel Vetter] - Keep cursor parameter to drm_crtc_init_with_planes() a void* until we actually add cursor support. [suggested by Daniel Vetter] Signed-off-by:
Matt Roper <matthew.d.roper@intel.com> Reviewed-by:
Rob Clark <robdclark@gmail.com>
-
Rob Clark authored
Add a plane type property to allow userspace to distinguish plane types. v2: Driver-specific churn eliminated now that drm_plane_init() and drm_universal_plane_init() were separated out in a previous patch. Signed-off-by:
Matt Roper <matthew.d.roper@intel.com> Reviewed-by:
Rob Clark <robdclark@gmail.com>
-
Matt Roper authored
Add a new plane initialization interface for universal plane support that allows a specific plane type (primary, cursor, or overlay) to be specified. drm_plane_init() remains as a compatibility API to reduce churn in existing drivers. The 'bool priv' parameter has been changed to 'bool is_primary' under the assumption that all existing uses of private planes were representing primary planes. Signed-off-by:
Matt Roper <matthew.d.roper@intel.com> Reviewed-by:
Rob Clark <robdclark@gmail.com>
-
Matt Roper authored
This function will be used by the universal plane helpers and may also be useful for individual drivers. Signed-off-by:
Matt Roper <matthew.d.roper@intel.com> Reviewed-by:
Rob Clark <robdclark@gmail.com>
-
- 01 Apr, 2014 1 commit
-
-
Matt Roper authored
The DRM core currently only tracks "overlay"-style planes. Start refactoring the plane handling to allow other plane types (primary and cursor) to also be placed on the DRM plane list. v2: Add drm_for_each_legacy_plane() iterator to smooth transition of drivers with plane loops. Signed-off-by:
Matt Roper <matthew.d.roper@intel.com> Reviewed-by:
Rob Clark <robdclark@gmail.com>
-
- 28 Mar, 2014 2 commits
-
-
Thomas Hellstrom authored
Add a drm_is_legacy() helper, constify argument to drm_is_render_client(), and use / change helpers where appropriate. v2: s/drm_is_legacy/drm_is_legacy_client/ and adapt to new code context. v3: s/legacy_client/primary_client/ Signed-off-by:
Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by:
Brian Paul <brianp@vmware.com>
-
Thomas Hellstrom authored
control- and render nodes are intended to be master-less. v2: Replace tests for !legacy with tests for !mode_group for readability. Signed-off-by:
Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by:
David Herrmann <dh.herrmann@gmail.com>
-
- 16 Mar, 2014 1 commit
-
-
David Herrmann authored
Lets make sure some basic expressions are always true: bpp != NULL width != NULL height != NULL stride = bpp * width < 2^32 size = stride * height < 2^32 PAGE_ALIGN(size) < 2^32 At least the udl driver doesn't check for multiplication-overflows, so lets just make sure it will never happen. These checks allow drivers to do any 32bit math without having to test for mult-overflows themselves. The two divisions might hurt performance a bit, but dumb_create() is only used for scanout-buffers, so that should be fine. We could use 64bit math to avoid the divisions, but that may be slow on 32bit machines.. Or maybe there should just be a "safe_mult32()" helper, which currently doesn't exist (I think?). Reviewed-by:
Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by:
David Herrmann <dh.herrmann@gmail.com>
-
- 13 Mar, 2014 4 commits
-
-
Daniel Vetter authored
- Standardized on "Returns:" Block. - Sprinkle missing kerneldoc over all exported functions and all ioctls. - Add a stern warning that driver's really shouldn't use drm_mode_group_init_legacy_group. - Usual attempt at more consistency. - Add warnings that drm_mode_object_get/put don't do refcounting, despite what the names might lead to believe. - Try to clarify the framebuffer setup/cleanup functions wrt driver private framebuffers - I've fallen recently over this when reviewing i915 fbdev patches. - Align function parameters where the kerneldoc has been updated. - Most of the drm_get_*_name functions aren't thread safe. Add stern warnings where this is the case. Since a lot of the functions in drm_crtc.c are boilerplate to handle properties and create default sets of them it might be useful to extract all that code into a new file drm_property.c. Especially since properties will be used a lot more in the future. Reviewed-by:
Alex Deucher <alexander.deucher@amd.com> Signed-off-by:
Daniel Vetter <daniel.vetter@ffwll.ch>
-
Daniel Vetter authored
Makes more sense and gives better grouping in the DocBook function reference sections. To make this possible we need to expose two functions from drm_crtc.c though. To avoid further namespace pollution in the system wide headers create a new internal header for such drm internal symbols. I expect that longer-term we'll add tons more, but since my goal here is to polish the kerneldoc that's for another day. Reviewed-by:
Alex Deucher <alexander.deucher@amd.com> Signed-off-by:
Daniel Vetter <daniel.vetter@ffwll.ch>
-
Daniel Vetter authored
There's not really any value in stating that no locking is needed. And even if the comment is useful, a check for the right mutex at the beginning of the function is better since that can't be ingored as easily as a bit of documentation. Note that drm_mode_probed_add in drm_crtc.c is also changed, the next patch will move this into drm_modes.c v2: Don't add locking WARN_ONs where it is not strictly required (i.e. the two functions to validate/prune mode lists). Reviewed-by:
Alex Deucher <alexander.deucher@amd.com> Signed-off-by:
Daniel Vetter <daniel.vetter@ffwll.ch>
-
Daniel Vetter authored
It's only used by imx, and that one gets it wrong - there's no need to deteach the encoder before removing it. And really, neither current drm modesetting code nor all the userspace we have can handle dynamic changes in the set of possible encoders for a given connector. So let's just remove this before someone starts doing something really nasty with it. As a plus, one less kerneldoc comment to write. Cc: Sascha Hauer <s.hauer@pengutronix.de> Cc: Russell King <rmk+kernel@arm.linux.org.uk> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Reviewed-by:
Alex Deucher <alexander.deucher@amd.com> Signed-off-by:
Daniel Vetter <daniel.vetter@ffwll.ch>
-
- 12 Feb, 2014 1 commit
-
-
Jesse Barnes authored
Just like we have for connector type etc. v2: drop static array (Chris) v3: add kdoc (Daniel) Signed-off-by:
Jesse Barnes <jbarnes@virtuousgeek.org> Acked-by:
Dave Airlie <airlied@gmail.com> Signed-off-by:
Daniel Vetter <daniel.vetter@ffwll.ch>
-
- 14 Jan, 2014 1 commit
-
-
Russell King authored
The encoder possible_crtcs mask identifies which CRTCs can be bound to a particular encoder. Each bit from bit 0 defines an index in the list of CRTCs held in the DRM mode_config crtc_list. Rather than having drivers trying to track the position of their CRTCs in the list, expose the code which already exists for calculating the appropriate mask bit for a CRTC. Signed-off-by:
Russell King <rmk+kernel@arm.linux.org.uk> Reviewed-by:
David Herrmann <dh.herrmann@gmail.com> Reviewed-by:
Jani Nikula <jani.nikula@intel.com> [treding@nvidia.com: add drm_crtc_index(), move to core] Signed-off-by:
Thierry Reding <treding@nvidia.com>
-
- 18 Dec, 2013 1 commit
-
-
Ville Syrjälä authored
Not all drivers will need take all the modeset locks for dirtyfb, so push the locking down to the drivers. Signed-off-by:
Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by:
Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by:
Jakob Bornecrantz <jakob@vmware.com> Signed-off-by:
Dave Airlie <airlied@redhat.com>
-
- 06 Nov, 2013 3 commits
-
-
Ville Syrjälä authored
drm_fb_get_bpp_depth() likes to complain about unsupported pixel formats but doesn't bother telling us what the format was. Also format_check() just returns an error when it encouters an invalid format, leaving the user scratching his head trying to figure out why addfb failed. Make life a bit easier by using drm_get_format_name() in both places. Signed-off-by:
Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by:
Alex Deucher <alexander.deucher@amd.com> Reviewed-by:
Damien Lespiau <damien.lespiau@intel.com> Signed-off-by:
Dave Airlie <airlied@redhat.com>
-
Ville Syrjälä authored
Return -ENOENT for framebuffers like we do for other mode objects that can't be found. Signed-off-by:
Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by:
Dave Airlie <airlied@redhat.com>
-
Ville Syrjälä authored
We tend to return -EINVAL for everything. Let's try to help poor userland developers a bit by at least returning -ENONET for missing objects. 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>
-
- 23 Oct, 2013 1 commit
-
-
Marc-André Lureau authored
Fix a little spelling of drm_crtc_convert_umode() comment. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by:
Dave Airlie <airlied@redhat.com>
-
- 01 Oct, 2013 6 commits
-
-
Damien Lespiau authored
The kernel shouldn't accept invalid modes, just say No. Signed-off-by:
Damien Lespiau <damien.lespiau@intel.com> Reviewed-by:
Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by:
Daniel Vetter <daniel.vetter@ffwll.ch>
-
Damien Lespiau authored
Now that the coding of stereo layout has changed from a bit field to an enum, we need remove that check. Signed-off-by:
Damien Lespiau <damien.lespiau@intel.com> Reviewed-by:
Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by:
Daniel Vetter <daniel.vetter@ffwll.ch>
-
Damien Lespiau authored
Some stereo modes, like frame packing, need a larger CRTC viewport than the "natural" underlying 2D mode and thus drm_crtc_check_viewport() needs to query the adjusted mode to use the correct h/vdisplay. Reviewed-by:
Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by:
Damien Lespiau <damien.lespiau@intel.com> Acked-by:
Dave Airlie <airlied@gmail.com> Signed-off-by:
Daniel Vetter <daniel.vetter@ffwll.ch>
-
Damien Lespiau authored
Both setcrtc and page_flip are checking that the framebuffer is big enough for the defined crtc viewport (x, y, hdisplay, vdisplay). Factor that code out in a single function. Reviewed-by:
Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by:
Damien Lespiau <damien.lespiau@intel.com> Acked-by:
Dave Airlie <airlied@gmail.com> Signed-off-by:
Daniel Vetter <daniel.vetter@ffwll.ch>
-
Damien Lespiau authored
When setting a stereo 3D mode, there can be only one bit set describing the layout of the frambuffer(s). So reject invalid modes early. Reviewed-by:
Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by:
Damien Lespiau <damien.lespiau@intel.com> Acked-by:
Dave Airlie <airlied@gmail.com> Signed-off-by:
Daniel Vetter <daniel.vetter@ffwll.ch>
-
Damien Lespiau authored
This capability allows user space to control the delivery of modes with the 3D flags set. This is to not play games with current user space users not knowing anything about stereo 3D flags and that could try to set a mode with one or several of those bits set. So, the plan is to remove the stereo modes from the list of modes we give to DRM clients by default, and let them through if we are being told otherwise. stereo_allowed is bound to the drm_file structure to make it a per-client setting, not a global one. v2: Replace clearing 3D flags by discarding the stereo modes now that they are regular modes. v3: SET_CAP -> SET_CLIENT_CAP rename (Chris Wilson) Reviewed-by:
Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by:
Damien Lespiau <damien.lespiau@intel.com> Acked-by:
Dave Airlie <airlied@gmail.com> Signed-off-by:
Daniel Vetter <daniel.vetter@ffwll.ch>
-
- 04 Sep, 2013 1 commit
-
-
Shobhit Kumar authored
Signed-off-by:
Shobhit Kumar <shobhit.kumar@intel.com> Signed-off-by:
Jani Nikula <jani.nikula@intel.com> Acked-by:
Dave Airlie <airlied@gmail.com> Reviewed-by:
Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by:
Daniel Vetter <daniel.vetter@ffwll.ch>
-
- 02 Sep, 2013 2 commits
-
-
David Herrmann authored
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 a14b1b42 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>
-
Sean Paul authored
This patch adds the notion of a drm_bridge. A bridge is a chained device which hangs off an encoder. The drm driver using the bridge should provide the association between encoder and bridge. Once a bridge is associated with an encoder, it will participate in mode set, and dpms (via the enable/disable hooks). Signed-off-by:
Sean Paul <seanpaul@chromium.org> Acked-by:
Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by:
Rob Clark <robdclark@gmail.com> Signed-off-by:
Dave Airlie <airlied@redhat.com>
-
- 29 Aug, 2013 2 commits
-
-
Keith Packard authored
Let applications know whether the kernel supports asynchronous page flipping. Signed-off-by:
Keith Packard <keithp@keithp.com> Signed-off-by:
Dave Airlie <airlied@gmail.com>
-
Keith Packard authored
This lets drivers see the flags requested by the application [airlied: fixup for rcar/imx/msm] Signed-off-by:
Keith Packard <keithp@keithp.com> Signed-off-by:
Dave Airlie <airlied@gmail.com>
-
- 21 Aug, 2013 2 commits
-
-
Lespiau, Damien authored
It's only used in drm_crtc.c. Signed-off-by:
Damien Lespiau <damien.lespiau@intel.com> Reviewed-by:
Alex Deucher <alexander.deucher@amd.com> Signed-off-by:
Dave Airlie <airlied@redhat.com>
-
Lespiau, Damien authored
This was last used by nouveau, replaced by a driver-specific property in: commit de691855 Author: Ben Skeggs <bskeggs@redhat.com> Date: Mon Oct 17 12:23:41 2011 +1000 drm/nouveau: improve dithering properties, and implement proper auto mode Signed-off-by:
Damien Lespiau <damien.lespiau@intel.com> Reviewed-by:
Alex Deucher <alexander.deucher@amd.com> Signed-off-by:
Dave Airlie <airlied@redhat.com>
-
- 19 Aug, 2013 1 commit
-
-
Ilia Mirkin authored
This makes it so that reloading a module does not cause all the connector ids to change, which are user-visible and sometimes used for configuration. Signed-off-by:
Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by:
Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by:
Dave Airlie <airlied@redhat.com>
-
- 27 Jun, 2013 1 commit
-
-
Dave Airlie authored
So it looks like for virtual hw cursors on QXL we need to inform the "hw" device what the cursor hotspot parameters are. This makes sense if you think the host has to draw the cursor and interpret clicks from it. However the current modesetting interface doesn't support passing the hotspot information from userspace. This implements a new cursor ioctl, that takes the hotspot info as well, userspace can try calling the new interface and if it gets -ENOSYS it means its on an older kernel and can just fallback. Reviewed-by:
Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by:
Dave Airlie <airlied@redhat.com>
-
- 25 Jun, 2013 2 commits
-
-
Daniel Vetter authored
Drivers are allowed (actually have to) disable unrelated crtcs in their ->set_config callback (when we steal all the connectors from that crtc). If they do that they'll clear crtc->fb to NULL. Which results in a refcount leak, since the drm core is keeping track of that reference. To fix this track the old fb of all crtcs and adjust references for all of them. Of course, since we only hold an additional reference for the fb for the current crtc we need to increase refcounts before we drop the old one. This approach has the benefit that it inches us a bit closer to an atomic modeset world, where we want to update the config of all crtcs in one step. This regression has been introduce in the framebuffer refcount conversion, specifically in commit b0d12325 Author: Daniel Vetter <daniel.vetter@ffwll.ch> Date: Tue Dec 11 01:07:12 2012 +0100 drm: refcounting for crtc framebuffers Reported-by:
Russell King <linux@arm.linux.org.uk> Cc: Russell King <linux@arm.linux.org.uk> Cc: stable@vger.kernel.org Signed-off-by:
Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by:
Dave Airlie <airlied@redhat.com>
-
Daniel Vetter authored
Historically drm lacked fb refcounting, so the updating of crtc->fb was done by the lower levels at a point convenient to get their own refcounting (e.g. refcounts for the underlying gem bo, pinning refcounts) right. With the introduction of refcounted fbs the drm core handled the fb refcounts, but still relied on drivers to update the crtc->fb pointer (this approach required the least invasive changes in drivers). Enforce this contract with a WARN_ON. Signed-off-by:
Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by:
Dave Airlie <airlied@redhat.com>
-
- 17 Jun, 2013 3 commits
-
-
Ville Syrjälä authored
There's a bunch of unused members inside drm_plane, bloating the size of the structure needlessly. Eliminate them. v2: Remove all of it from kernel-doc too Reviewed-by:
Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by:
Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by:
Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by:
Dave Airlie <airlied@gmail.com>
-
Ville Syrjälä authored
v2: Follow the drm_crtc documentation fixes Signed-off-by:
Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by:
Dave Airlie <airlied@gmail.com>
-
Ville Syrjälä authored
drm_plane_force_disable() will forcibly disable the plane even if user had previously requested the plane to be enabled. This can be used to force planes to be off when restoring the fbdev mode. The code was simply pulled from drm_framebuffer_remove(), which now calls the new function as well. v2: Check plane->fb in drm_plane_force_disable(), drop bogus comment about disabling crtc Signed-off-by:
Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by:
Dave Airlie <airlied@gmail.com>
-
- 10 Jun, 2013 1 commit
-
-
Ville Syrjälä authored
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>
-