Skip to contentSkip to conversation

drm/radeon: add cayman VM support for append packet.

PATCH Applied Dave Airlie 2 participants 2 messages Apr 22, 2016

Subsystems (2)
lore
Share & tools
lore

Dave Airlie

author maintainer
#0 lore raw

PATCH 1/1 drm/radeon: add cayman VM support for append packet.

From: Dave Airlie <[email protected]>

This adds support for SET_APPEND_CNT packet3 to the VM paths.

---
 drivers/gpu/drm/radeon/evergreen_cs.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
drivers/gpu/drm/radeon/evergreen_cs.c +21 -0
index 18ddd75..0d3f744 100644
@@ -3483,6 +3483,27 @@ static int evergreen_vm_packet3_check(struct radeon_device *rdev,
 			}
 		}
 		break;
+	case PACKET3_SET_APPEND_CNT: {
+		uint32_t areg;
+		uint32_t allowed_reg_base;
+
+		if (pkt->count != 2) {
+			DRM_ERROR("bad SET_APPEND_CNT (invalid count)\n");
+			return -EINVAL;
+		}
+
+		allowed_reg_base = GDS_APPEND_COUNT_0;
+		allowed_reg_base -= PACKET3_SET_CONTEXT_REG_START;
+		allowed_reg_base >>= 2;
+
+		areg = idx_value >> 16;
+		if (areg < allowed_reg_base || areg > (allowed_reg_base + 11)) {
+			DRM_ERROR("forbidden register for append cnt 0x%08x at %d\n",
+				  areg, idx);
+			return -EINVAL;
+		}
+		break;
+	}
 	default:
 		return -EINVAL;
 	}
Signature · 6 lines
2.1.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Applied
#1 lore raw
Quoted 5 lines · Dave Airlie

From: Dave Airlie <[email protected]>

This adds support for SET_APPEND_CNT packet3 to the VM paths.

Applied. Thanks!

Alex

Quoted 39 lines
---
 drivers/gpu/drm/radeon/evergreen_cs.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
drivers/gpu/drm/radeon/evergreen_cs.c +21 -1
index 18ddd75..0d3f744 100644
@@ -3483,6 +3483,27 @@ static int evergreen_vm_packet3_check(struct radeon_device *rdev,
                        }
                }
                break;
+       case PACKET3_SET_APPEND_CNT: {
+               uint32_t areg;
+               uint32_t allowed_reg_base;
+
+               if (pkt->count != 2) {
+                       DRM_ERROR("bad SET_APPEND_CNT (invalid count)\n");
+                       return -EINVAL;
+               }
+
+               allowed_reg_base = GDS_APPEND_COUNT_0;
+               allowed_reg_base -= PACKET3_SET_CONTEXT_REG_START;
+               allowed_reg_base >>= 2;
+
+               areg = idx_value >> 16;
+               if (areg < allowed_reg_base || areg > (allowed_reg_base + 11)) {
+                       DRM_ERROR("forbidden register for append cnt 0x%08x at %d\n",
+                                 areg, idx);
+                       return -EINVAL;
+               }
+               break;
+       }
        default:
                return -EINVAL;
        }
--

2.1.0

Quoted 4 lines

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel