From 8eda502f59a13cfd1f9a21db4b72f6a911cdf70d Mon Sep 17 00:00:00 2001 From: reimar Date: Tue, 23 Dec 2008 19:31:56 +0000 Subject: Do not default to rectangle=2, it is at least for ATI HD4850 cards with 8.12 drivers 20% slower at HD resolutions git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28187 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_gl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libvo/vo_gl.c') diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c index 7f59aee55c..128dc4def5 100644 --- a/libvo/vo_gl.c +++ b/libvo/vo_gl.c @@ -407,7 +407,7 @@ static void autodetectGlExtensions(void) { int is_ati = strstr(vendor, "ATI") != NULL; if (ati_hack == -1) ati_hack = is_ati; if (force_pbo == -1) force_pbo = strstr(extensions, "_pixel_buffer_object") ? is_ati : 0; - if (use_rectangle == -1) use_rectangle = strstr(extensions, "_texture_non_power_of_two") ? 2 : 0; + if (use_rectangle == -1) use_rectangle = strstr(extensions, "_texture_non_power_of_two") ? 0 : 0; } /** -- cgit v1.2.3 From 5be3fc9c94df700a903f1f67b9f15297df5efc1d Mon Sep 17 00:00:00 2001 From: reimar Date: Tue, 23 Dec 2008 20:56:45 +0000 Subject: Warn when using features that are broken due to ATI driver bugs. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28188 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_gl.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libvo/vo_gl.c') diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c index 128dc4def5..4f6cb3acea 100644 --- a/libvo/vo_gl.c +++ b/libvo/vo_gl.c @@ -408,6 +408,9 @@ static void autodetectGlExtensions(void) { if (ati_hack == -1) ati_hack = is_ati; if (force_pbo == -1) force_pbo = strstr(extensions, "_pixel_buffer_object") ? is_ati : 0; if (use_rectangle == -1) use_rectangle = strstr(extensions, "_texture_non_power_of_two") ? 0 : 0; + if (is_ati && (lscale == 1 || lscale == 2 || cscale == 1 || cscale == 2)) + mp_msg(MSGT_VO, MSGL_WARN, "Selected scaling mode may be broken on ATI cards.\n" + "Tell _them_ to fix GL_REPEAT if you have issues.\n"); } /** -- cgit v1.2.3 From 256c9152fe705f4c7e4e7ec8c6dfa4c67ab539cc Mon Sep 17 00:00:00 2001 From: reimar Date: Sat, 27 Dec 2008 13:00:03 +0000 Subject: Fix ugly borders problem with ati-hack git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28199 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_gl.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'libvo/vo_gl.c') diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c index 4f6cb3acea..6560b325fb 100644 --- a/libvo/vo_gl.c +++ b/libvo/vo_gl.c @@ -785,6 +785,18 @@ static uint32_t get_image(mp_image_t *mpi) { return VO_TRUE; } +static void clear_border(uint8_t *dst, int start, int stride, int height, int full_height, int value) { + int right_border = stride - start; + int bottom_border = full_height - height; + while (height > 0) { + memset(dst + start, value, right_border); + dst += stride; + height--; + } + if (bottom_border > 0) + memset(dst, value, stride * bottom_border); +} + static uint32_t draw_image(mp_image_t *mpi) { int slice = slice_height; int stride[3]; @@ -802,6 +814,13 @@ static uint32_t draw_image(mp_image_t *mpi) { memcpy_pic(mpi2.planes[1], mpi->planes[1], mpi->w >> 1, mpi->h >> 1, mpi2.stride[1], mpi->stride[1]); memcpy_pic(mpi2.planes[2], mpi->planes[2], mpi->w >> 1, mpi->h >> 1, mpi2.stride[2], mpi->stride[2]); } + if (ati_hack) { // since we have to do a full upload we need to clear the borders + clear_border(mpi2.planes[0], mpi->w * bpp / 8, mpi2.stride[0], mpi->h, mpi2.height, 0); + if (mpi->imgfmt == IMGFMT_YV12) { + clear_border(mpi2.planes[1], mpi->w >> 1, mpi2.stride[1], mpi->h >> 1, mpi2.height >> 1, 128); + clear_border(mpi2.planes[2], mpi->w >> 1, mpi2.stride[2], mpi->h >> 1, mpi2.height >> 1, 128); + } + } mpi = &mpi2; } stride[0] = mpi->stride[0]; stride[1] = mpi->stride[1]; stride[2] = mpi->stride[2]; -- cgit v1.2.3