Bug 198936 - [drm] Xorg consume 100% with XFCE after latest DRM2 changes
Summary: [drm] Xorg consume 100% with XFCE after latest DRM2 changes
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2015-03-26 21:59 UTC by Hans Petter Selasky
Modified: 2015-04-28 19:35 UTC (History)
1 user (show)

See Also:


Attachments
Patch suggestion (1.33 KB, patch)
2015-03-26 21:59 UTC, Hans Petter Selasky
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hans Petter Selasky freebsd_committer freebsd_triage 2015-03-26 21:59:15 UTC
Created attachment 154848 [details]
Patch suggestion

Hi,

Without the attached kernel patch(es), Xorg starts consuming alot of CPU and becomes very unresponsive and unusable.

Using ktrace reveals that X-org is issuing DRM_IOCTL_MODE_GETCONNECTOR over and over again with no apparent reason. It doesn't happen when using a simple window manager like blackbox. I was not able to use XFCE4 (9-stable userland) with 11-current kernel at all, after the latest DRM2 kernel updates. It worked fine before the update.

I'm not sure what is causing it. Going through the new DRM2 code revealed that a mode sorting function did not take all parameters like interlaced or not into account, causing the mode list to be reshuffelled every time a new mode scan was done. Not sure if Xorg cares about this though.

I can test patches if you have other suggestions.

--HPS
Comment 1 commit-hook freebsd_committer freebsd_triage 2015-03-29 18:46:20 UTC
A commit references this bug:

Author: dumbbell
Date: Sun Mar 29 18:45:52 UTC 2015
New revision: 280814
URL: https://svnweb.freebsd.org/changeset/base/280814

Log:
  drm: Import Linux commit 9bc3cd5673d84d29272fa7181a4dfca83cbb48c1

  Author: Ville Syrj?l? <ville.syrjala@linux.intel.com>
  Date:   Fri May 31 12:17:08 2013 +0000

      drm: Sort connector modes based on vrefresh

      Keeping the modes sorted by vrefresh before the pixel clock makes the
      mode list somehow more pleasing to the eye.

      Signed-off-by: Ville Syrj?l? <ville.syrjala@linux.intel.com>
      Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
      Signed-off-by: Dave Airlie <airlied@redhat.com>

  PR:		198936
  Obtained from:	Linux
  MFC after:	1 month
  MFC with:	r280183

Changes:
  head/sys/dev/drm2/drm_crtc_helper.c
  head/sys/dev/drm2/drm_modes.c
Comment 2 Jean-Sébastien Pédron freebsd_committer freebsd_triage 2015-03-29 18:49:29 UTC
Hi!

I could reproduce a similar problem with my external monitor. I committed this patch from Linux, it helped here. Does it fix the problem for you?
Comment 3 Hans Petter Selasky freebsd_committer freebsd_triage 2015-03-30 08:05:49 UTC
I will try to re-test 11-current when I find some time!
Comment 4 Hans Petter Selasky freebsd_committer freebsd_triage 2015-04-01 09:12:40 UTC
Hi,

r280814 seems to fix the issue. I'll reopen if not. Thank you!

--HPS
Comment 5 commit-hook freebsd_committer freebsd_triage 2015-04-28 19:35:57 UTC
A commit references this bug:

Author: dumbbell
Date: Tue Apr 28 19:35:07 UTC 2015
New revision: 282199
URL: https://svnweb.freebsd.org/changeset/base/282199

Log:
  drm: Update the device-independent code to match Linux 3.8.13

  This update brings few features:
      o  Support for the setmaster/dropmaster ioctls. For instance, they
         are used to run multiple X servers simultaneously.
      o  Support for minor devices. The only user-visible change is a new
         entry in /dev/dri but it is useless at the moment. This is a
         first step to support render nodes [1].

  The main benefit is to greatly reduce the diff with Linux (at the
  expense of an unreadable commit diff). Hopefully, next upgrades will be
  easier.

  No updates were made to the drivers, beside adapting them to API
  changes.

  [1] https://en.wikipedia.org/wiki/Direct_Rendering_Manager#Render_nodes

  r280814 is merged at the same time to avoid a short window where RANDR
  might be broken:

  drm: Import Linux commit 9bc3cd5673d84d29272fa7181a4dfca83cbb48c1

  Author: Ville Syrj?l? <ville.syrjala@linux.intel.com>
  Date:   Fri May 31 12:17:08 2013 +0000

      drm: Sort connector modes based on vrefresh

      Keeping the modes sorted by vrefresh before the pixel clock makes the
      mode list somehow more pleasing to the eye.

      Signed-off-by: Ville Syrj?l? <ville.syrjala@linux.intel.com>
      Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
      Signed-off-by: Dave Airlie <airlied@redhat.com>

  PR:		198936 (r280814)
  Tested by:	Many people
  MFC of:		r280183, r280187 (original commit by glebius), r280814
  Relnotes:	yes

Changes:
_U  stable/10/
  stable/10/sys/dev/drm2/ati_pcigart.c
  stable/10/sys/dev/drm2/drm.h
  stable/10/sys/dev/drm2/drmP.h
  stable/10/sys/dev/drm2/drm_agpsupport.c
  stable/10/sys/dev/drm2/drm_atomic.h
  stable/10/sys/dev/drm2/drm_auth.c
  stable/10/sys/dev/drm2/drm_buffer.c
  stable/10/sys/dev/drm2/drm_bufs.c
  stable/10/sys/dev/drm2/drm_context.c
  stable/10/sys/dev/drm2/drm_crtc.c
  stable/10/sys/dev/drm2/drm_crtc.h
  stable/10/sys/dev/drm2/drm_crtc_helper.c
  stable/10/sys/dev/drm2/drm_crtc_helper.h
  stable/10/sys/dev/drm2/drm_dma.c
  stable/10/sys/dev/drm2/drm_dp_helper.c
  stable/10/sys/dev/drm2/drm_dp_iic_helper.c
  stable/10/sys/dev/drm2/drm_drawable.c
  stable/10/sys/dev/drm2/drm_drv.c
  stable/10/sys/dev/drm2/drm_edid.c
  stable/10/sys/dev/drm2/drm_edid.h
  stable/10/sys/dev/drm2/drm_edid_modes.h
  stable/10/sys/dev/drm2/drm_fb_helper.c
  stable/10/sys/dev/drm2/drm_fb_helper.h
  stable/10/sys/dev/drm2/drm_fops.c
  stable/10/sys/dev/drm2/drm_fourcc.h
  stable/10/sys/dev/drm2/drm_gem.c
  stable/10/sys/dev/drm2/drm_gem_names.c
  stable/10/sys/dev/drm2/drm_global.c
  stable/10/sys/dev/drm2/drm_hashtab.c
  stable/10/sys/dev/drm2/drm_internal.h
  stable/10/sys/dev/drm2/drm_ioc32.c
  stable/10/sys/dev/drm2/drm_ioctl.c
  stable/10/sys/dev/drm2/drm_irq.c
  stable/10/sys/dev/drm2/drm_lock.c
  stable/10/sys/dev/drm2/drm_memory.c
  stable/10/sys/dev/drm2/drm_mm.c
  stable/10/sys/dev/drm2/drm_mm.h
  stable/10/sys/dev/drm2/drm_mode.h
  stable/10/sys/dev/drm2/drm_modes.c
  stable/10/sys/dev/drm2/drm_os_freebsd.c
  stable/10/sys/dev/drm2/drm_os_freebsd.h
  stable/10/sys/dev/drm2/drm_pci.c
  stable/10/sys/dev/drm2/drm_pciids.h
  stable/10/sys/dev/drm2/drm_sarea.h
  stable/10/sys/dev/drm2/drm_scatter.c
  stable/10/sys/dev/drm2/drm_sman.c
  stable/10/sys/dev/drm2/drm_sman.h
  stable/10/sys/dev/drm2/drm_stub.c
  stable/10/sys/dev/drm2/drm_sysctl.c
  stable/10/sys/dev/drm2/drm_vm.c
  stable/10/sys/dev/drm2/i915/i915_debug.c
  stable/10/sys/dev/drm2/i915/i915_dma.c
  stable/10/sys/dev/drm2/i915/i915_drm.h
  stable/10/sys/dev/drm2/i915/i915_drv.c
  stable/10/sys/dev/drm2/i915/i915_drv.h
  stable/10/sys/dev/drm2/i915/i915_gem.c
  stable/10/sys/dev/drm2/i915/i915_gem_context.c
  stable/10/sys/dev/drm2/i915/i915_gem_evict.c
  stable/10/sys/dev/drm2/i915/i915_gem_execbuffer.c
  stable/10/sys/dev/drm2/i915/i915_gem_gtt.c
  stable/10/sys/dev/drm2/i915/i915_gem_tiling.c
  stable/10/sys/dev/drm2/i915/i915_ioc32.c
  stable/10/sys/dev/drm2/i915/i915_irq.c
  stable/10/sys/dev/drm2/i915/i915_suspend.c
  stable/10/sys/dev/drm2/i915/intel_crt.c
  stable/10/sys/dev/drm2/i915/intel_display.c
  stable/10/sys/dev/drm2/i915/intel_dp.c
  stable/10/sys/dev/drm2/i915/intel_fb.c
  stable/10/sys/dev/drm2/i915/intel_hdmi.c
  stable/10/sys/dev/drm2/i915/intel_iic.c
  stable/10/sys/dev/drm2/i915/intel_lvds.c
  stable/10/sys/dev/drm2/i915/intel_modes.c
  stable/10/sys/dev/drm2/i915/intel_opregion.c
  stable/10/sys/dev/drm2/i915/intel_overlay.c
  stable/10/sys/dev/drm2/i915/intel_panel.c
  stable/10/sys/dev/drm2/i915/intel_ringbuffer.c
  stable/10/sys/dev/drm2/i915/intel_sdvo.c
  stable/10/sys/dev/drm2/i915/intel_tv.c
  stable/10/sys/dev/drm2/radeon/atom.c
  stable/10/sys/dev/drm2/radeon/atombios_crtc.c
  stable/10/sys/dev/drm2/radeon/atombios_dp.c
  stable/10/sys/dev/drm2/radeon/atombios_encoders.c
  stable/10/sys/dev/drm2/radeon/atombios_i2c.c
  stable/10/sys/dev/drm2/radeon/cayman_blit_shaders.c
  stable/10/sys/dev/drm2/radeon/evergreen.c
  stable/10/sys/dev/drm2/radeon/evergreen_blit_shaders.c
  stable/10/sys/dev/drm2/radeon/evergreen_cs.c
  stable/10/sys/dev/drm2/radeon/evergreen_reg.h
  stable/10/sys/dev/drm2/radeon/ni.c
  stable/10/sys/dev/drm2/radeon/nid.h
  stable/10/sys/dev/drm2/radeon/r100.c
  stable/10/sys/dev/drm2/radeon/r200.c
  stable/10/sys/dev/drm2/radeon/r300.c
  stable/10/sys/dev/drm2/radeon/r300_cmdbuf.c
  stable/10/sys/dev/drm2/radeon/r420.c
  stable/10/sys/dev/drm2/radeon/r500_reg.h
  stable/10/sys/dev/drm2/radeon/r600.c
  stable/10/sys/dev/drm2/radeon/r600_blit.c
  stable/10/sys/dev/drm2/radeon/r600_blit_shaders.c
  stable/10/sys/dev/drm2/radeon/r600_cp.c
  stable/10/sys/dev/drm2/radeon/r600_cs.c
  stable/10/sys/dev/drm2/radeon/r600_hdmi.c
  stable/10/sys/dev/drm2/radeon/r600d.h
  stable/10/sys/dev/drm2/radeon/radeon.h
  stable/10/sys/dev/drm2/radeon/radeon_acpi.c
  stable/10/sys/dev/drm2/radeon/radeon_agp.c
  stable/10/sys/dev/drm2/radeon/radeon_atombios.c
  stable/10/sys/dev/drm2/radeon/radeon_atpx_handler.c
  stable/10/sys/dev/drm2/radeon/radeon_benchmark.c
  stable/10/sys/dev/drm2/radeon/radeon_bios.c
  stable/10/sys/dev/drm2/radeon/radeon_clocks.c
  stable/10/sys/dev/drm2/radeon/radeon_combios.c
  stable/10/sys/dev/drm2/radeon/radeon_connectors.c
  stable/10/sys/dev/drm2/radeon/radeon_cp.c
  stable/10/sys/dev/drm2/radeon/radeon_cs.c
  stable/10/sys/dev/drm2/radeon/radeon_device.c
  stable/10/sys/dev/drm2/radeon/radeon_display.c
  stable/10/sys/dev/drm2/radeon/radeon_drm.h
  stable/10/sys/dev/drm2/radeon/radeon_drv.c
  stable/10/sys/dev/drm2/radeon/radeon_drv.h
  stable/10/sys/dev/drm2/radeon/radeon_fb.c
  stable/10/sys/dev/drm2/radeon/radeon_fence.c
  stable/10/sys/dev/drm2/radeon/radeon_gart.c
  stable/10/sys/dev/drm2/radeon/radeon_gem.c
  stable/10/sys/dev/drm2/radeon/radeon_i2c.c
  stable/10/sys/dev/drm2/radeon/radeon_ioc32.c
  stable/10/sys/dev/drm2/radeon/radeon_irq_kms.c
  stable/10/sys/dev/drm2/radeon/radeon_irq_kms.h
  stable/10/sys/dev/drm2/radeon/radeon_kms.c
  stable/10/sys/dev/drm2/radeon/radeon_legacy_crtc.c
  stable/10/sys/dev/drm2/radeon/radeon_legacy_encoders.c
  stable/10/sys/dev/drm2/radeon/radeon_legacy_tv.c
  stable/10/sys/dev/drm2/radeon/radeon_mem.c
  stable/10/sys/dev/drm2/radeon/radeon_object.c
  stable/10/sys/dev/drm2/radeon/radeon_object.h
  stable/10/sys/dev/drm2/radeon/radeon_pm.c
  stable/10/sys/dev/drm2/radeon/radeon_ring.c
  stable/10/sys/dev/drm2/radeon/radeon_sa.c
  stable/10/sys/dev/drm2/radeon/radeon_semaphore.c
  stable/10/sys/dev/drm2/radeon/radeon_state.c
  stable/10/sys/dev/drm2/radeon/radeon_test.c
  stable/10/sys/dev/drm2/radeon/radeon_ttm.c
  stable/10/sys/dev/drm2/radeon/rs400.c
  stable/10/sys/dev/drm2/radeon/rs600.c
  stable/10/sys/dev/drm2/radeon/rs690.c
  stable/10/sys/dev/drm2/radeon/rv515.c
  stable/10/sys/dev/drm2/radeon/rv770.c
  stable/10/sys/dev/drm2/radeon/si.c
  stable/10/sys/dev/drm2/radeon/si_blit_shaders.c
  stable/10/sys/dev/drm2/radeon/sid.h
  stable/10/sys/dev/drm2/ttm/ttm_bo.c
  stable/10/sys/dev/drm2/ttm/ttm_bo_util.c
  stable/10/sys/dev/drm2/ttm/ttm_bo_vm.c
  stable/10/sys/dev/drm2/ttm/ttm_lock.c
  stable/10/sys/modules/Makefile
  stable/10/sys/modules/drm2/Makefile
  stable/10/sys/modules/drm2/drm2/Makefile
  stable/10/sys/modules/drm2/radeonkms/Makefile