# KMS with Radeon x300 problems

## audiodef

My graphics card:

```

01:00.0 VGA compatible controller: ATI Technologies Inc RV370 5B60 [Radeon X300 (PCIE)]

```

With KMS enabled, I get this problem from dmesg:

```

[    1.224396] [drm] Initialized drm 1.1.0 20060810

[    1.224518] [drm] radeon defaulting to kernel modesetting.

[    1.224590] [drm] radeon kernel modesetting enabled.

[    1.224698] radeon 0000:01:00.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16

[    1.224769] radeon 0000:01:00.0: setting latency timer to 64

[    1.226388] [drm] initializing kernel modesetting (RV380 0x1002:0x5B60).

[    1.226555] [drm] register mmio base: 0xEFDE0000

[    1.226624] [drm] register mmio size: 65536

[    1.227034] [drm] GPU reset succeed (RBBM_STATUS=0x00000140)

[    1.227108] [drm] 1 Power State(s)

[    1.227183] [drm] State 0 Default (default)

[    1.227247] [drm]    16 PCIE Lanes

[    1.227309] [drm]    1 Clock Mode(s)

[    1.227371] [drm]            0 engine/memory: 325000/297000

[    1.227440] [drm] radeon: power management initialized

[    1.227506] [drm] Generation 2 PCI interface, using max accessible memory

[    1.227576] radeon 0000:01:00.0: VRAM: 32M 0xEC000000 - 0xEDFFFFFF (32M used)

[    1.227644] radeon 0000:01:00.0: GTT: 512M 0xCC000000 - 0xEBFFFFFF

[    1.227757] radeon 0000:01:00.0: irq 26 for MSI/MSI-X

[    1.227764] [drm] radeon: using MSI.

[    1.227851] [drm] radeon: irq initialized.

[    1.228706] [drm] Detected VRAM RAM=32M, BAR=32M

[    1.228780] [drm] RAM width 64bits DDR

[    1.228917] [TTM] Zone  kernel: Available graphics memory: 435224 kiB.

[    1.228988] [TTM] Zone highmem: Available graphics memory: 1880364 kiB.

[    1.229077] [drm] radeon: 32M of VRAM memory ready

[    1.229143] [drm] radeon: 512M of GTT memory ready.

[    1.229225] [drm] GART: num cpu pages 131072, num gpu pages 131072

[    1.230161] [drm] radeon: 1 quad pipes, 1 Z pipes initialized.

[    1.231668] [drm] PCIE GART of 512M enabled (table at 0xEC040000).

[    1.231744] [drm] radeon: cp idle (0x10000C03)

[    1.231890] [drm] Loading R300 Microcode

[    1.231962] platform radeon_cp.0: firmware: requesting radeon/R300_cp.bin

[   61.232207] radeon_cp: Failed to load firmware "radeon/R300_cp.bin"

[   61.232275] [drm:r100_cp_init] *ERROR* Failed to load firmware!

[   61.232342] radeon 0000:01:00.0: failled initializing CP (-2).

[   61.232407] radeon 0000:01:00.0: Disabling GPU acceleration

```

With KMS disabled, I don't get this problem, but I can't tell if GPU acceleration is enabled. 3D games crash and hang the system after a minute, although for that one minute, they aren't slow to play.

----------

## quarksoup

I wasn't able to figure out a fix for KMS, but using non KMS uvesafb and the radeon driver gives me very good performance with an x800 GTO. Just need to go through the effort of setting the kernel video line. Check 

```
less /sys/devices/platform/uvesafb.0/graphics/fb0/modes
```

 (once uvesafb is installed) for supported resolutions. xorg should have no problem going beyond what's listed there.

----------

## audiodef

Thanks quarksoup. Didn't affect the problem with games crashing, but I now have a nice framebuffer that doesn't interfere with glx.   :Cool: 

----------

## quarksoup

After taking a closer look at your dmesg output I see that your video card is failing to load a firmware binary.

Check the output of 

```
ls /lib/firmware/radeon
```

 and if you see R300_cp.bin in there and try configuring your kernel like

```
Device Drivers  --->

   Generic Driver Options  --->

      (radeon/R300_cp.bin) External firmware blobs to build into the kernel binary

      (firmware) Firmware blobs root directory (NEW)
```

Maybe this link might help.

----------

## DirtyHairy

I agree with quarksoup: the problem is the failure to load the firmware, which is  not available before root gets mounted. If you compile the radeon module into the kernel, you'll either have to use an initrd with the firmware blob, or you have to compile the blob into the kernel. The other alternative (which is what I have done) is to compile readeon as a module, which will leave you with a VGA console until the module has loaded, but will avoid all firmware problems.

----------

## audiodef

Loading video drivers as modules does indeed correct this heinous issue!   :Cool: 

EDIT: While using modules works, I should note that I've found that KMS interferes somehow with KVM. When I run a VM with KMS enabled, it is S. L. O. W. Without KMS, lightning quick.

----------

## bandreabis

 *DirtyHairy wrote:*   

> I agree with quarksoup: the problem is the failure to load the firmware, which is  not available before root gets mounted. If you compile the radeon module into the kernel, you'll either have to use an initrd with the firmware blob, or you have to compile the blob into the kernel. The other alternative (which is what I have done) is to compile readeon as a module, which will leave you with a VGA console until the module has loaded, but will avoid all firmware problems.

 

Hi, resuming this thread to solve my problem, I've a question for you.

Compiling radeon as a module (and so compiling KMS as a module) do I have to set up firmware under Generic Driver Options?

I set it up like quarksoup said but compiling kernel it says cannot find module R300_cp.bin.

This evening I can post the exect sentence.

----------

## BillWho

bandreabis,

If you build the drivers in-kernel, then you need to include the correct radeon firmware blob into the kernel.

Since you compiled radeon as a module, then do not configure firmware blobs built into the kernel - the drivers will autoload.

----------

## bandreabis

 *BillWho wrote:*   

> bandreabis,
> 
> If you build the drivers in-kernel, then you need to include the correct radeon firmware blob into the kernel.
> 
> Since you compiled radeon as a module, then do not configure firmware blobs built into the kernel - the drivers will autoload.

 

Thank you.

When trying to compile my kernel with 

```
Device Drivers  --->

   Generic Driver Options  --->

      (radeon/R300_cp.bin) External firmware blobs to build into the kernel binary

      (firmware) Firmware blobs root directory (NEW)
```

I receive the "No rule to make target" error.

Now I don't remember my last try, but surely this evening I'll try radeon module without firmware blobs configuration.

My hope is to get out of this tunnel.

Next step would be the test of suspend/resume.

Andrea

----------

## BillWho

bandreabis,

I'm running 3.8.0-rc3 kernel and this is my Generic Driver Options section:

(/sbin/hotplug) path to uevent helper                                                                                                               │ │  

  │ │                                                                              [*] Maintain a devtmpfs filesystem to mount at /dev                                                                                                 │ │  

  │ │                                                                              [*]   Automount devtmpfs at /dev, after the kernel mounted the rootfs                                                                               │ │  

  │ │                                                                              [*] Select only drivers that don't need compile-time external firmware                                                                              │ │  

  │ │                                                                              [*] Prevent firmware from being built                                                                                                               │ │  

  │ │                                                                              -*- Userspace firmware loading support                                                                                                              │ │  

  │ │                                                                              [ ]   Include in-kernel firmware blobs in kernel binary                                                                                             │ │  

  │ │                                                                              ()    External firmware blobs to build into the kernel binary                                                                                       │ │  

  │ │                                                                              [ ] Driver Core verbose debug messages                                                                                                              │ │  

  │ │                                                                              [ ] Managed device resources verbose debug messages                                                                                                 │ │

----------

## bandreabis

 *BillWho wrote:*   

> bandreabis,
> 
> I'm running 3.8.0-rc3 kernel and this is my Generic Driver Options section:
> 
> (/sbin/hotplug) path to uevent helper                                                                                                               │ │  
> ...

 

Simply building radeon as module helped to boot but not to have hardware acceleration.

I'm gonna try you config suggestion.

I'll tell you.

Thanks.

----------

## bandreabis

Nothing. I think that this out says I have not "hardware acceleration", have I?

```

Running synchronized to the vertical refresh.  The framerate should be

approximately the same as the monitor refresh rate.

GL_RENDERER   = Gallium 0.4 on ATI RS480

GL_VERSION    = 2.1 Mesa 9.0.1

GL_VENDOR     = X.Org R300 Project

GL_EXTENSIONS = GL_ARB_multisample GL_EXT_abgr GL_EXT_bgra GL_EXT_blend_color GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_copy_texture GL_EXT_polygon_offset GL_EXT_subtexture GL_EXT_texture_object GL_EXT_vertex_array GL_EXT_compiled_vertex_array GL_EXT_texture GL_EXT_texture3D GL_IBM_rasterpos_clip GL_ARB_point_parameters GL_EXT_draw_range_elements GL_EXT_packed_pixels GL_EXT_point_parameters GL_EXT_rescale_normal GL_EXT_separate_specular_color GL_EXT_texture_edge_clamp GL_SGIS_generate_mipmap GL_SGIS_texture_border_clamp GL_SGIS_texture_edge_clamp GL_SGIS_texture_lod GL_ARB_multitexture GL_IBM_multimode_draw_arrays GL_IBM_texture_mirrored_repeat GL_ARB_texture_cube_map GL_ARB_texture_env_add GL_ARB_transpose_matrix GL_EXT_blend_func_separate GL_EXT_fog_coord GL_EXT_multi_draw_arrays GL_EXT_secondary_color GL_EXT_texture_env_add GL_EXT_texture_filter_anisotropic GL_EXT_texture_lod_bias GL_INGR_blend_func_separate GL_NV_blend_square GL_NV_light_max_exponent GL_NV_texgen_reflection GL_NV_texture_env_combine4 GL_SUN_multi_draw_arrays GL_ARB_texture_border_clamp GL_ARB_texture_compression GL_EXT_framebuffer_object GL_EXT_texture_env_combine GL_EXT_texture_env_dot3 GL_MESA_window_pos GL_NV_packed_depth_stencil GL_NV_texture_rectangle GL_ARB_depth_texture GL_ARB_occlusion_query GL_ARB_shadow GL_ARB_texture_env_combine GL_ARB_texture_env_crossbar GL_ARB_texture_env_dot3 GL_ARB_texture_mirrored_repeat GL_ARB_window_pos GL_EXT_stencil_two_side GL_EXT_texture_cube_map GL_NV_fog_distance GL_APPLE_packed_pixels GL_APPLE_vertex_array_object GL_ARB_draw_buffers GL_ARB_fragment_program GL_ARB_fragment_shader GL_ARB_shader_objects GL_ARB_vertex_program GL_ARB_vertex_shader GL_ATI_draw_buffers GL_ATI_texture_env_combine3 GL_ATI_texture_float GL_EXT_shadow_funcs GL_EXT_stencil_wrap GL_MESA_pack_invert GL_MESA_ycbcr_texture GL_NV_primitive_restart GL_ARB_fragment_program_shadow GL_ARB_half_float_pixel GL_ARB_occlusion_query2 GL_ARB_point_sprite GL_ARB_shading_language_100 GL_ARB_sync GL_ARB_texture_non_power_of_two GL_ARB_vertex_buffer_object GL_ATI_blend_equation_separate GL_EXT_blend_equation_separate GL_OES_read_format GL_ARB_pixel_buffer_object GL_ARB_texture_float GL_ARB_texture_rectangle GL_EXT_pixel_buffer_object GL_EXT_texture_mirror_clamp GL_EXT_texture_rectangle GL_EXT_texture_sRGB GL_ARB_framebuffer_object GL_EXT_framebuffer_blit GL_EXT_framebuffer_multisample GL_EXT_packed_depth_stencil GL_ARB_vertex_array_object GL_ATI_separate_stencil GL_ATI_texture_mirror_once GL_EXT_gpu_program_parameters GL_EXT_texture_sRGB_decode GL_OES_EGL_image GL_ARB_copy_buffer GL_ARB_half_float_vertex GL_ARB_instanced_arrays GL_ARB_map_buffer_range GL_ARB_texture_rg GL_ARB_texture_swizzle GL_ARB_vertex_array_bgra GL_EXT_separate_shader_objects GL_EXT_texture_swizzle GL_EXT_vertex_array_bgra GL_NV_conditional_render GL_ARB_ES2_compatibility GL_ARB_debug_output GL_ARB_draw_elements_base_vertex GL_ARB_explicit_attrib_location GL_ARB_fragment_coord_conventions GL_ARB_provoking_vertex GL_ARB_sampler_objects GL_ARB_vertex_type_2_10_10_10_rev GL_EXT_provoking_vertex GL_EXT_texture_snorm GL_MESA_texture_signed_rgba GL_NV_texture_barrier GL_ARB_robustness GL_ARB_texture_storage GL_ARB_invalidate_subdata 

265 frames in 5.0 seconds = 52.969 FPS

298 frames in 5.0 seconds = 59.564 FPS

```

----------

## Gusar

*facepalm*

glxgears is not a benchmark!

It's working fine. And if you want to get it running with radeon built-in instead of a module, set the "Firmware blobs root directory" to /lib/firmware

----------

## bandreabis

 *Gusar wrote:*   

> *facepalm*
> 
> glxgears is not a benchmark!
> 
> It's working fine. And if you want to get it running with radeon built-in instead of a module, set the "Firmware blobs root directory" to /lib/firmware

 

Yes yes. I know.

But I'm not focusing to frames.

Shouldn't glxinfo show the name of the video card [Chipset: "ATI Radeon XPRESS 200M 5955 (PCIE)" (ChipID = 0x5955)] or something like it instead of 

```
OpenGL vendor string: X.Org R300 Project

OpenGL renderer string: Gallium 0.4 on ATI RS480
```

----------

## Gusar

I don't see why it should. lspci uses the database in /usr/share/hwdata for it's info. There's no rule to say glxinfo must as well. What matters is that glxinfo doesn't show a software renderer (software rasterizer, softpipe or llvmpipe).

----------

## bandreabis

 *Gusar wrote:*   

> I don't see why it should. lspci uses the database in /usr/share/hwdata for it's info. There's no rule to say glxinfo must as well. What matters is that glxinfo doesn't show a software renderer (software rasterizer, softpipe or llvmpipe).

 

WOW, thank you.

I just tried to activate opengl kde composition effects, and it worked.

Chapter closed.

Now it's time to test suspension.

----------

## BillWho

bandreabis,

I don't know how much 'performance' you expect, but you can try echo dynpm > /sys/class/drm/card0/device/power_method

That should  ramp up performance when running GPU intensive apps, and ramp down when the GPU is idle   :Wink: 

You might want to check what it's defaulting to first.

----------

## bandreabis

I don't expect any high performance from my old Xpress 200M. 

I expected to make it work with KMS and latest Xorg Stuff (without overlaying old drivers), and I achieved it thanks to your help.

I also expected to make suspend/resume work also with KMS drivers! And I did it thanks to this: 

```
Edit the file radeon_combios.c and find the line that says /* DYN CLK 1 */

Just before that line add the following:

/* quirk for rs4xx laptop to make it resume

* - it hangs on resume inside the dynclk 1 table.

*/

if (rdev->family == CHIP_RS480)

return;

After changing this, then simply compile your kernel, package it and install it. With KMS enabled it works like a charm.
```

Thank you everybody, also Gusar.

I'm going sleeping very happy.

See you.

Andrea

----------

