type: make the definitions into enum values. 66/172366/2
authorSooChan Lim <sc1.lim@samsung.com>
Tue, 13 Mar 2018 06:28:08 +0000 (15:28 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Wed, 14 Mar 2018 05:42:50 +0000 (05:42 +0000)
for device and option

Change-Id: Ie884c2cb9eb4d2c3a730eba55f68d32eebaba783

src/tbm_type_int.h

index 7cf375e..43f72a6 100644 (file)
@@ -117,50 +117,28 @@ enum TBM_BUFMGR_CAPABILITY {
 };
 
 /**
- * @brief Definition for the device type to get the default handle
+ * @brief Definition for the device type to access tbm_bo
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  */
-#define TBM_DEVICE_DEFAULT   0
-/**
- * @brief Definition for the device type to get the virtual memory
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- */
-#define TBM_DEVICE_CPU       1
-/**
- * @brief Definition for the device type to get the 2D memory handle
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- */
-#define TBM_DEVICE_2D        2
-/**
- * @brief Definition for the device type to get the 3D memory handle
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- */
-#define TBM_DEVICE_3D        3
-/**
- * @brief Definition for the device type to get the multimedia handle
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- */
-#define TBM_DEVICE_MM        4
+typedef enum {
+       TBM_DEVICE_DEFAULT = 0,  /**< the device type to get the default handle */
+       TBM_DEVICE_CPU,          /**< the device type to get the virtual memory */
+       TBM_DEVICE_2D,           /**< the device type to get the 2D memory handle */
+       TBM_DEVICE_3D,           /**< the device type to get the 3D memory handle */
+       TBM_DEVICE_MM,           /**< the device type to get the the multimedia handle */
 
-/* TBM_OPTION */
+} tbm_bo_device_type;
 
 /**
- * @brief Definition for the access option to read
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- */
-#define TBM_OPTION_READ      (1 << 0)
-/**
- * @brief Definition for the access option to write
+ * @brief Definition for the optoin to access tbm_bo
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  */
-#define TBM_OPTION_WRITE     (1 << 1)
-/**
- * @brief Definition for the vendor specific option that depends on the backend
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- */
-#define TBM_OPTION_VENDOR    (0xffff0000)
-
-
+typedef enum {
+       TBM_OPTION_NONE = (1 << 0),        /**< the option is none */
+       TBM_OPTION_READ = (1 << 0),        /**< the option to access to read the bo */
+       TBM_OPTION_WRITE = (1 << 1),       /**< the option to access to write the bo */
+       TBM_OPTION_VENDOR = (0xffff0000),  /**< the the vendor specific option that depends on the backend */
+} tbm_bo_access_option;
 
 /**
  * @brief tbm_bo_handle abstraction of the memory handle by TBM_DEVICE_TYPE