From: Chris Wilson <chris@chris-wilson.co.uk>
To: przanoni@gmail.com, dri-devel@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org, Paulo Zanoni <paulo.r.zanoni@intel.com>
Subject: Re: [RFC] drm: implement DRM_IOCTL_MODE_SETROTATION
Date: Thu, 05 Jan 2012 16:44:09 +0000 [thread overview]
Message-ID: <e0d58a$2qea3p@orsmga002.jf.intel.com> (raw)
In-Reply-To: <1325780183-23690-1-git-send-email-przanoni@gmail.com>
On Thu, 5 Jan 2012 14:16:23 -0200, przanoni@gmail.com wrote:
> From: Paulo Zanoni <paulo.r.zanoni@intel.com>
>
> This ioctl is used to signal the drivers that the screen is rotated,
> not to make the drivers rotate the screen.
> - add a driver-specific "rotation_set" function
> - implement Intel's rotation_set by setting the right values to the
> PIPECONF registers.
>
> The idea is that when user-space does rotation, it can call this ioctl
> to inform the Kernel that we have a rotation. This feature is needed
> by the KVMr feature of VPro.
I'm interested to see how the fb is laid out in memory and how does this
integrate with mode configuration?
Comment inline.
> +int drm_crtc_rotation_set_ioctl(struct drm_device *dev, void *data,
> + struct drm_file *file_priv)
> +{
> + struct drm_mode_crtc_rotation *rotation = data;
> + struct drm_mode_object *obj;
> + struct drm_crtc *crtc;
> + int ret = 0;
> +
> + DRM_DEBUG_KMS("changing rotation to %d\n", rotation->rotation);
> +
> + if (!drm_core_check_feature(dev, DRIVER_MODESET))
> + return -EINVAL;
> +
> + mutex_lock(&dev->mode_config.mutex);
> + obj = drm_mode_object_find(dev, rotation->crtc_id, DRM_MODE_OBJECT_CRTC);
> + if (!obj) {
> + ret = -EINVAL;
> + goto out;
> + }
> + crtc = obj_to_crtc(obj);
> +
> + if (crtc->funcs->rotation_set)
> + crtc->funcs->rotation_set(crtc, rotation->rotation);
In the absence of an implementation, return ENOTTY, otherwise return an
error code from crtc->rotation_set(). Then userspace can simply try to
set a rotation or take the same recovery paths for unsupported
configuations/kernels.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
next prev parent reply other threads:[~2012-01-05 16:44 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-05 16:16 [RFC] drm: implement DRM_IOCTL_MODE_SETROTATION przanoni
2012-01-05 16:27 ` Daniel Vetter
2012-01-05 16:33 ` Paulo Zanoni
2012-01-05 16:40 ` Jakob Bornecrantz
2012-01-16 19:59 ` Paulo Zanoni
2012-01-16 20:35 ` [Intel-gfx] " Dave Airlie
2012-01-16 20:50 ` Paulo Zanoni
2012-01-05 16:44 ` Chris Wilson [this message]
2012-01-06 3:10 ` Eric Anholt
2012-01-06 15:26 ` Jesse Barnes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='e0d58a$2qea3p@orsmga002.jf.intel.com' \
--to=chris@chris-wilson.co.uk \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=paulo.r.zanoni@intel.com \
--cc=przanoni@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox