Skip to content

Commit

Permalink
MALI: v4.15-rc build fix
Browse files Browse the repository at this point in the history
Signed-off-by: John Stultz <[email protected]>
Signed-off-by: Neil Armstrong <[email protected]>
  • Loading branch information
johnstultz-work authored and superna9999 committed Feb 7, 2018
1 parent 9301aa8 commit 68c0671
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 12 deletions.
2 changes: 1 addition & 1 deletion driver/src/devicedrv/mali/common/mali_control_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ void mali_control_timer_add(u32 timeout)
_mali_osk_timer_add(mali_control_timer, _mali_osk_time_mstoticks(timeout));
}

static void mali_control_timer_callback(void *arg)
static void mali_control_timer_callback(struct timer_list *t)
{
if (mali_utilization_enabled()) {
struct mali_gpu_utilization_data *util_data = NULL;
Expand Down
8 changes: 5 additions & 3 deletions driver/src/devicedrv/mali/common/mali_group.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ int mali_max_job_runtime = MALI_MAX_JOB_RUNTIME_DEFAULT;
static void mali_group_bottom_half_mmu(void *data);
static void mali_group_bottom_half_gp(void *data);
static void mali_group_bottom_half_pp(void *data);
static void mali_group_timeout(void *data);
static void mali_group_timeout(struct timer_list *t);
static void mali_group_reset_pp(struct mali_group *group);
static void mali_group_reset_mmu(struct mali_group *group);

Expand Down Expand Up @@ -1768,9 +1768,11 @@ static void mali_group_bottom_half_pp(void *data)
mali_pp_get_rawstat(group->pp_core), 0);
}

static void mali_group_timeout(void *data)
static void mali_group_timeout(struct timer_list *t)
{
struct mali_group *group = (struct mali_group *)data;
_mali_osk_timer_t *tim = container_of(t, _mali_osk_timer_t, timer);
struct mali_group *group = container_of(&tim, struct mali_group, timeout_timer);

MALI_DEBUG_ASSERT_POINTER(group);

MALI_DEBUG_PRINT(2, ("Group: timeout handler for %s at %u\n",
Expand Down
8 changes: 7 additions & 1 deletion driver/src/devicedrv/mali/common/mali_osk_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ typedef unsigned long long u64;
#include <linux/types.h>
#endif

#include <linux/timer.h>
/** @brief Mali Boolean type which uses MALI_TRUE and MALI_FALSE
*/
typedef unsigned long mali_bool;
Expand Down Expand Up @@ -395,7 +396,12 @@ typedef struct _mali_osk_notification_t_struct {
* by any callers of _mali_osk_timer_del(). Otherwise, a deadlock may occur.
*
* @param arg Function-specific data */
typedef void (*_mali_osk_timer_callback_t)(void *arg);
typedef void (*_mali_osk_timer_callback_t)(struct timer_list *t);


struct _mali_osk_timer_t_struct {
struct timer_list timer;
};

/** @brief Private type for Timer Callback Objects */
typedef struct _mali_osk_timer_t_struct _mali_osk_timer_t;
Expand Down
4 changes: 3 additions & 1 deletion driver/src/devicedrv/mali/linux/mali_memory_os_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,9 @@ int mali_mem_os_alloc_pages(mali_mem_os_mem *os_mem, u32 size)
/* Allocate new pages, if needed. */
for (i = 0; i < remaining; i++) {
dma_addr_t dma_addr;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 13, 0)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
gfp_t flags = __GFP_ZERO | __GFP_NOWARN;
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 13, 0)
gfp_t flags = __GFP_ZERO | __GFP_NOWARN | __GFP_COLD;
#else
gfp_t flags = __GFP_ZERO | __GFP_REPEAT | __GFP_NOWARN | __GFP_COLD;
Expand Down
20 changes: 14 additions & 6 deletions driver/src/devicedrv/mali/linux/mali_osk_timers.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,25 @@
#include "mali_osk.h"
#include "mali_kernel_common.h"

struct _mali_osk_timer_t_struct {
struct timer_list timer;
};
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0)

#define TIMER_DATA_TYPE unsigned long
#define TIMER_FUNC_TYPE void (*)(TIMER_DATA_TYPE)

static inline void timer_setup(struct timer_list *timer,
void (*callback)(struct timer_list *),
unsigned int flags)
{
__setup_timer(timer, (TIMER_FUNC_TYPE)callback,
(TIMER_DATA_TYPE)timer, flags);
}
#endif

typedef void (*timer_timeout_function_t)(unsigned long);

_mali_osk_timer_t *_mali_osk_timer_init(void)
{
_mali_osk_timer_t *t = (_mali_osk_timer_t *)kmalloc(sizeof(_mali_osk_timer_t), GFP_KERNEL);
if (NULL != t) init_timer(&t->timer);
return t;
}

Expand Down Expand Up @@ -65,8 +74,7 @@ mali_bool _mali_osk_timer_pending(_mali_osk_timer_t *tim)
void _mali_osk_timer_setcallback(_mali_osk_timer_t *tim, _mali_osk_timer_callback_t callback, void *data)
{
MALI_DEBUG_ASSERT_POINTER(tim);
tim->timer.data = (unsigned long)data;
tim->timer.function = (timer_timeout_function_t)callback;
timer_setup(&tim->timer, callback, 0);
}

void _mali_osk_timer_term(_mali_osk_timer_t *tim)
Expand Down

0 comments on commit 68c0671

Please sign in to comment.