Subversion Repositories Kolibri OS

Rev

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

Rev 1630 Rev 2003
Line 311... Line 311...
311
 * ttm_bo_validate
311
 * ttm_bo_validate
312
 *
312
 *
313
 * @bo: The buffer object.
313
 * @bo: The buffer object.
314
 * @placement: Proposed placement for the buffer object.
314
 * @placement: Proposed placement for the buffer object.
315
 * @interruptible: Sleep interruptible if sleeping.
315
 * @interruptible: Sleep interruptible if sleeping.
-
 
316
 * @no_wait_reserve: Return immediately if other buffers are busy.
316
 * @no_wait: Return immediately if the buffer is busy.
317
 * @no_wait_gpu: Return immediately if the GPU is busy.
317
 *
318
 *
318
 * Changes placement and caching policy of the buffer object
319
 * Changes placement and caching policy of the buffer object
319
 * according proposed placement.
320
 * according proposed placement.
320
 * Returns
321
 * Returns
321
 * -EINVAL on invalid proposed placement.
322
 * -EINVAL on invalid proposed placement.
Line 323... Line 324...
323
 * -EBUSY if no_wait is true and buffer busy.
324
 * -EBUSY if no_wait is true and buffer busy.
324
 * -ERESTARTSYS if interrupted by a signal.
325
 * -ERESTARTSYS if interrupted by a signal.
325
 */
326
 */
326
extern int ttm_bo_validate(struct ttm_buffer_object *bo,
327
extern int ttm_bo_validate(struct ttm_buffer_object *bo,
327
				struct ttm_placement *placement,
328
				struct ttm_placement *placement,
328
				bool interruptible, bool no_wait);
329
				bool interruptible, bool no_wait_reserve,
-
 
330
				bool no_wait_gpu);
Line 329... Line 331...
329
 
331
 
330
/**
332
/**
331
 * ttm_bo_unref
333
 * ttm_bo_unref
332
 *
334
 *
Line 372... Line 374...
372
 * @page_alignment: Data alignment in pages.
374
 * @page_alignment: Data alignment in pages.
373
 * @buffer_start: Virtual address of user space data backing a
375
 * @buffer_start: Virtual address of user space data backing a
374
 * user buffer object.
376
 * user buffer object.
375
 * @interruptible: If needing to sleep to wait for GPU resources,
377
 * @interruptible: If needing to sleep to wait for GPU resources,
376
 * sleep interruptible.
378
 * sleep interruptible.
377
 * @persistant_swap_storage: Usually the swap storage is deleted for buffers
379
 * @persistent_swap_storage: Usually the swap storage is deleted for buffers
378
 * pinned in physical memory. If this behaviour is not desired, this member
380
 * pinned in physical memory. If this behaviour is not desired, this member
379
 * holds a pointer to a persistant shmem object. Typically, this would
381
 * holds a pointer to a persistent shmem object. Typically, this would
380
 * point to the shmem object backing a GEM object if TTM is used to back a
382
 * point to the shmem object backing a GEM object if TTM is used to back a
381
 * GEM user interface.
383
 * GEM user interface.
382
 * @acc_size: Accounted size for this object.
384
 * @acc_size: Accounted size for this object.
383
 * @destroy: Destroy function. Use NULL for kfree().
385
 * @destroy: Destroy function. Use NULL for kfree().
384
 *
386
 *
385
 * This function initializes a pre-allocated struct ttm_buffer_object.
387
 * This function initializes a pre-allocated struct ttm_buffer_object.
386
 * As this object may be part of a larger structure, this function,
388
 * As this object may be part of a larger structure, this function,
387
 * together with the @destroy function,
389
 * together with the @destroy function,
388
 * enables driver-specific objects derived from a ttm_buffer_object.
390
 * enables driver-specific objects derived from a ttm_buffer_object.
389
 * On successful return, the object kref and list_kref are set to 1.
391
 * On successful return, the object kref and list_kref are set to 1.
-
 
392
 * If a failure occurs, the function will call the @destroy function, or
-
 
393
 * kfree() if @destroy is NULL. Thus, after a failure, dereferencing @bo is
-
 
394
 * illegal and will likely cause memory corruption.
-
 
395
 *
390
 * Returns
396
 * Returns
391
 * -ENOMEM: Out of memory.
397
 * -ENOMEM: Out of memory.
392
 * -EINVAL: Invalid placement flags.
398
 * -EINVAL: Invalid placement flags.
393
 * -ERESTARTSYS: Interrupted by signal while sleeping waiting for resources.
399
 * -ERESTARTSYS: Interrupted by signal while sleeping waiting for resources.
394
 */
400
 */
Line 399... Line 405...
399
			enum ttm_bo_type type,
405
			enum ttm_bo_type type,
400
			struct ttm_placement *placement,
406
			struct ttm_placement *placement,
401
			uint32_t page_alignment,
407
			uint32_t page_alignment,
402
			unsigned long buffer_start,
408
			unsigned long buffer_start,
403
			bool interrubtible,
409
			bool interrubtible,
404
			struct file *persistant_swap_storage,
410
			struct file *persistent_swap_storage,
405
			size_t acc_size,
411
			size_t acc_size,
406
			void (*destroy) (struct ttm_buffer_object *));
412
			void (*destroy) (struct ttm_buffer_object *));
407
/**
413
/**
408
 * ttm_bo_synccpu_object_init
414
 * ttm_bo_synccpu_object_init
409
 *
415
 *
Line 415... Line 421...
415
 * @page_alignment: Data alignment in pages.
421
 * @page_alignment: Data alignment in pages.
416
 * @buffer_start: Virtual address of user space data backing a
422
 * @buffer_start: Virtual address of user space data backing a
417
 * user buffer object.
423
 * user buffer object.
418
 * @interruptible: If needing to sleep while waiting for GPU resources,
424
 * @interruptible: If needing to sleep while waiting for GPU resources,
419
 * sleep interruptible.
425
 * sleep interruptible.
420
 * @persistant_swap_storage: Usually the swap storage is deleted for buffers
426
 * @persistent_swap_storage: Usually the swap storage is deleted for buffers
421
 * pinned in physical memory. If this behaviour is not desired, this member
427
 * pinned in physical memory. If this behaviour is not desired, this member
422
 * holds a pointer to a persistant shmem object. Typically, this would
428
 * holds a pointer to a persistent shmem object. Typically, this would
423
 * point to the shmem object backing a GEM object if TTM is used to back a
429
 * point to the shmem object backing a GEM object if TTM is used to back a
424
 * GEM user interface.
430
 * GEM user interface.
425
 * @p_bo: On successful completion *p_bo points to the created object.
431
 * @p_bo: On successful completion *p_bo points to the created object.
426
 *
432
 *
427
 * This function allocates a ttm_buffer_object, and then calls ttm_bo_init
433
 * This function allocates a ttm_buffer_object, and then calls ttm_bo_init
Line 437... Line 443...
437
				enum ttm_bo_type type,
443
				enum ttm_bo_type type,
438
				struct ttm_placement *placement,
444
				struct ttm_placement *placement,
439
				uint32_t page_alignment,
445
				uint32_t page_alignment,
440
				unsigned long buffer_start,
446
				unsigned long buffer_start,
441
				bool interruptible,
447
				bool interruptible,
442
				struct file *persistant_swap_storage,
448
				struct file *persistent_swap_storage,
443
				struct ttm_buffer_object **p_bo);
449
				struct ttm_buffer_object **p_bo);
Line 444... Line 450...
444
 
450
 
445
/**
451
/**
446
 * ttm_bo_check_placement
452
 * ttm_bo_check_placement