[RFCv3 12/14] drm: Atomic modeset ioctl
Rob Clark
robdclark at gmail.com
Fri Nov 22 04:34:42 PST 2013
On Fri, Nov 22, 2013 at 3:35 AM, Inki Dae <inki.dae at samsung.com> wrote:
> Hi Rob and Ville,
>
>
> 2013/11/21 Rob Clark <robdclark at gmail.com>:
>> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
>>
>> The atomic modeset ioctl cna be used to push any number of new values
>> for object properties. The driver can then check the full device
>> configuration as single unit, and try to apply the changes atomically.
>>
>> The ioctl simply takes a list of object IDs and property IDs and their
>> values. For setting values to blob properties, the property value
>> indicates the length of the data, and the actual data is passed via
>> another blob pointer.
>>
>> The caller can demand non-blocking operation from the ioctl, and if the
>> driver can't satisfy that requirement an error will be returned.
>>
>> The caller can also request to receive asynchronous completion events
>> after the operation has reached the hardware. An event is sent for each
>> object specified by the caller, whether or not the actual state of
>> that object changed. Each event also carries a framebuffer ID, which
>> indicates to user space that the specified object is no longer
>> accessing that framebuffer.
>>
>> TODO: detailed error reporting?
>>
>> v1: original
>> v2: rebase on uapi changes, and drm state structs.. -- Rob Clark
>> v3: rebase, missing padding in drm_event_atomic.. -- Rob Clark
>> v4: drop atomic event, align flags w/ pageflip (atomic flags should be
>> a strick superset of pageflip flags to keep things easier for the
>> drivers)
>>
>> Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
>> ---
>> drivers/gpu/drm/drm_crtc.c | 157 +++++++++++++++++++++++++++++++++++++++++++-
>> drivers/gpu/drm/drm_drv.c | 1 +
>> include/drm/drmP.h | 6 ++
>> include/drm/drm_crtc.h | 2 +
>> include/uapi/drm/drm.h | 12 ++++
>> include/uapi/drm/drm_mode.h | 21 ++++++
>> 6 files changed, 198 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
>> index 4b40a39..8368ef5 100644
>> --- a/drivers/gpu/drm/drm_crtc.c
>> +++ b/drivers/gpu/drm/drm_crtc.c
>> @@ -4037,7 +4037,8 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev,
>> return -ENOENT;
>> crtc = obj_to_crtc(obj);
>>
>> - state = dev->driver->atomic_begin(dev, page_flip->flags);
>> + state = dev->driver->atomic_begin(dev,
>> + page_flip->flags | DRM_MODE_ATOMIC_NONBLOCK);
>> if (IS_ERR(state))
>> return PTR_ERR(state);
>>
>> @@ -4451,3 +4452,157 @@ void drm_mode_config_cleanup(struct drm_device *dev)
>> idr_destroy(&dev->mode_config.crtc_idr);
>> }
>> EXPORT_SYMBOL(drm_mode_config_cleanup);
>> +
>> +int drm_mode_atomic_ioctl(struct drm_device *dev,
>> + void *data, struct drm_file *file_priv)
>> +{
>
> Build error at this function like below,
>
> drivers/built-in.o: In function `drm_mode_atomic_ioctl':
> of_iommu.c:(.text+0x6d854): undefined reference to `__get_user_bad'
> of_iommu.c:(.text+0x6d940): undefined reference to `__get_user_bad'
>
> And built correctly with the below change,
>
> diff --git a/arch/arm/lib/getuser.S b/arch/arm/lib/getuser.S
> index 9b06bb4..0f4f469 100644
> --- a/arch/arm/lib/getuser.S
> +++ b/arch/arm/lib/getuser.S
> @@ -66,7 +66,7 @@ ENTRY(__get_user_4)
> mov pc, lr
> ENDPROC(__get_user_4)
>
> -__get_user_bad:
> +ENTRY(__get_user_bad)
> mov r2, #0
> mov r0, #-EFAULT
> mov pc, lr
>
> I guess __get_user_bad is not global but drm_mode_atomic_ioctl
> function tries to refer this function as extern.
no, actually __get_user_bad is (I think) supposed to be a build error.
You need this patch:
http://cgit.freedesktop.org/~robclark/linux/commit/?h=global-thermonuclear-war-5&id=1e94fad78b44d38ee3deca8f0694391e7db0e4cc
(Or I think Russell King had a slightly updated version of that.. I
need to work out with him about getting some version of that patch
merged.)
BR,
-R
> Is it build error only I can see?
>
> Thanks,
> Inki Dae
More information about the dri-devel
mailing list