Bug 243191 - The blur effect doesn't work with the R300C driver (No NPOT texture support)
Summary: The blur effect doesn't work with the R300C driver (No NPOT texture support)
Status: RESOLVED UPSTREAM
Alias: None
Product: kwin
Classification: Plasma
Component: compositing (show other bugs)
Version: git master
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
: 250218 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-06-29 20:07 UTC by Shaker
Modified: 2010-09-14 00:03 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
glxinfo -l output (24.88 KB, application/octet-stream)
2010-09-07 00:25 UTC, davidebasilio
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Shaker 2010-06-29 20:07:15 UTC
Version:           SVN (using Devel) 
OS:                Linux

When I start blur effect, it's don't work. My graphic card is ATI RADEON 9600 SE and use open source driver.

Reproducible: Couldn't Reproduce




Information from glxinfo :

name of display: :0.0
display: :0  screen: 0
direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.4
server glx extensions:
    GLX_ARB_multisample, GLX_EXT_import_context, GLX_EXT_texture_from_pixmap, 
    GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_copy_sub_buffer, 
    GLX_OML_swap_method, GLX_SGI_make_current_read, GLX_SGI_swap_control, 
    GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer, 
    GLX_SGIX_visual_select_group, GLX_INTEL_swap_event
client glx vendor string: Mesa Project and SGI
client glx version string: 1.4
client glx extensions:
    GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_import_context, 
    GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_allocate_memory, 
    GLX_MESA_copy_sub_buffer, GLX_MESA_swap_control, 
    GLX_MESA_swap_frame_usage, GLX_OML_swap_method, GLX_OML_sync_control, 
    GLX_SGI_make_current_read, GLX_SGI_swap_control, GLX_SGI_video_sync, 
    GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer, 
    GLX_SGIX_visual_select_group, GLX_EXT_texture_from_pixmap, 
    GLX_INTEL_swap_event
GLX extensions:
    GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_import_context, 
    GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_copy_sub_buffer, 
    GLX_MESA_swap_control, GLX_MESA_swap_frame_usage, GLX_OML_swap_method, 
    GLX_OML_sync_control, GLX_SGI_make_current_read, GLX_SGI_swap_control, 
    GLX_SGI_video_sync, GLX_SGIS_multisample, GLX_SGIX_fbconfig, 
    GLX_SGIX_pbuffer, GLX_SGIX_visual_select_group, 
    GLX_EXT_texture_from_pixmap, GLX_INTEL_swap_event
OpenGL vendor string: DRI R300 Project
OpenGL renderer string: Mesa DRI R300 (RV350 4151) 20090101 x86/MMX+/3DNow!+/SSE TCL DRI2
OpenGL version string: 1.5 Mesa 7.8.1
OpenGL extensions:
    GL_ARB_depth_texture, GL_ARB_draw_buffers, GL_ARB_fragment_program, 
    GL_ARB_half_float_vertex, GL_ARB_imaging, GL_ARB_multisample, 
    GL_ARB_multitexture, GL_ARB_occlusion_query, GL_ARB_point_parameters, 
    GL_ARB_provoking_vertex, GL_ARB_shadow, GL_ARB_shadow_ambient, 
    GL_ARB_texture_border_clamp, GL_ARB_texture_compression, 
    GL_ARB_texture_cube_map, GL_ARB_texture_env_add, 
    GL_ARB_texture_env_combine, GL_ARB_texture_env_crossbar, 
    GL_ARB_texture_env_dot3, GL_MESAX_texture_float, 
    GL_ARB_texture_mirrored_repeat, GL_ARB_texture_rectangle, 
    GL_ARB_transpose_matrix, GL_ARB_vertex_array_bgra, 
    GL_ARB_vertex_buffer_object, GL_ARB_vertex_program, GL_ARB_window_pos, 
    GL_EXT_abgr, GL_EXT_bgra, GL_EXT_blend_color, 
    GL_EXT_blend_equation_separate, GL_EXT_blend_func_separate, 
    GL_EXT_blend_logic_op, GL_EXT_blend_minmax, GL_EXT_blend_subtract, 
    GL_EXT_compiled_vertex_array, GL_EXT_convolution, GL_EXT_copy_texture, 
    GL_EXT_draw_range_elements, GL_EXT_framebuffer_blit, 
    GL_EXT_framebuffer_object, GL_EXT_fog_coord, 
    GL_EXT_gpu_program_parameters, GL_EXT_histogram, GL_EXT_multi_draw_arrays, 
    GL_EXT_packed_pixels, GL_EXT_point_parameters, GL_EXT_polygon_offset, 
    GL_EXT_provoking_vertex, GL_EXT_rescale_normal, GL_EXT_secondary_color, 
    GL_EXT_separate_specular_color, GL_EXT_shadow_funcs, 
    GL_EXT_stencil_two_side, GL_EXT_stencil_wrap, GL_EXT_subtexture, 
    GL_EXT_texture, GL_EXT_texture3D, GL_EXT_texture_cube_map, 
    GL_EXT_texture_edge_clamp, GL_EXT_texture_env_add, 
    GL_EXT_texture_env_combine, GL_EXT_texture_env_dot3, 
    GL_EXT_texture_filter_anisotropic, GL_EXT_texture_lod_bias, 
    GL_EXT_texture_mirror_clamp, GL_EXT_texture_object, 
    GL_EXT_texture_rectangle, GL_EXT_texture_sRGB, GL_EXT_vertex_array, 
    GL_EXT_vertex_array_bgra, GL_APPLE_packed_pixels, 
    GL_ATI_blend_equation_separate, GL_ATI_texture_env_combine3, 
    GL_ATI_texture_mirror_once, GL_ATI_separate_stencil, 
    GL_IBM_multimode_draw_arrays, GL_IBM_rasterpos_clip, 
    GL_IBM_texture_mirrored_repeat, GL_INGR_blend_func_separate, 
    GL_MESA_pack_invert, GL_MESA_ycbcr_texture, GL_MESA_window_pos, 
    GL_NV_blend_square, GL_NV_light_max_exponent, GL_NV_texture_rectangle, 
    GL_NV_texgen_reflection, GL_NV_vertex_program, GL_OES_read_format, 
    GL_SGI_color_matrix, GL_SGI_color_table, GL_SGIS_generate_mipmap, 
    GL_SGIS_texture_border_clamp, GL_SGIS_texture_edge_clamp, 
    GL_SGIS_texture_lod, GL_SUN_multi_draw_arrays
glu version: 1.3
glu extensions:
    GLU_EXT_nurbs_tessellator, GLU_EXT_object_space_tess

   visual  x  bf lv rg d st colorbuffer ax dp st accumbuffer  ms  cav
 id dep cl sp sz l  ci b ro  r  g  b  a bf th cl  r  g  b  a ns b eat
----------------------------------------------------------------------
0x21 24 tc  0 32  0 r  y  .  8  8  8  8  0 24  8  0  0  0  0  0 0 None
0x22 24 dc  0 32  0 r  y  .  8  8  8  8  0 24  8  0  0  0  0  0 0 None
0xc4 24 tc  0 24  0 r  .  .  8  8  8  0  0  0  0  0  0  0  0  0 0 None
0xc5 24 tc  0 24  0 r  .  .  8  8  8  0  0  0  0 16 16 16  0  0 0 Slow
0xc6 24 tc  0 24  0 r  y  .  8  8  8  0  0  0  0  0  0  0  0  0 0 None
0xc7 24 tc  0 24  0 r  y  .  8  8  8  0  0  0  0 16 16 16  0  0 0 Slow
0xc8 24 tc  0 24  0 r  .  .  8  8  8  0  0 16  0  0  0  0  0  0 0 None
0xc9 24 tc  0 24  0 r  .  .  8  8  8  0  0 16  0 16 16 16  0  0 0 Slow
0xca 24 tc  0 24  0 r  y  .  8  8  8  0  0 16  0  0  0  0  0  0 0 None
0xcb 24 tc  0 24  0 r  y  .  8  8  8  0  0 16  0 16 16 16  0  0 0 Slow
0xcc 24 tc  0 24  0 r  .  .  8  8  8  0  0 24  0  0  0  0  0  0 0 None
0xcd 24 tc  0 24  0 r  .  .  8  8  8  0  0 24  0 16 16 16  0  0 0 Slow
0xce 24 tc  0 24  0 r  y  .  8  8  8  0  0 24  0  0  0  0  0  0 0 None
0xcf 24 tc  0 24  0 r  y  .  8  8  8  0  0 24  0 16 16 16  0  0 0 Slow
0xd0 24 tc  0 24  0 r  .  .  8  8  8  0  0 24  8  0  0  0  0  0 0 None
0xd1 24 tc  0 24  0 r  .  .  8  8  8  0  0 24  8 16 16 16  0  0 0 Slow
0xd2 24 tc  0 24  0 r  y  .  8  8  8  0  0 24  8  0  0  0  0  0 0 None
0xd3 24 tc  0 24  0 r  y  .  8  8  8  0  0 24  8 16 16 16  0  0 0 Slow
0xd4 24 tc  0 32  0 r  .  .  8  8  8  8  0  0  0  0  0  0  0  0 0 None
0xd5 24 tc  0 32  0 r  .  .  8  8  8  8  0  0  0 16 16 16 16  0 0 Slow
0xd6 24 tc  0 32  0 r  y  .  8  8  8  8  0  0  0  0  0  0  0  0 0 None
0xd7 24 tc  0 32  0 r  y  .  8  8  8  8  0  0  0 16 16 16 16  0 0 Slow
0xd8 24 tc  0 32  0 r  .  .  8  8  8  8  0 16  0  0  0  0  0  0 0 None
0xd9 24 tc  0 32  0 r  .  .  8  8  8  8  0 16  0 16 16 16 16  0 0 Slow
0xda 24 tc  0 32  0 r  y  .  8  8  8  8  0 16  0 16 16 16 16  0 0 Slow
0xdb 24 tc  0 32  0 r  .  .  8  8  8  8  0 24  0  0  0  0  0  0 0 None
0xdc 24 tc  0 32  0 r  .  .  8  8  8  8  0 24  0 16 16 16 16  0 0 Slow
0xdd 24 tc  0 32  0 r  y  .  8  8  8  8  0 24  0  0  0  0  0  0 0 None
0xde 24 tc  0 32  0 r  y  .  8  8  8  8  0 24  0 16 16 16 16  0 0 Slow
0xdf 24 tc  0 32  0 r  .  .  8  8  8  8  0 24  8  0  0  0  0  0 0 None
0xe0 24 tc  0 32  0 r  .  .  8  8  8  8  0 24  8 16 16 16 16  0 0 Slow
0xe1 24 tc  0 32  0 r  y  .  8  8  8  8  0 24  8 16 16 16 16  0 0 Slow
0xe2 24 dc  0 24  0 r  .  .  8  8  8  0  0  0  0  0  0  0  0  0 0 None
0xe3 24 dc  0 24  0 r  .  .  8  8  8  0  0  0  0 16 16 16  0  0 0 Slow
0xe4 24 dc  0 24  0 r  y  .  8  8  8  0  0  0  0  0  0  0  0  0 0 None
0xe5 24 dc  0 24  0 r  y  .  8  8  8  0  0  0  0 16 16 16  0  0 0 Slow
0xe6 24 dc  0 24  0 r  .  .  8  8  8  0  0 16  0  0  0  0  0  0 0 None
0xe7 24 dc  0 24  0 r  .  .  8  8  8  0  0 16  0 16 16 16  0  0 0 Slow
0xe8 24 dc  0 24  0 r  y  .  8  8  8  0  0 16  0  0  0  0  0  0 0 None
0xe9 24 dc  0 24  0 r  y  .  8  8  8  0  0 16  0 16 16 16  0  0 0 Slow
0xea 24 dc  0 24  0 r  .  .  8  8  8  0  0 24  0  0  0  0  0  0 0 None
0xeb 24 dc  0 24  0 r  .  .  8  8  8  0  0 24  0 16 16 16  0  0 0 Slow
0xec 24 dc  0 24  0 r  y  .  8  8  8  0  0 24  0  0  0  0  0  0 0 None
0xed 24 dc  0 24  0 r  y  .  8  8  8  0  0 24  0 16 16 16  0  0 0 Slow
0xee 24 dc  0 24  0 r  .  .  8  8  8  0  0 24  8  0  0  0  0  0 0 None
0xef 24 dc  0 24  0 r  .  .  8  8  8  0  0 24  8 16 16 16  0  0 0 Slow
0xf0 24 dc  0 24  0 r  y  .  8  8  8  0  0 24  8  0  0  0  0  0 0 None
0xf1 24 dc  0 24  0 r  y  .  8  8  8  0  0 24  8 16 16 16  0  0 0 Slow
0xf2 24 dc  0 32  0 r  .  .  8  8  8  8  0  0  0  0  0  0  0  0 0 None
0xf3 24 dc  0 32  0 r  .  .  8  8  8  8  0  0  0 16 16 16 16  0 0 Slow
0xf4 24 dc  0 32  0 r  y  .  8  8  8  8  0  0  0  0  0  0  0  0 0 None
0xf5 24 dc  0 32  0 r  y  .  8  8  8  8  0  0  0 16 16 16 16  0 0 Slow
0xf6 24 dc  0 32  0 r  .  .  8  8  8  8  0 16  0  0  0  0  0  0 0 None
0xf7 24 dc  0 32  0 r  .  .  8  8  8  8  0 16  0 16 16 16 16  0 0 Slow
0xf8 24 dc  0 32  0 r  y  .  8  8  8  8  0 16  0  0  0  0  0  0 0 None
0xf9 24 dc  0 32  0 r  y  .  8  8  8  8  0 16  0 16 16 16 16  0 0 Slow
0xfa 24 dc  0 32  0 r  .  .  8  8  8  8  0 24  0  0  0  0  0  0 0 None
0xfb 24 dc  0 32  0 r  .  .  8  8  8  8  0 24  0 16 16 16 16  0 0 Slow
0xfc 24 dc  0 32  0 r  y  .  8  8  8  8  0 24  0  0  0  0  0  0 0 None
0xfd 24 dc  0 32  0 r  y  .  8  8  8  8  0 24  0 16 16 16 16  0 0 Slow
0xfe 24 dc  0 32  0 r  .  .  8  8  8  8  0 24  8  0  0  0  0  0 0 None
0xff 24 dc  0 32  0 r  .  .  8  8  8  8  0 24  8 16 16 16 16  0 0 Slow
0x100 24 dc  0 32  0 r  y  .  8  8  8  8  0 24  8 16 16 16 16  0 0 Slow
0x63 32 tc  0 32  0 r  y  .  8  8  8  8  0 16  0  0  0  0  0  0 0 None
Comment 1 Fredrik Höglund 2010-06-29 20:25:05 UTC
The blur effect only works with the gallium driver (r300g) with your card.

This is because the r300 classic driver doesn't support the GL_ARB_texture_non_power_of_two extension.

We might rewrite the effect in 4.6 so it uses GL_ARB_texture_rectangle instead, but it's likely that by the time KDE 4.6 is released the gallium driver will be the default in Mesa anyway.
Comment 2 Shaker 2010-06-29 21:21:08 UTC
Thanks for information.
Cheers !
Comment 3 Martin Flöser 2010-08-28 08:51:36 UTC
As different driver supports it, we can mark as driver bug :-)
Comment 4 Fredrik Höglund 2010-09-05 17:12:37 UTC
*** Bug 250218 has been marked as a duplicate of this bug. ***
Comment 5 Shaker 2010-09-06 16:21:22 UTC
This bug is resolved and blur effect works perfectly with Gallium3D driver ! Strange, but with Linux Kernel 2.6.32, the kwin process consume 40-50% of CPU, when blur effect is enabled, but with Linux Kernel 2.6.35, the kwin process consume 0-5% of CPU.
I notice a bug with thumbnails in the taskbar. Thumbnails not appear in the taskbar.

Picture :

http://img180.imageshack.us/img180/9666/snapshot3fr.png

Where do I report this bug ? To KDE bugs or Mesa (Gallium3D) bugs ?
Comment 6 davidebasilio 2010-09-06 21:42:31 UTC
(In reply to comment #5)
> This bug is resolved and blur effect works perfectly with Gallium3D driver !
> Strange, but with Linux Kernel 2.6.32, the kwin process consume 40-50% of CPU,
> when blur effect is enabled, but with Linux Kernel 2.6.35, the kwin process
> consume 0-5% of CPU.
> I notice a bug with thumbnails in the taskbar. Thumbnails not appear in the
> taskbar.
> 
> Picture :
> 
> http://img180.imageshack.us/img180/9666/snapshot3fr.png
> 
> Where do I report this bug ? To KDE bugs or Mesa (Gallium3D) bugs ?

I have the very same issue with the r300g driver from git mesa..
Moreover, the blur effect does not work anymore with this driver after upgrading to a more recent commit (I oepned a bug: https://bugs.freedesktop.org/show_bug.cgi?id=30007 , but noone is responding..).
Comment 7 Fredrik Höglund 2010-09-07 00:21:24 UTC
The thumbnail issue is probably a driver bug/limitation, possibly related to the loop in the GLSL shader that scales the image. But please attach your glxinfo -l output so we can check that the shader doesn't exceed any HW limitations. The debug output when you run kwin from the command line doesn't indicate that any shaders failed to compile?

The blur regression is likely related to the new GLSL compiler that was merged into the master branch in mesa recently.
Comment 8 davidebasilio 2010-09-07 00:25:49 UTC
Created attachment 51375 [details]
glxinfo -l output
Comment 9 davidebasilio 2010-09-07 00:27:15 UTC
Here is the output from kwin --replace when it fails to paint a thumbnail:

davide@bartoz ~ $ kwin --replace &
[1] 10187
davide@bartoz ~ $ kwin(10187) KWin::CompositingPrefs::detectDriverAndVersion:
GL vendor is "X.Org R300 Project" 
kwin(10187) KWin::CompositingPrefs::detectDriverAndVersion: GL renderer is
"Gallium 0.4 on RV410" 
kwin(10187) KWin::CompositingPrefs::detectDriverAndVersion: GL version is "2.1
Mesa 7.9-devel" 
kwin(10187) KWin::CompositingPrefs::detectDriverAndVersion: Detected driver
"unknown" , version "" 
r300 FP: Compiler Error:
Fragment program does not support relative addressing  of source operands.
Using a dummy shader instead.
r300 FP: Compiler Error:
Fragment program does not support relative addressing  of source operands.
Using a dummy shader instead.

And I attacedh my glxinfo -l output..
(In reply to comment #7)
> The thumbnail issue is probably a driver bug/limitation, possibly related to
> the loop in the GLSL shader that scales the image. But please attach your
> glxinfo -l output so we can check that the shader doesn't exceed any HW
> limitations. The debug output when you run kwin from the command line doesn't
> indicate that any shaders failed to compile?
> 
> The blur regression is likely related to the new GLSL compiler that was merged
> into the master branch in mesa recently.
Comment 10 Fredrik Höglund 2010-09-07 20:36:08 UTC
The debug output confirms that the shader failed to compile. I don't think you need to file a bug report with the driver developers about this, since the problem is a known limitation.

We need to work around this in kwin though by disabling the high quality scaling filter when this happens.
Comment 11 davidebasilio 2010-09-09 05:30:47 UTC
Ok, thank you.
That output explains the problem with the thumbnails (which in fact never worked for me with r300g), but non the one with the blur effect (which used to work here with git mesa somewhere around the middle of august).
Do you have a clue about that?

(In reply to comment #10)
> The debug output confirms that the shader failed to compile. I don't think you
> need to file a bug report with the driver developers about this, since the
> problem is a known limitation.
> 
> We need to work around this in kwin though by disabling the high quality
> scaling filter when this happens.
Comment 12 Fredrik Höglund 2010-09-13 23:55:17 UTC
SVN commit 1175021 by fredrik:

Make the lanczos shader use a fixed number of iterations in the loop.

This makes it possible for the GLSL compiler to unroll it, which also
avoids the need to use relative addressing. With this change the shader
should hopefully work with the R300G driver.

The unused kernel weights are set to zero so they don't contribute
to the end result.

Thanks to Tom Stellard and Marek Olšák for their suggestions on how
to solve this problem.

CCBUG: 243191


 M  +1 -2      lanczos-fragment.glsl  
 M  +17 -19    lanczosfilter.cpp  
 M  +4 -3      lanczosfilter.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1175021
Comment 13 Fredrik Höglund 2010-09-14 00:03:57 UTC
SVN commit 1175024 by fredrik:

Backport r1175021:

Make the lanczos shader use a fixed number of iterations in the loop.

This makes it possible for the GLSL compiler to unroll it, which also
avoids the need to use relative addressing. With this change the shader
should hopefully work with the R300G driver.

The unused kernel weights are set to zero so they don't contribute
to the end result.

Thanks to Tom Stellard and Marek Olšák for their suggestions on how
to solve this problem.

CCBUG: 243191


 M  +1 -2      lanczos-fragment.glsl  
 M  +17 -19    lanczosfilter.cpp  
 M  +4 -3      lanczosfilter.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1175024