Home | History | Annotate | Download | only in moorefield
      1 /*
      2  * Copyright (c) 2014 Intel Corporation.  All rights reserved.
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  * http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 #ifndef __DRM_VENDOR_API__
     18 #define __DRM_VENDOR_API__
     19 
     20 #include <sepdrm.h>
     21 #include <pr_drm_api.h>
     22 #include <fcntl.h>
     23 #include <linux/psb_drm.h>
     24 #include "xf86drm.h"
     25 #include "xf86drmMode.h"
     26 
     27 typedef uint32_t (*drm_keep_alive_t)(uint32_t session_id, uint32_t *timeout);
     28 typedef uint32_t (*drm_start_playback_t)(void);
     29 typedef uint32_t (*drm_stop_playback_t)(void);
     30 typedef uint32_t (*drm_pr_return_naluheaders_t)(uint32_t session_id, struct drm_nalu_headers *nalu_info);
     31 typedef uint32_t (*drm_wv_return_naluheaders_t)(uint32_t session_id, struct drm_wv_nalu_headers *nalu_info);
     32 
     33 struct drm_vendor_api {
     34     void *handle;
     35     drm_keep_alive_t drm_keep_alive;
     36     drm_start_playback_t drm_start_playback;
     37     drm_stop_playback_t drm_stop_playback;
     38     drm_pr_return_naluheaders_t drm_pr_return_naluheaders;
     39     drm_wv_return_naluheaders_t drm_wv_return_naluheaders;
     40 };
     41 
     42 /* Initialize the function pointers structure opening the vendor library
     43    Returns 0 on case of success, 1 in case of error */
     44 uint32_t drm_vendor_api_init(struct drm_vendor_api *api);
     45 
     46 /* Close the function pointers structure
     47    Returns 0 on case of success, 1 in case of error */
     48 uint32_t drm_vendor_api_deinit(struct drm_vendor_api *api);
     49 
     50 #endif  /* #ifndef __DRM_VENDOR_API__ */
     51