use drm_cards_limit instead of cards_limit

main
Dave Airlie 2006-01-02 05:54:10 +00:00
parent 781d96c61f
commit 92150972e5
4 changed files with 12 additions and 12 deletions

View File

@ -981,7 +981,7 @@ extern int drm_get_dev(struct pci_dev *pdev, const struct pci_device_id *ent,
extern int drm_put_dev(drm_device_t * dev);
extern int drm_put_head(drm_head_t * head);
extern unsigned int drm_debug; /* 1 to enable debug output */
extern unsigned int cards_limit;
extern unsigned int drm_cards_limit;
extern drm_head_t **drm_heads;
extern struct drm_sysfs_class *drm_class;
extern struct proc_dir_entry *drm_proc_root;

View File

@ -385,7 +385,7 @@ void __exit drm_exit(struct drm_driver *driver)
DRM_DEBUG("\n");
if (drm_fb_loaded) {
for (i = 0; i < cards_limit; i++) {
for (i = 0; i < drm_cards_limit; i++) {
head = drm_heads[i];
if (!head)
continue;
@ -417,9 +417,9 @@ static int __init drm_core_init(void)
{
int ret = -ENOMEM;
cards_limit =
(cards_limit < DRM_MAX_MINOR + 1 ? cards_limit : DRM_MAX_MINOR + 1);
drm_heads = drm_calloc(cards_limit, sizeof(*drm_heads), DRM_MEM_STUB);
drm_cards_limit =
(drm_cards_limit < DRM_MAX_MINOR + 1 ? drm_cards_limit : DRM_MAX_MINOR + 1);
drm_heads = drm_calloc(drm_cards_limit, sizeof(*drm_heads), DRM_MEM_STUB);
if (!drm_heads)
goto err_p1;
@ -450,7 +450,7 @@ err_p3:
drm_sysfs_destroy(drm_class);
err_p2:
unregister_chrdev(DRM_MAJOR, "drm");
drm_free(drm_heads, sizeof(*drm_heads) * cards_limit, DRM_MEM_STUB);
drm_free(drm_heads, sizeof(*drm_heads) * drm_cards_limit, DRM_MEM_STUB);
err_p1:
return ret;
}
@ -462,7 +462,7 @@ static void __exit drm_core_exit(void)
unregister_chrdev(DRM_MAJOR, "drm");
drm_free(drm_heads, sizeof(*drm_heads) * cards_limit, DRM_MEM_STUB);
drm_free(drm_heads, sizeof(*drm_heads) * drm_cards_limit, DRM_MEM_STUB);
}
module_init(drm_core_init);

View File

@ -133,7 +133,7 @@ int drm_open(struct inode *inode, struct file *filp)
int minor = iminor(inode);
int retcode = 0;
if (!((minor >= 0) && (minor < cards_limit)))
if (!((minor >= 0) && (minor < drm_cards_limit)))
return -ENODEV;
if (!drm_heads[minor])
@ -175,7 +175,7 @@ int drm_stub_open(struct inode *inode, struct file *filp)
DRM_DEBUG("\n");
if (!((minor >= 0) && (minor < cards_limit)))
if (!((minor >= 0) && (minor < drm_cards_limit)))
return -ENODEV;
if (!drm_heads[minor])

View File

@ -37,7 +37,7 @@
#include "drmP.h"
#include "drm_core.h"
unsigned int cards_limit = 16; /* Enough for one machine */
unsigned int drm_cards_limit = 16; /* Enough for one machine */
unsigned int drm_debug = 0; /* 1 to enable debug output */
EXPORT_SYMBOL(drm_debug);
@ -47,7 +47,7 @@ MODULE_LICENSE("GPL and additional rights");
MODULE_PARM_DESC(cards_limit, "Maximum number of graphics cards");
MODULE_PARM_DESC(debug, "Enable debug output");
module_param(cards_limit, int, S_IRUGO);
module_param_named(cards_limit, drm_cards_limit, int, S_IRUGO);
module_param_named(debug, drm_debug, int, S_IRUGO|S_IWUGO);
drm_head_t **drm_heads;
@ -149,7 +149,7 @@ static int drm_get_head(drm_device_t * dev, drm_head_t * head)
DRM_DEBUG("\n");
for (minor = 0; minor < cards_limit; minor++, heads++) {
for (minor = 0; minor < drm_cards_limit; minor++, heads++) {
if (!*heads) {
*head = (drm_head_t) {