Subversion Repositories Kolibri OS

Rev

Rev 1964 | Rev 2161 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1964 Rev 1987
Line 128... Line 128...
128
        printk("Warning %s " format, __func__ , ## arg)
128
        printk("Warning %s " format, __func__ , ## arg)
Line 129... Line 129...
129
 
129
 
130
#define dev_info(dev, format, arg...)       \
130
#define dev_info(dev, format, arg...)       \
Line 131... Line -...
131
        printk("Info %s " format , __func__, ## arg)
-
 
132
 
-
 
133
/**
-
 
134
 * This structure defines the drm_mm memory object, which will be used by the
-
 
135
 * DRM for its buffer objects.
-
 
136
 */
-
 
137
struct drm_gem_object {
-
 
138
    /** Reference count of this object */
-
 
139
    struct kref refcount;
-
 
140
 
-
 
141
    /** Handle count of this object. Each handle also holds a reference */
-
 
142
    struct kref handlecount;
-
 
143
 
-
 
144
    /** Related drm device */
-
 
145
    struct drm_device *dev;
-
 
146
 
-
 
147
    /** File representing the shmem storage */
-
 
148
//    struct file *filp;
-
 
149
 
-
 
150
    /* Mapping info for this object */
-
 
151
//    struct drm_map_list map_list;
-
 
152
 
-
 
153
    /**
-
 
154
     * Size of the object, in bytes.  Immutable over the object's
-
 
155
     * lifetime.
-
 
156
     */
-
 
157
    size_t size;
-
 
158
 
-
 
159
    /**
-
 
160
     * Global name for this object, starts at 1. 0 means unnamed.
-
 
161
     * Access is covered by the object_name_lock in the related drm_device
-
 
162
     */
-
 
163
    int name;
-
 
164
 
-
 
165
    /**
-
 
166
     * Memory domains. These monitor which caches contain read/write data
-
 
167
     * related to the object. When transitioning from one set of domains
-
 
168
     * to another, the driver is called to ensure that caches are suitably
-
 
169
     * flushed and invalidated
-
 
170
     */
-
 
171
    uint32_t read_domains;
-
 
172
    uint32_t write_domain;
-
 
173
 
-
 
174
    /**
-
 
175
     * While validating an exec operation, the
-
 
176
     * new read/write domain values are computed here.
-
 
177
     * They will be transferred to the above values
-
 
178
     * at the point that any cache flushing occurs
-
 
179
     */
-
 
Line 180... Line -...
180
    uint32_t pending_read_domains;
-
 
181
    uint32_t pending_write_domain;
-
 
Line 182... Line 131...
182
 
131
        printk("Info %s " format , __func__, ## arg)
183
    void *driver_private;
132
 
Line 184... Line 133...
184
};
133
 
Line 666... Line 615...
666
struct drm_gem_mm {
615
struct drm_gem_mm {
667
	struct drm_mm offset_manager;	/**< Offset mgmt for buffer objects */
616
	struct drm_mm offset_manager;	/**< Offset mgmt for buffer objects */
668
	struct drm_open_hash offset_hash; /**< User token hash table for maps */
617
	struct drm_open_hash offset_hash; /**< User token hash table for maps */
669
};
618
};
Line -... Line 619...
-
 
619
 
-
 
620
#endif
670
 
621
 
671
/**
622
/**
672
 * This structure defines the drm_mm memory object, which will be used by the
623
 * This structure defines the drm_mm memory object, which will be used by the
673
 * DRM for its buffer objects.
624
 * DRM for its buffer objects.
674
 */
625
 */
Line 684... Line 635...
684
 
635
 
685
	/** File representing the shmem storage */
636
	/** File representing the shmem storage */
Line 686... Line 637...
686
	struct file *filp;
637
	struct file *filp;
687
 
638
 
Line 688... Line 639...
688
	/* Mapping info for this object */
639
	/* Mapping info for this object */
689
	struct drm_map_list map_list;
640
//	struct drm_map_list map_list;
690
 
641
 
691
	/**
642
	/**
Line 719... Line 670...
719
	uint32_t pending_write_domain;
670
	uint32_t pending_write_domain;
Line 720... Line 671...
720
 
671
 
721
	void *driver_private;
672
	void *driver_private;
Line -... Line 673...
-
 
673
};
-
 
674
 
722
};
675
#if 0
Line 723... Line 676...
723
 
676
 
724
#include "drm_crtc.h"
677
#include "drm_crtc.h"
Line 1631... Line 1584...
1631
}
1584
}
Line 1632... Line 1585...
1632
 
1585
 
1633
int drm_gem_handle_create(struct drm_file *file_priv,
1586
int drm_gem_handle_create(struct drm_file *file_priv,
1634
			  struct drm_gem_object *obj,
1587
			  struct drm_gem_object *obj,
-
 
1588
			  u32 *handlep);
Line 1635... Line 1589...
1635
			  u32 *handlep);
1589
int drm_gem_handle_delete(struct drm_file *filp, u32 handle);
1636
 
1590
 
1637
static inline void
1591
static inline void
1638
drm_gem_object_handle_reference(struct drm_gem_object *obj)
1592
drm_gem_object_handle_reference(struct drm_gem_object *obj)
1639
{
1593
{
1640
	drm_gem_object_reference(obj);
1594
	drm_gem_object_reference(obj);
Line 1641... Line 1595...
1641
	kref_get(&obj->handlecount);
1595
	atomic_inc(&obj->handle_count);
1642
}
1596
}
1643
 
1597
 
1644
static inline void
1598
static inline void
1645
drm_gem_object_handle_unreference(struct drm_gem_object *obj)
1599
drm_gem_object_handle_unreference(struct drm_gem_object *obj)
Line -... Line 1600...
-
 
1600
{
-
 
1601
	if (obj == NULL)
1646
{
1602
		return;
1647
	if (obj == NULL)
1603
 
1648
		return;
1604
	if (atomic_read(&obj->handle_count) == 0)
1649
 
1605
		return;
1650
	/*
1606
	/*
Line 1680... Line 1636...
1680
	    if (_entry->user_token == token)
1636
	    if (_entry->user_token == token)
1681
		return _entry->map;
1637
		return _entry->map;
1682
	return NULL;
1638
	return NULL;
1683
}
1639
}
Line 1684... Line -...
1684
 
-
 
1685
 
1640
 
1686
static __inline__ void drm_core_dropmap(struct drm_local_map *map)
1641
static __inline__ void drm_core_dropmap(struct drm_local_map *map)
1687
{
1642
{