Paullux

Untitled

Nov 22nd, 2016
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.71 KB | None | 0 0
  1. From 115cdb5a06b112674d9652ef44d7f19583ff0136 Mon Sep 17 00:00:00 2001
  2. From: David McFarland <[email protected]>
  3. Date: Wed, 26 Oct 2016 22:26:39 -0300
  4. Subject: [PATCH 15/15] Remove dependency on System.map
  5.  
  6. ---
  7. amd/amdgpu/amdgpu_acp.c | 4 +++-
  8. amd/amdgpu/amdgpu_connectors.c | 8 ++++++--
  9. amd/amdgpu/amdgpu_gds.h | 9 +++++++++
  10. amd/amdgpu/amdgpu_ttm.c | 12 +++++++++---
  11. amd/backport/include/kcl/kcl_mm.h | 4 +++-
  12. amd/dal/amdgpu_dm/amdgpu_dm_types.c| 9 ++++++++-
  13. amd/dal/Makefile | 4 +++-
  14. 7 files changed, 41 insertions(+), 9 deletions(-)
  15.  
  16. diff -ur a/amd/amdgpu/amdgpu_acp.c b/amd/amdgpu/amdgpu_acp.c
  17. --- a/amd/amdgpu/amdgpu_acp.c 2016-10-25 03:01:17.000000000 +0200
  18. +++ b/amd/amdgpu/amdgpu_acp.c 2016-11-20 11:32:51.000000000 +0100
  19. @@ -434,7 +434,9 @@
  20. * hw and ACP-genpd status are in sync.
  21. * 'suspend_power_off' represents "Power status before system suspend"
  22. */
  23. - if (adev->acp.acp_genpd->gpd.suspend_power_off == true) {
  24. + // HACK, power_off suggested by gcc, cast to bool is doubtful.
  25. + // if (adev->acp.acp_genpd->gpd.suspend_power_off == true) {
  26. + if ((bool) adev->acp.acp_genpd->gpd.power_off == true) {
  27. apd = container_of(&adev->acp.acp_genpd->gpd,
  28. struct acp_pm_domain, gpd);
  29.  
  30. diff -ur a/amd/amdgpu/amdgpu_connectors.c b/amd/amdgpu/amdgpu_connectors.c
  31. --- a/amd/amdgpu/amdgpu_connectors.c 2016-10-25 03:01:17.000000000 +0200
  32. +++ b/amd/amdgpu/amdgpu_connectors.c 2016-11-20 10:58:39.000000000 +0100
  33. @@ -168,12 +168,16 @@
  34. }
  35.  
  36. /* Any defined maximum tmds clock limit we must not exceed? */
  37. - if (connector->max_tmds_clock > 0) {
  38. + // HACK
  39. + // if (connector->max_tmds_clock > 0) {
  40. + if (connector->display_info.max_tmds_clock > 0) {
  41. /* mode_clock is clock in kHz for mode to be modeset on this connector */
  42. mode_clock = amdgpu_connector->pixelclock_for_modeset;
  43.  
  44. /* Maximum allowable input clock in kHz */
  45. - max_tmds_clock = connector->max_tmds_clock * 1000;
  46. + // HACK
  47. + // max_tmds_clock = connector->max_tmds_clock * 1000;
  48. + max_tmds_clock = connector->display_info.max_tmds_clock * 1000;
  49.  
  50. DRM_DEBUG("%s: hdmi mode dotclock %d kHz, max tmds input clock %d kHz.\n",
  51. connector->name, mode_clock, max_tmds_clock);
  52.  
  53. diff -ur a/amd/amdgpu/amdgpu_gds.h b/amd/amdgpu/amdgpu_gds.h
  54. --- a/amd/amdgpu/amdgpu_gds.h 2016-11-20 16:13:01.166729742 +0100
  55. +++ b/amd/amdgpu/amdgpu_gds.h 2016-11-20 11:16:09.000000000 +0100
  56. @@ -31,6 +31,15 @@
  57. #define AMDGPU_GWS_SHIFT PAGE_SHIFT
  58. #define AMDGPU_OA_SHIFT PAGE_SHIFT
  59.  
  60. +//HACK : following amdgpu_ttm.h
  61. +#define TTM_PL_PRIV0 (TTM_PL_PRIV + 0)
  62. +#define TTM_PL_PRIV1 (TTM_PL_PRIV + 1)
  63. +#define TTM_PL_PRIV2 (TTM_PL_PRIV + 2)
  64. +
  65. +#define TTM_PL_FLAG_PRIV0 (TTM_PL_FLAG_PRIV << 0)
  66. +#define TTM_PL_FLAG_PRIV1 (TTM_PL_FLAG_PRIV << 1)
  67. +#define TTM_PL_FLAG_PRIV2 (TTM_PL_FLAG_PRIV << 2)
  68. +
  69. #define AMDGPU_PL_GDS TTM_PL_PRIV0
  70. #define AMDGPU_PL_GWS TTM_PL_PRIV1
  71. #define AMDGPU_PL_OA TTM_PL_PRIV2
  72.  
  73. diff -ur a/amd/amdgpu/amdgpu_ttm.c b/amd/amdgpu/amdgpu_ttm.c
  74. --- a/amd/amdgpu/amdgpu_ttm.c 2016-11-19 22:31:47.000000000 +0100
  75. +++ b/amd/amdgpu/amdgpu_ttm.c 2016-11-20 11:12:02.000000000 +0100
  76. @@ -225,7 +225,9 @@
  77.  
  78. if (amdgpu_ttm_tt_get_usermm(bo->ttm))
  79. return -EPERM;
  80. - return drm_vma_node_verify_access(&rbo->gem_base.vma_node, filp);
  81. + // HACK
  82. + // return drm_vma_node_verify_access(&rbo->gem_base.vma_node, filp);
  83. + return drm_vma_node_verify_access(&rbo->gem_base.vma_node, filp->private_data);
  84. }
  85.  
  86. static void amdgpu_move_null(struct ttm_buffer_object *bo,
  87. @@ -345,7 +347,9 @@
  88. goto out_cleanup;
  89. }
  90. #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
  91. - r = ttm_bo_move_ttm(bo, true, interruptible, no_wait_gpu, new_mem);
  92. + // HACK
  93. + // r = ttm_bo_move_ttm(bo, true, interruptible, no_wait_gpu, new_mem);
  94. + r = ttm_bo_move_ttm(bo, true, no_wait_gpu, new_mem);
  95. #else
  96. r = ttm_bo_move_ttm(bo, true, no_wait_gpu, new_mem);
  97. #endif
  98. @@ -382,7 +386,9 @@
  99. return r;
  100. }
  101. #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
  102. - r = ttm_bo_move_ttm(bo, true, interruptible, no_wait_gpu, &tmp_mem);
  103. + // HACK
  104. + // r = ttm_bo_move_ttm(bo, true, interruptible, no_wait_gpu, &tmp_mem);
  105. + r = ttm_bo_move_ttm(bo, true, no_wait_gpu, &tmp_mem);
  106. #else
  107. r = ttm_bo_move_ttm(bo, true, no_wait_gpu, &tmp_mem);
  108. #endif
  109.  
  110. diff -ur a/amd/backport/include/kcl/kcl_mm.h b/amd/backport/include/kcl/kcl_mm.h
  111. --- a/amd/backport/include/kcl/kcl_mm.h 2016-10-25 03:01:17.000000000 +0200
  112. +++ b/amd/backport/include/kcl/kcl_mm.h 2016-11-20 10:43:28.000000000 +0100
  113. @@ -9,7 +9,9 @@
  114. struct vm_area_struct **vmas)
  115. {
  116. #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
  117. - return get_user_pages(start, nr_pages, write, force, pages, vmas);
  118. + // HACK
  119. + return get_user_pages(start, nr_pages, write, pages, vmas);
  120. + //return get_user_pages(start, nr_pages, write, force, pages, vmas);
  121. #else
  122. return get_user_pages(tsk, mm, start, nr_pages,
  123. write, force, pages, vmas);
  124.  
  125. diff -ur a/amd/dal/amdgpu_dm/amdgpu_dm_types.c b/amd/dal/amdgpu_dm/amdgpu_dm_types.c
  126. --- a/amd/dal/amdgpu_dm/amdgpu_dm_types.c 2016-11-19 22:31:47.000000000 +0100
  127. +++ b/amd/dal/amdgpu_dm/amdgpu_dm_types.c 2016-11-20 15:21:03.000000000 +0100
  128. @@ -909,8 +909,15 @@
  129. }
  130. }
  131.  
  132. +// HACK
  133. +/*
  134. + * static struct dc_target *create_target_for_sink(
  135. + * const struct amdgpu_connector *aconnector,
  136. + * const struct drm_display_mode *drm_mode,
  137. + * const struct dm_connector_state *dm_state)
  138. + * */
  139. static struct dc_target *create_target_for_sink(
  140. - const struct amdgpu_connector *aconnector,
  141. + struct amdgpu_connector *aconnector,
  142. const struct drm_display_mode *drm_mode,
  143. const struct dm_connector_state *dm_state)
  144. {
  145. @@ -1640,8 +1647,11 @@
  146. }
  147.  
  148. static const struct drm_plane_helper_funcs dm_plane_helper_funcs = {
  149. - .prepare_fb = dm_plane_helper_prepare_fb,
  150. - .cleanup_fb = dm_plane_helper_cleanup_fb,
  151. + // HACK
  152. + // .prepare_fb = dm_plane_helper_prepare_fb,
  153. + // .cleanup_fb = dm_plane_helper_cleanup_fb,
  154. + .prepare_fb = (void*) dm_plane_helper_prepare_fb,
  155. + .cleanup_fb = (void*) dm_plane_helper_cleanup_fb,
  156. };
  157.  
  158. /*
  159.  
  160. diff -ur a/amd/dal/Makefile b/amd/dal/Makefile
  161. --- a/amd/dal/Makefile 2016-10-25 03:01:17.000000000 +0200
  162. +++ b/amd/dal/Makefile 2016-11-20 15:30:24.000000000 +0100
  163. @@ -5,7 +5,9 @@
  164.  
  165. AMDDALPATH = $(RELATIVE_AMD_DAL_PATH)
  166.  
  167. -subdir-ccflags-y += -Werror
  168. +# HACK : non guarded if statements in freesync.c
  169. +# subdir-ccflags-y += -Werror
  170. +subdir-ccflags-y += -Wno-error
  171.  
  172. subdir-ccflags-y += -I$(AMDDALPATH)/ -I$(AMDDALPATH)/include
  173. --
  174. 2.10.1
Advertisement
Add Comment
Please, Sign In to add comment