~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/drm/drm_flip_work.h

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * Copyright (C) 2013 Red Hat
  3  *
  4  * Permission is hereby granted, free of charge, to any person obtaining a
  5  * copy of this software and associated documentation files (the "Software"),
  6  * to deal in the Software without restriction, including without limitation
  7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8  * and/or sell copies of the Software, and to permit persons to whom the
  9  * Software is furnished to do so, subject to the following conditions:
 10  *
 11  * The above copyright notice and this permission notice (including the next
 12  * paragraph) shall be included in all copies or substantial portions of the
 13  * Software.
 14  *
 15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 16  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 17  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 18  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 19  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 20  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 21  * SOFTWARE.
 22  */
 23 
 24 #ifndef DRM_FLIP_WORK_H
 25 #define DRM_FLIP_WORK_H
 26 
 27 #include <linux/kfifo.h>
 28 #include <linux/spinlock.h>
 29 #include <linux/workqueue.h>
 30 
 31 /**
 32  * DOC: flip utils
 33  *
 34  * Utility to queue up work to run from work-queue context after flip/vblank.
 35  * Typically this can be used to defer unref of framebuffer's, cursor
 36  * bo's, etc until after vblank. The APIs are all thread-safe. Moreover,
 37  * drm_flip_work_commit() can be called in atomic context.
 38  */
 39 
 40 struct drm_flip_work;
 41 
 42 /*
 43  * drm_flip_func_t - callback function
 44  *
 45  * @work: the flip work
 46  * @val: value queued via drm_flip_work_queue()
 47  *
 48  * Callback function to be called for each of the  queue'd work items after
 49  * drm_flip_work_commit() is called.
 50  */
 51 typedef void (*drm_flip_func_t)(struct drm_flip_work *work, void *val);
 52 
 53 /**
 54  * struct drm_flip_work - flip work queue
 55  * @name: debug name
 56  * @func: callback fxn called for each committed item
 57  * @worker: worker which calls @func
 58  * @queued: queued tasks
 59  * @commited: commited tasks
 60  * @lock: lock to access queued and commited lists
 61  */
 62 struct drm_flip_work {
 63         const char *name;
 64         drm_flip_func_t func;
 65         struct work_struct worker;
 66         struct list_head queued;
 67         struct list_head commited;
 68         spinlock_t lock;
 69 };
 70 
 71 void drm_flip_work_queue(struct drm_flip_work *work, void *val);
 72 void drm_flip_work_commit(struct drm_flip_work *work,
 73                 struct workqueue_struct *wq);
 74 void drm_flip_work_init(struct drm_flip_work *work,
 75                 const char *name, drm_flip_func_t func);
 76 void drm_flip_work_cleanup(struct drm_flip_work *work);
 77 
 78 #endif  /* DRM_FLIP_WORK_H */
 79 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php