@@ -19,7 +19,7 @@
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
AC_PREREQ(2.60)
-AC_INIT([libdrm], 2.4.18, [dri-devel@lists.sourceforge.net], libdrm)
+AC_INIT([libdrm], 2.4.19, [dri-devel@lists.sourceforge.net], libdrm)
AC_USE_SYSTEM_EXTENSIONS
AC_CONFIG_SRCDIR([Makefile.am])
AM_INIT_AUTOMAKE([dist-bzip2])
@@ -797,9 +797,10 @@ drmVersionPtr drmGetLibVersion(int fd)
* revision 1.2.x = added drmSetInterfaceVersion
* modified drmOpen to handle both busid and name
* revision 1.3.x = added server + memory manager
+ * revision 1.4.x = added drmCheckModuleAndModesettingSupported
*/
version->version_major = 1;
- version->version_minor = 3;
+ version->version_minor = 4;
version->version_patchlevel = 0;
return (drmVersionPtr)version;
@@ -655,7 +655,8 @@ int drmModeConnectorSetProperty(int fd, uint32_t connector_id, uint32_t property
* -EINVAL or invalid bus id
* -ENOSYS if no modesetting support
*/
-int drmCheckModesettingSupported(const char *busid)
+int drmCheckModuleAndModesettingSupported(const char *module_name,
+ const char *busid)
{
#ifdef __linux__
char pci_dev_dir[1024];
@@ -664,6 +665,28 @@ int drmCheckModesettingSupported(const char *busid)
struct dirent *dent;
int found = 0, ret;
+ if (module_name) {
+ /* Check that kernel module is loaded */
+ /* If first try fails try again soon after */
+ int retries = 1;
+ int fd;
+ do {
+ fd = drmOpen( module_name, busid );
+ if (fd != -1)
+ break;
+ if (!retries--)
+ break;
+ usleep(100000);
+ } while (1);
+
+ if (fd == -1)
+ return -ENOSYS;
+
+ drmClose(fd);
+ } else {
+ drmMsg("[drm] Checking for kernel modesetting without module_name is deprecated.\n");
+ }
+
ret = sscanf(busid, "pci:%04x:%02x:%02x.%d", &domain, &bus, &dev, &func);
if (ret != 4)
return -EINVAL;
@@ -712,6 +735,10 @@ int drmCheckModesettingSupported(const char *busid)
}
+int drmCheckModesettingSupported(const char *busid)
+{
+ return drmCheckModuleAndModesettingSupported(NULL, busid);
+}
int drmModeCrtcGetGamma(int fd, uint32_t crtc_id, uint32_t size,
uint16_t *red, uint16_t *green, uint16_t *blue)
{
@@ -378,6 +378,12 @@ extern drmModePropertyBlobPtr drmModeGetPropertyBlob(int fd, uint32_t blob_id);
extern void drmModeFreePropertyBlob(drmModePropertyBlobPtr ptr);
extern int drmModeConnectorSetProperty(int fd, uint32_t connector_id, uint32_t property_id,
uint64_t value);
+
+extern int drmCheckModuleAndModesettingSupported(const char *module_name,
+ const char *busid);
+/**
+ * Deprecated because of possible bugs that kernel module is not loaded early
+ */
extern int drmCheckModesettingSupported(const char *busid);
extern int drmModeCrtcSetGamma(int fd, uint32_t crtc_id, uint32_t size,