diff options
author | Dmitry Osipenko <digetx@gmail.com> | 2017-12-30 21:52:33 +0300 |
---|---|---|
committer | Dmitry Osipenko <digetx@gmail.com> | 2018-01-01 20:43:10 +0300 |
commit | 39ae16152aced972c8f70ff4de330a3811f59973 (patch) | |
tree | 5b6ab56a53aa1b7c9ba5fe75d31c4189ba149461 | |
parent | 2569b1a7fb15e71077c640ba3c993d005abf8a88 (diff) |
Add more debug messages
-rw-r--r-- | src/host1x-gr2d.c | 26 | ||||
-rw-r--r-- | src/presentation_queue.c | 83 | ||||
-rw-r--r-- | src/surface_mixer.c | 100 | ||||
-rw-r--r-- | src/surface_output.c | 20 | ||||
-rw-r--r-- | src/surface_shared.c | 53 |
5 files changed, 175 insertions, 107 deletions
diff --git a/src/host1x-gr2d.c b/src/host1x-gr2d.c index 07bf82b..c856259 100644 --- a/src/host1x-gr2d.c +++ b/src/host1x-gr2d.c @@ -44,6 +44,9 @@ int host1x_gr2d_clear_rect(struct tegra_stream *stream, unsigned tiled = 0; int err; + DebugMsg("pixbuf width %u height %u color 0x%08X x %u y %u width %u height %u\n", + pixbuf->width, pixbuf->height, color, x, y, width, height); + if (x + width > pixbuf->width) return -EINVAL; @@ -111,6 +114,12 @@ int host1x_gr2d_clear_rect_clipped(struct tegra_stream *stream, unsigned tiled = 0; int err; + DebugMsg("pixbuf width %u height %u color 0x%08X x %u y %u " + "width %u height %u clip_x0 %u, clip_y0 %u clip_x1 %u clip_y1 %u" + " draw_outside %d\n", + pixbuf->width, pixbuf->height, color, x, y, + width, height, clip_x0, clip_y0, clip_x1, clip_y1, draw_outside); + if (x + width > pixbuf->width) return -EINVAL; @@ -202,6 +211,14 @@ int host1x_gr2d_blit(struct tegra_stream *stream, unsigned ydir = 0; int err; + DebugMsg("pixbuf src width %u height %u format %u " + "dst width %u height %u format %u " + "sx %u sy %u dx %u dy %u width %u height %u\n", + src->width, src->height, src->format, + dst->width, dst->height, dst->format, + sx, sy, dx, dy, width, height); + + if (PIX_BUF_FORMAT_BYTES(src->format) != PIX_BUF_FORMAT_BYTES(dst->format)) { @@ -361,6 +378,15 @@ int host1x_gr2d_surface_blit(struct tegra_stream *stream, unsigned vfen; int err; + DebugMsg("pixbuf src width %u height %u format %u " + "dst width %u height %u format %u " + "sx %u sy %u src_width %u src_height %u " + "dx %u dy %u dst_width %u dst_height %u\n", + src->width, src->height, src->format, + dst->width, dst->height, dst->format, + sx, sy, src_width, src_height, + dx, dy, dst_width, dst_height); + switch (src->layout) { case PIX_BUF_LAYOUT_TILED_16x16: src_tiled = 1; diff --git a/src/presentation_queue.c b/src/presentation_queue.c index 218d63e..e30cc94 100644 --- a/src/presentation_queue.c +++ b/src/presentation_queue.c @@ -122,6 +122,8 @@ static void pqt_display_surface(tegra_pqt *pqt, tegra_surface *surf) static void pqt_update_dri_buffer(tegra_pqt *pqt, tegra_surface *surf) { + int ret; + if (!DRI_OUTPUT) { return; } @@ -144,47 +146,56 @@ static void pqt_update_dri_buffer(tegra_pqt *pqt, tegra_surface *surf) DebugMsg("surface %u transfer YUV\n", surf->surface_id); if (surf->set_bg) { - host1x_gr2d_clear_rect_clipped(surf->dev->stream, - pqt->dri_pixbuf, - surf->bg_color, - 0, - 0, - pqt->dri_pixbuf->width, - pqt->dri_pixbuf->height, - surf->shared->dst_x0, - surf->shared->dst_y0, - surf->shared->dst_x0 + surf->shared->dst_width, - surf->shared->dst_y0 + surf->shared->dst_height, - true); + ret = host1x_gr2d_clear_rect_clipped(surf->dev->stream, + pqt->dri_pixbuf, + surf->bg_color, + 0, + 0, + pqt->dri_pixbuf->width, + pqt->dri_pixbuf->height, + surf->shared->dst_x0, + surf->shared->dst_y0, + surf->shared->dst_x0 + surf->shared->dst_width, + surf->shared->dst_y0 + surf->shared->dst_height, + true); + if (ret) { + ErrorMsg("setting BG failed %d\n", ret); + } } - host1x_gr2d_surface_blit(pqt->dev->stream, - surf->shared->video->pixbuf, - pqt->dri_pixbuf, - &surf->shared->csc, - surf->shared->src_x0, - surf->shared->src_y0, - surf->shared->src_width, - surf->shared->src_height, - surf->shared->dst_x0, - surf->shared->dst_y0, - surf->shared->dst_width, - surf->shared->dst_height); + ret = host1x_gr2d_surface_blit(pqt->dev->stream, + surf->shared->video->pixbuf, + pqt->dri_pixbuf, + &surf->shared->csc, + surf->shared->src_x0, + surf->shared->src_y0, + surf->shared->src_width, + surf->shared->src_height, + surf->shared->dst_x0, + surf->shared->dst_y0, + surf->shared->dst_width, + surf->shared->dst_height); + if (ret) { + ErrorMsg("video transfer failed %d\n", ret); + } } else if (surf->pixbuf) { DebugMsg("surface %u transfer RGB\n", surf->surface_id); - host1x_gr2d_surface_blit(pqt->dev->stream, - surf->pixbuf, - pqt->dri_pixbuf, - &csc_rgb_default, - 0, - 0, - surf->disp_width, - surf->disp_height, - 0, - 0, - pqt->dri_pixbuf->width, - pqt->dri_pixbuf->height); + ret = host1x_gr2d_surface_blit(pqt->dev->stream, + surf->pixbuf, + pqt->dri_pixbuf, + &csc_rgb_default, + 0, + 0, + surf->disp_width, + surf->disp_height, + 0, + 0, + pqt->dri_pixbuf->width, + pqt->dri_pixbuf->height); + if (ret) { + ErrorMsg("video transfer failed %d\n", ret); + } } pthread_mutex_unlock(&pqt->dev->lock); diff --git a/src/surface_mixer.c b/src/surface_mixer.c index 65e94b4..e9ee6d7 100644 --- a/src/surface_mixer.c +++ b/src/surface_mixer.c @@ -558,15 +558,21 @@ VdpStatus vdp_video_mixer_render( pthread_mutex_lock(&mix->dev->lock); - host1x_gr2d_clear_rect_clipped(mix->dev->stream, - dest_surf->pixbuf, - bg_color, - bg_x0, bg_y0, - bg_width, bg_height, - dst_vid_x0, dst_vid_y0, - dst_vid_x0 + dst_vid_width, - dst_vid_y0 + dst_vid_height, - true); + ret = host1x_gr2d_clear_rect_clipped(mix->dev->stream, + dest_surf->pixbuf, + bg_color, + bg_x0, + bg_y0, + bg_width, + bg_height, + dst_vid_x0, + dst_vid_y0, + dst_vid_x0 + dst_vid_width, + dst_vid_y0 + dst_vid_height, + true); + if (ret) { + ErrorMsg("setting BG failed %d\n", ret); + } pthread_mutex_unlock(&mix->dev->lock); } else { @@ -591,16 +597,21 @@ VdpStatus vdp_video_mixer_render( pthread_mutex_lock(&mix->dev->lock); - host1x_gr2d_surface_blit(mix->dev->stream, - bg_surf->pixbuf, - dest_surf->pixbuf, - &csc_rgb_default, - bg_x0, bg_y0, - bg_width, bg_height, - 0, - 0, - dest_surf->width, - dest_surf->height); + ret = host1x_gr2d_surface_blit(mix->dev->stream, + bg_surf->pixbuf, + dest_surf->pixbuf, + &csc_rgb_default, + bg_x0, + bg_y0, + bg_width, + bg_height, + 0, + 0, + dest_surf->width, + dest_surf->height); + if (ret) { + ErrorMsg("copying BG failed %d\n", ret); + } pthread_mutex_unlock(&mix->dev->lock); } @@ -638,15 +649,21 @@ VdpStatus vdp_video_mixer_render( pthread_mutex_lock(&mix->dev->lock); - host1x_gr2d_clear_rect_clipped(mix->dev->stream, - dest_surf->pixbuf, - bg_color, - bg_x0, bg_y0, - bg_width, bg_height, - dst_vid_x0, dst_vid_y0, - dst_vid_x0 + dst_vid_width, - dst_vid_y0 + dst_vid_height, - true); + ret = host1x_gr2d_clear_rect_clipped(mix->dev->stream, + dest_surf->pixbuf, + bg_color, + bg_x0, + bg_y0, + bg_width, + bg_height, + dst_vid_x0, + dst_vid_y0, + dst_vid_x0 + dst_vid_width, + dst_vid_y0 + dst_vid_height, + true); + if (ret) { + ErrorMsg("setting BG failed %d\n", ret); + } pthread_mutex_unlock(&mix->dev->lock); @@ -657,18 +674,21 @@ VdpStatus vdp_video_mixer_render( if (!shared) { pthread_mutex_lock(&mix->dev->lock); - host1x_gr2d_surface_blit(mix->dev->stream, - video_surf->pixbuf, - dest_surf->pixbuf, - &mix->csc, - src_vid_x0, - src_vid_y0, - src_vid_width, - src_vid_height, - dst_vid_x0, - dst_vid_y0, - dst_vid_width, - dst_vid_height); + ret = host1x_gr2d_surface_blit(mix->dev->stream, + video_surf->pixbuf, + dest_surf->pixbuf, + &mix->csc, + src_vid_x0, + src_vid_y0, + src_vid_width, + src_vid_height, + dst_vid_x0, + dst_vid_y0, + dst_vid_width, + dst_vid_height); + if (ret) { + ErrorMsg("video transfer failed %d\n", ret); + } pthread_mutex_unlock(&mix->dev->lock); } diff --git a/src/surface_output.c b/src/surface_output.c index 60f90b7..18c27a6 100644 --- a/src/surface_output.c +++ b/src/surface_output.c @@ -277,6 +277,7 @@ VdpStatus vdp_output_surface_render_bitmap_surface( pthread_mutex_unlock(&dst_surf->dev->lock); if (ret == 0) { + ErrorMsg("surface clear failed %d\n", ret); put_surface(dst_surf); put_surface(src_surf); return VDP_STATUS_OK; @@ -343,14 +344,17 @@ VdpStatus vdp_output_surface_render_bitmap_surface( if (!need_rotate) { pthread_mutex_lock(&dst_surf->dev->lock); - host1x_gr2d_surface_blit(dst_surf->dev->stream, - src_surf->pixbuf, - dst_surf->pixbuf, - &csc_rgb_default, - src_x0, src_y0, - src_width, src_height, - dst_x0, dst_y0, - dst_width, dst_height); + ret = host1x_gr2d_surface_blit(dst_surf->dev->stream, + src_surf->pixbuf, + dst_surf->pixbuf, + &csc_rgb_default, + src_x0, src_y0, + src_width, src_height, + dst_x0, dst_y0, + dst_width, dst_height); + if (ret) { + ErrorMsg("surface copying failed %d\n", ret); + } pthread_mutex_unlock(&dst_surf->dev->lock); diff --git a/src/surface_shared.c b/src/surface_shared.c index d8e0dce..7770b8e 100644 --- a/src/surface_shared.c +++ b/src/surface_shared.c @@ -260,32 +260,39 @@ int shared_surface_transfer_video(tegra_surface *disp) shared->video->surface_id); if (disp->set_bg) { - host1x_gr2d_clear_rect_clipped(disp->dev->stream, - disp->pixbuf, - disp->bg_color, - 0, 0, - disp->width, - disp->height, - shared->dst_x0, - shared->dst_y0, - shared->dst_x0 + shared->dst_width, - shared->dst_y0 + shared->dst_height, - true); + ret = host1x_gr2d_clear_rect_clipped(disp->dev->stream, + disp->pixbuf, + disp->bg_color, + 0, 0, + disp->width, + disp->height, + shared->dst_x0, + shared->dst_y0, + shared->dst_x0 + shared->dst_width, + shared->dst_y0 + shared->dst_height, + true); + if (ret) { + ErrorMsg("setting BG failed %d\n", ret); + } + disp->set_bg = false; } - host1x_gr2d_surface_blit(video->dev->stream, - video->pixbuf, - disp->pixbuf, - &shared->csc, - shared->src_x0, - shared->src_y0, - shared->src_width, - shared->src_height, - shared->dst_x0, - shared->dst_y0, - shared->dst_width, - shared->dst_height); + ret = host1x_gr2d_surface_blit(video->dev->stream, + video->pixbuf, + disp->pixbuf, + &shared->csc, + shared->src_x0, + shared->src_y0, + shared->src_width, + shared->src_height, + shared->dst_x0, + shared->dst_y0, + shared->dst_width, + shared->dst_height); + if (ret) { + ErrorMsg("video transfer failed %d\n", ret); + } pthread_mutex_unlock(&disp->dev->lock); |