summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2839751)
raw | patch | inline | side by side (parent: 2839751)
author | Nikhil Devshatwar <nikhil.nd@ti.com> | |
Thu, 5 Dec 2013 22:15:31 +0000 (03:45 +0530) | ||
committer | Amarinder Bindra <a-bindra@ti.com> | |
Wed, 11 Dec 2013 06:28:06 +0000 (11:58 +0530) |
This flag is used by post_vid_buffer to decide between
wheather a buffer is displayed as full screen or as overlay.
In case, of overlay, x and y are used as position co ordinates
of the overlay.
Also, added a function to set overlay to use plane[1] and set Z order
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
wheather a buffer is displayed as full screen or as overlay.
In case, of overlay, x and y are used as position co ordinates
of the overlay.
Also, added a function to set overlay to use plane[1] and set Z order
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
util/display-kms.c | patch | blob | history | |
util/util.h | patch | blob | history |
diff --git a/util/display-kms.c b/util/display-kms.c
index 74b59fd28b955e56cf6a3579fa9efb09b37a975e..a502fbf1b302055d363b808f8d94b2f5a2307d04 100644 (file)
--- a/util/display-kms.c
+++ b/util/display-kms.c
return last_err;
}
+int
+get_overlay_plane(struct display *disp, struct buffer *buf)
+{
+ struct display_kms *disp_kms = to_display_kms(disp);
+ uint32_t i, ret;
+
+ for (i = 0; i < disp_kms->connectors_count; i++) {
+ struct connector *connector = &disp_kms->connector[i];
+ drmModeModeInfo *mode = connector->mode;
+
+ disp_kms->ovr[i] = drmModeGetPlane(disp->fd,
+ disp_kms->plane_resources->planes[1]);
+
+ ret = drmModeObjectSetProperty(disp->fd,
+ disp_kms->ovr[i]->plane_id, DRM_MODE_OBJECT_PLANE, 7, 3);
+ if (ret < 0) {
+ MSG("Could not set Z order for plane");
+ return ret;
+ }
+ }
+ return 0;
+}
+
static int
post_vid_buffer(struct display *disp, struct buffer *buf,
uint32_t x, uint32_t y, uint32_t w, uint32_t h)
continue;
}
- ret = drmModeSetPlane(disp->fd, disp_kms->ovr[i]->plane_id,
+ if(buf->noScale) {
+printf("plane id overlay thread = %d\n", disp_kms->ovr[i]->plane_id);
+ ret = drmModeSetPlane(disp->fd, disp_kms->ovr[i]->plane_id,
+ connector->crtc, buf_kms->fb_id, 0,
+ /* Use x and y as co-ordinates of overlay */
+ x, y, buf->width, buf->height,
+ /* Consider source x and y is 0 always */
+ 0, 0, w << 16, h << 16);
+ } else {
+printf("plane id fullscreeen thread = %d\n", disp_kms->ovr[i]->plane_id);
+ ret = drmModeSetPlane(disp->fd, disp_kms->ovr[i]->plane_id,
connector->crtc, buf_kms->fb_id, 0,
/* make video fullscreen: */
0, 0, mode->hdisplay, mode->vdisplay,
/* source/cropping coordinates are given in Q16 */
x << 16, y << 16, w << 16, h << 16);
+ }
if (ret) {
ERROR("failed to enable plane %d: %s",
disp_kms->ovr[i]->plane_id, strerror(errno));
diff --git a/util/util.h b/util/util.h
index 6b2b357f3492a0650d6f717f26d3a448d8a3dea1..9f5e02b8274492b5c64922e9297ee61fcdfb6e3a 100644 (file)
--- a/util/util.h
+++ b/util/util.h
struct list unlocked;
bool multiplanar; /* True when Y and U/V are in separate buffers. */
int fd[4]; /* dmabuf */
+ bool noScale;
};
/* State variables, used to maintain the playback rate. */
disp_post_vid_buffer(struct display *disp, struct buffer *buf,
uint32_t x, uint32_t y, uint32_t w, uint32_t h);
+/* Get plane (id = 1) for every connector and update the overlay */
+int
+get_overlay_plane(struct display *disp, struct buffer *buf);
+
/* allocate a buffer from pool created by disp_get_vid_buffers() */
struct buffer * disp_get_vid_buffer(struct display *disp);
/* free to video buffer pool */