Skip to content

Commit e61f5c5

Browse files
dvrogozhSherry-Lin
authored andcommitted
drm/i915: copy installed kernel headers
Fixes: #504 We copied drm/i915 headers from kernel sources rather than from install location. As it occurs kernel build system strips out headers during installation removing certain kernel-internal stuff. So, right way to do is copy headers from install location. Change-Id: Ib83fd20d19dda0bc4805095edadef0547aeb4c2a Signed-off-by: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
1 parent cece877 commit e61f5c5

14 files changed

+39
-80
lines changed

media_driver/linux/common/ddi/media_libva_common.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#include <pthread.h>
3232

3333
#include "xf86drm.h"
34-
#include "drm_header.h"
34+
#include "drm.h"
3535
#include "i915_drm.h"
3636
#include "mos_bufmgr.h"
3737
#include "mos_context.h"

media_driver/linux/common/os/i915/include/uapi/README

+6-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@ Whenever driver needs new definitions for new kernel
44
APIs, these files should be updated.
55

66
These files in master should only be updated once the changes have landed
7-
in the drm-next repo, https://anongit.freedesktop.org/git/drm/drm.git.
7+
in the drm-next tree (see https://cgit.freedesktop.org/drm/drm/).
8+
9+
You can copy files installed after running this from the kernel
10+
repository, at version the driver require:
11+
12+
$ make headers_install INSTALL_HDR_PATH=/path/to/install
813

914
The last update was done at the following kernel commit :
1015

media_driver/linux/common/os/i915/include/uapi/drm.h

+17-25
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,7 @@
3636
#ifndef _DRM_H_
3737
#define _DRM_H_
3838

39-
#if defined(__KERNEL__)
40-
41-
#include <linux/types.h>
42-
#include <asm/ioctl.h>
43-
typedef unsigned int drm_handle_t;
44-
45-
#elif defined(__linux__)
39+
#if defined(__linux__)
4640

4741
#include <linux/types.h>
4842
#include <asm/ioctl.h>
@@ -141,11 +135,11 @@ struct drm_version {
141135
int version_minor; /**< Minor version */
142136
int version_patchlevel; /**< Patch level */
143137
__kernel_size_t name_len; /**< Length of name buffer */
144-
char __user *name; /**< Name of driver */
138+
char *name; /**< Name of driver */
145139
__kernel_size_t date_len; /**< Length of date buffer */
146-
char __user *date; /**< User-space buffer to hold date */
140+
char *date; /**< User-space buffer to hold date */
147141
__kernel_size_t desc_len; /**< Length of desc buffer */
148-
char __user *desc; /**< User-space buffer to hold desc */
142+
char *desc; /**< User-space buffer to hold desc */
149143
};
150144

151145
/**
@@ -155,12 +149,12 @@ struct drm_version {
155149
*/
156150
struct drm_unique {
157151
__kernel_size_t unique_len; /**< Length of unique */
158-
char __user *unique; /**< Unique name for driver instantiation */
152+
char *unique; /**< Unique name for driver instantiation */
159153
};
160154

161155
struct drm_list {
162156
int count; /**< Length of user-space structures */
163-
struct drm_version __user *version;
157+
struct drm_version *version;
164158
};
165159

166160
struct drm_block {
@@ -355,15 +349,15 @@ struct drm_buf_desc {
355349
*/
356350
struct drm_buf_info {
357351
int count; /**< Entries in list */
358-
struct drm_buf_desc __user *list;
352+
struct drm_buf_desc *list;
359353
};
360354

361355
/**
362356
* DRM_IOCTL_FREE_BUFS ioctl argument type.
363357
*/
364358
struct drm_buf_free {
365359
int count;
366-
int __user *list;
360+
int *list;
367361
};
368362

369363
/**
@@ -375,7 +369,7 @@ struct drm_buf_pub {
375369
int idx; /**< Index into the master buffer list */
376370
int total; /**< Buffer size */
377371
int used; /**< Amount of buffer in use (for DMA) */
378-
void __user *address; /**< Address of buffer */
372+
void *address; /**< Address of buffer */
379373
};
380374

381375
/**
@@ -384,11 +378,11 @@ struct drm_buf_pub {
384378
struct drm_buf_map {
385379
int count; /**< Length of the buffer list */
386380
#ifdef __cplusplus
387-
void __user *virt;
381+
void *virt;
388382
#else
389-
void __user *virtual; /**< Mmap'd area in user-virtual */
383+
void *virtual; /**< Mmap'd area in user-virtual */
390384
#endif
391-
struct drm_buf_pub __user *list; /**< Buffer information */
385+
struct drm_buf_pub *list; /**< Buffer information */
392386
};
393387

394388
/**
@@ -401,13 +395,13 @@ struct drm_buf_map {
401395
struct drm_dma {
402396
int context; /**< Context handle */
403397
int send_count; /**< Number of buffers to send */
404-
int __user *send_indices; /**< List of handles to buffers */
405-
int __user *send_sizes; /**< Lengths of data to send */
398+
int *send_indices; /**< List of handles to buffers */
399+
int *send_sizes; /**< Lengths of data to send */
406400
enum drm_dma_flags flags; /**< Flags */
407401
int request_count; /**< Number of buffers requested */
408402
int request_size; /**< Desired size for buffers */
409-
int __user *request_indices; /**< Buffer information */
410-
int __user *request_sizes;
403+
int *request_indices; /**< Buffer information */
404+
int *request_sizes;
411405
int granted_count; /**< Number of buffers granted */
412406
};
413407

@@ -431,7 +425,7 @@ struct drm_ctx {
431425
*/
432426
struct drm_ctx_res {
433427
int count;
434-
struct drm_ctx __user *contexts;
428+
struct drm_ctx *contexts;
435429
};
436430

437431
/**
@@ -962,7 +956,6 @@ struct drm_event_crtc_sequence {
962956
};
963957

964958
/* typedef area */
965-
#ifndef __KERNEL__
966959
typedef struct drm_clip_rect drm_clip_rect_t;
967960
typedef struct drm_drawable_info drm_drawable_info_t;
968961
typedef struct drm_tex_region drm_tex_region_t;
@@ -1004,7 +997,6 @@ typedef struct drm_agp_binding drm_agp_binding_t;
1004997
typedef struct drm_agp_info drm_agp_info_t;
1005998
typedef struct drm_scatter_gather drm_scatter_gather_t;
1006999
typedef struct drm_set_version drm_set_version_t;
1007-
#endif
10081000

10091001
#if defined(__cplusplus)
10101002
}

media_driver/linux/common/os/i915/include/uapi/drm_header.h

-32
This file was deleted.

media_driver/linux/common/os/i915/include/uapi/drm_sarea.h

-2
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,9 @@ struct drm_sarea {
8181
drm_context_t dummy_context;
8282
};
8383

84-
#ifndef __KERNEL__
8584
typedef struct drm_sarea_drawable drm_sarea_drawable_t;
8685
typedef struct drm_sarea_frame drm_sarea_frame_t;
8786
typedef struct drm_sarea drm_sarea_t;
88-
#endif
8987

9088
#if defined(__cplusplus)
9189
}

media_driver/linux/common/os/i915/include/uapi/i915_drm.h

+9-9
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
*
2525
*/
2626

27-
#ifndef _UAPI_I915_DRM_H_
28-
#define _UAPI_I915_DRM_H_
27+
#ifndef _I915_DRM_H_
28+
#define _I915_DRM_H_
2929

3030
#include "drm.h"
3131

@@ -387,25 +387,25 @@ typedef struct drm_i915_batchbuffer {
387387
int DR1; /* hw flags for GFX_OP_DRAWRECT_INFO */
388388
int DR4; /* window origin for GFX_OP_DRAWRECT_INFO */
389389
int num_cliprects; /* mulitpass with multiple cliprects? */
390-
struct drm_clip_rect __user *cliprects; /* pointer to userspace cliprects */
390+
struct drm_clip_rect *cliprects; /* pointer to userspace cliprects */
391391
} drm_i915_batchbuffer_t;
392392

393393
/* As above, but pass a pointer to userspace buffer which can be
394394
* validated by the kernel prior to sending to hardware.
395395
*/
396396
typedef struct _drm_i915_cmdbuffer {
397-
char __user *buf; /* pointer to userspace command buffer */
397+
char *buf; /* pointer to userspace command buffer */
398398
int sz; /* nr bytes in buf */
399399
int DR1; /* hw flags for GFX_OP_DRAWRECT_INFO */
400400
int DR4; /* window origin for GFX_OP_DRAWRECT_INFO */
401401
int num_cliprects; /* mulitpass with multiple cliprects? */
402-
struct drm_clip_rect __user *cliprects; /* pointer to userspace cliprects */
402+
struct drm_clip_rect *cliprects; /* pointer to userspace cliprects */
403403
} drm_i915_cmdbuffer_t;
404404

405405
/* Userspace can request & wait on irq's:
406406
*/
407407
typedef struct drm_i915_irq_emit {
408-
int __user *irq_seq;
408+
int *irq_seq;
409409
} drm_i915_irq_emit_t;
410410

411411
typedef struct drm_i915_irq_wait {
@@ -557,7 +557,7 @@ typedef struct drm_i915_getparam {
557557
* WARNING: Using pointers instead of fixed-size u64 means we need to write
558558
* compat32 code. Don't repeat this mistake.
559559
*/
560-
int __user *value;
560+
int *value;
561561
} drm_i915_getparam_t;
562562

563563
/* Ioctl to set kernel params:
@@ -580,7 +580,7 @@ typedef struct drm_i915_mem_alloc {
580580
int region;
581581
int alignment;
582582
int size;
583-
int __user *region_offset; /* offset from start of fb or agp */
583+
int *region_offset; /* offset from start of fb or agp */
584584
} drm_i915_mem_alloc_t;
585585

586586
typedef struct drm_i915_mem_free {
@@ -1743,4 +1743,4 @@ struct drm_i915_query_topology_info {
17431743
}
17441744
#endif
17451745

1746-
#endif /* _UAPI_I915_DRM_H_ */
1746+
#endif /* _I915_DRM_H_ */

media_driver/linux/common/os/i915/include/uapi/media_srcs.cmake

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ set(TMP_HEADERS_
2626
${CMAKE_CURRENT_LIST_DIR}/drm_mode.h
2727
${CMAKE_CURRENT_LIST_DIR}/drm_sarea.h
2828
${CMAKE_CURRENT_LIST_DIR}/i915_drm.h
29-
${CMAKE_CURRENT_LIST_DIR}/drm_header.h
3029
)
3130

3231
# no source in this folder

media_driver/linux/common/os/i915/include/xf86drm.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
#include <stdarg.h>
3838
#include <sys/types.h>
3939
#include <stdint.h>
40-
#include "drm_header.h"
40+
#include "drm.h"
4141
#include "libdrm_macros.h"
4242
#if defined(__cplusplus)
4343
extern "C" {

media_driver/linux/common/os/i915/include/xf86drmMode.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
extern "C" {
4141
#endif
4242

43-
#include <drm_header.h>
43+
#include <drm.h>
4444

4545
/*
4646
* This is the interface for modesetting for drm.

media_driver/linux/common/os/i915/mos_bufmgr_api.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#include <stdint.h>
3535
#include <assert.h>
3636
#include <errno.h>
37-
#include <drm_header.h>
37+
#include <drm.h>
3838
#include <i915_drm.h>
3939
#include <pciaccess.h>
4040
#include "libdrm_macros.h"

media_driver/linux/common/os/mos_auxtable_mgr.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#define MOS_AUXTABLE_MGR_H
2929

3030
#include "xf86drm.h"
31-
#include "drm_header.h"
31+
#include "drm.h"
3232
#include "i915_drm.h"
3333
#include "mos_bufmgr.h"
3434
#include "mos_os.h"

media_driver/linux/common/os/mos_os_specific.h

-3
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@
3535
#ifdef ANDROID
3636
#include <utils/Log.h>
3737
#endif
38-
#ifndef __user
39-
#define __user
40-
#endif
4138
#include "i915_drm.h"
4239
#include "mos_bufmgr.h"
4340
#include "xf86drm.h"

media_driver/linux/ult/libdrm_mock/mos_bufmgr_api_mock.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#include <stdint.h>
3535
#include <assert.h>
3636
#include <errno.h>
37-
#include "drm_header.h"
37+
#include "drm.h"
3838
#include "i915_drm.h"
3939
#include <pciaccess.h>
4040
#include "libdrm_macros.h"

media_driver/linux/ult/libdrm_mock/xf86drmMode_mock.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343

4444
#include "xf86drmMode.h"
4545
#include "xf86drm.h"
46-
#include "drm_header.h"
46+
#include "drm.h"
4747
#include <string.h>
4848
#include <dirent.h>
4949
#include <unistd.h>

0 commit comments

Comments
 (0)