All of lore.kernel.org
 help / color / mirror / Atom feed
* drm: Request for help about drm_mode_getresources( ) returns empty modes message
@ 2015-02-06 10:10 He YunLei
  0 siblings, 0 replies; only message in thread
From: He YunLei @ 2015-02-06 10:10 UTC (permalink / raw)
  To: dri-devel; +Cc: Bintian


hi all,
     when I run modetest process in libdrm to test our drm module, I find a strange problem:
     The test successfully opened /dev/dri/card0 (major:226 minor:0) device by using module name.
but the returned message about crtc, encoder and connector are all empty. I confirm the num of them
is one when our drm device driver register in kernel. So I track the kernel and find here:

     drivers/gpu/drm/drm_crtc.c

     1806         if (!drm_is_primary_client(file_priv)) {
     1807
     1808                 mode_group = NULL;
     1809                 list_for_each(lh, &dev->mode_config.crtc_list)
     1810                         crtc_count++;
     1811
     1812                 list_for_each(lh, &dev->mode_config.connector_list)
     1813                         connector_count++;
     1814
     1815                 list_for_each(lh, &dev->mode_config.encoder_list)
     1816                         encoder_count++;
     1817         } else {
     1818
     1819                 mode_group = &file_priv->master->minor->mode_group;
     1820                 crtc_count = mode_group->num_crtcs;
     1821                 connector_count = mode_group->num_connectors;
     1822                 encoder_count = mode_group->num_encoders;
     1823         }

     The device we opened with type of DRM_MINOR_LEGACY, so here come into else branch. The description
of drm_mode_group is that struct drm_mode_group - group of mode setting resources for potential sub-grouping,
and  the note in drm_crtc.h also said :

      943  * Currently this simply tracks the global mode setting state.  But in the
      944  * future it could allow groups of objects to be set aside into independent
      945  * control groups for use by different user level processes (e.g. two X servers
      946  * running simultaneously on different heads, each with their own mode
      947  * configuration and freedom of mode setting).

     I doubt the empty result has some relations with it, so I continue to track the kernel in function
drm_open, and I find mode_group lies in drm_minor, whick can be found by inode in function drm_open.
But when we create a crtc, encoder or connector, we do nothing to mode_group, just initializing it
when  drm_core register. Can you help me and give me some advice?

regards,
Yunlei He



_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-02-06 10:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-06 10:10 drm: Request for help about drm_mode_getresources( ) returns empty modes message He YunLei

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.